Skip to content

Harden tmux session isolation, improve interactive pane capture reliability, and add /kill command#46

Open
Mage212 wants to merge 5 commits intosix-ddc:mainfrom
Mage212:codex/pr-main
Open

Harden tmux session isolation, improve interactive pane capture reliability, and add /kill command#46
Mage212 wants to merge 5 commits intosix-ddc:mainfrom
Mage212:codex/pr-main

Conversation

@Mage212
Copy link
Contributor

@Mage212 Mage212 commented Mar 1, 2026

This PR improves tmux session isolation, directory handling, interactive UI reliability, and topic lifecycle control in Telegram.

Key changes
Prevent leaking active bot venv into tmux Claude sessions
Claude launch now explicitly sanitizes inherited environment (VIRTUAL_ENV, UV_PROJECT, UV_WORKING_DIRECTORY) before starting the command in a new tmux window.
This prevents uv/Python tooling inside Claude from accidentally using the bot’s own environment/workspace.
Benefit: safer and more predictable execution context for project commands run by Claude.

Directory workflow from filesystem root (not bot project folder)
Session creation/browsing flow now starts from filesystem root context instead of being implicitly tied to the bot repo directory.
Also hardens working-directory isolation by forcing cd <selected_path> before Claude launch.
Benefit: users can reliably start sessions in any project on the host, independent of where the bot process is running.

tmux window hardening for more reliable interactive command detection
New windows are set to a fixed/manual size to reduce TUI wrapping variance and improve parser stability for interactive prompts.
Pane capture is more resilient and includes scrollback-aware behavior, so detection can still find prompts/command context when content is too large for the visible screen.
Benefit: significantly more stable detection of permission/input UIs and fewer missed controls in long outputs.

Implemented /kill command
Added dedicated /kill bot handler.
/kill now terminates the bound tmux window and unbinds the current topic (with proper cleanup behavior).
Added focused tests for /kill scenarios.
Benefit: explicit, user-driven session termination path that matches documented behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant