Skip to content

feat: delete session from within attached tmux session (Ctrl+D)#42

Open
omrisavra wants to merge 2 commits into
Frayo44:mainfrom
omrisavra:feat/delete-session-from-tmux
Open

feat: delete session from within attached tmux session (Ctrl+D)#42
omrisavra wants to merge 2 commits into
Frayo44:mainfrom
omrisavra:feat/delete-session-from-tmux

Conversation

@omrisavra
Copy link
Copy Markdown

Summary

  • Adds Ctrl+D keybind inside attached tmux sessions to delete the current session
  • Uses the existing signal file pattern (same as Ctrl+K for command palette and Ctrl+L for session list): creates /tmp/agent-view-delete-session, detaches, and the TUI picks up the signal to trigger the standard delete flow
  • For worktree sessions, the confirmation dialog ("Delete session and worktree" / "Delete session only") is shown as usual
  • Keybind hint added to the tmux status bar

Changes

  • src/core/tmux.conf — new Ctrl+D keybind + status bar hint
  • src/core/tmux.tsDELETE_SESSION_SIGNAL constant, wasDeleteSessionRequested() function, signal cleanup in attachSessionSync
  • src/tui/routes/home.tsx — check for delete signal after detach, trigger handleDelete()

Test plan

  • Attach to a session, press Ctrl+D — should detach and show delete confirmation (or delete directly for non-worktree sessions)
  • Attach to a worktree session, press Ctrl+D — should show "Delete session and worktree" / "Delete session only" dialog
  • Press Ctrl+Q (regular detach) — should still work as before, no delete triggered
  • Press Ctrl+K / Ctrl+L — should still work as before

🤖 Generated with Claude Code

omri-savransky-cyera and others added 2 commits March 26, 2026 19:33
Previously, only the visible screen was cleared (\x1b[2J) when
attaching/detaching tmux sessions. This left previous session content
in the terminal's scrollback buffer, visible when scrolling up.

Added \x1b[3J (clear scrollback) alongside \x1b[2J in all screen
transition points: attachSessionSync, attachWithPty, SSH attach, and
updater. Also added refresh-client after switch-client in tmux.conf
to force clean redraws when switching sessions via Ctrl+]/Ctrl+\.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a new keybind (Ctrl+D) that allows deleting the current session
directly from within the attached tmux window, without having to
detach first and navigate the home screen.

Uses the same signal file pattern as Ctrl+K (command palette) and
Ctrl+L (session list): creates /tmp/agent-view-delete-session, detaches,
and the TUI picks up the signal to trigger the existing delete flow
(including worktree cleanup confirmation dialog).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants