vibetunnel/web/src/server
Helmut Januschka fc162ad55c
Prevent recursive VibeTunnel sessions (GitHub #95) (#104)
* Prevent recursive VibeTunnel sessions (GitHub #95)

Added detection and prevention of nested VibeTunnel sessions to avoid
recursive 'vt' command execution.

Changes:
- Set INSIDE_VIBETUNNEL and VIBETUNNEL_SESSION environment variables when creating PTY sessions
- Added check in vt script to detect if already inside a VibeTunnel session
- Shows helpful error message when recursive session is attempted

This prevents the confusing behavior where users could run 'vt' inside a
VibeTunnel session, creating nested terminal instances. Now users get a
clear error message explaining they're already in a VibeTunnel session.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Improve recursive session prevention based on PR feedback

- Consolidate to single environment variable VIBETUNNEL_SESSION_ID
- Add session ID for debugging purposes as requested
- Show session ID in error message for better user feedback
- Remove redundant environment variables (INSIDE_VIBETUNNEL, VIBETUNNEL_SESSION)

This addresses feedback from PR #104 to use a single, more informative
environment variable that serves both purposes: preventing recursion
and providing debugging information.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-27 21:05:36 +02:00
..
middleware Fix auth check 2025-06-25 11:49:15 +02:00
pty Prevent recursive VibeTunnel sessions (GitHub #95) (#104) 2025-06-27 21:05:36 +02:00
routes Add new terminal quick keyboard 2025-06-25 12:22:13 +02:00
services Add comprehensive server tests and switch to Biome linter (#73) 2025-06-24 18:51:38 +02:00
utils Add comprehensive server tests and switch to Biome linter (#73) 2025-06-24 18:51:38 +02:00
claude-patch.ts Add Claude debugger patch and disable bell character handling 2025-06-25 20:05:41 +02:00
fwd.ts Add comprehensive server tests and switch to Biome linter (#73) 2025-06-24 18:51:38 +02:00
server.ts fix: update tests to work with --no-auth flag and fix buffer size expectations 2025-06-25 02:11:18 +02:00
version.test.ts Fix URL link detection for wrapped URLs on mobile terminals (#85) 2025-06-26 22:37:49 +02:00
version.ts Add comprehensive server tests and switch to Biome linter (#73) 2025-06-24 18:51:38 +02:00