Skip to content

fix(tmux): Ctrl+Q swallowed when agent-deck runs inside outer tmux#422

Merged
asheshgoplani merged 1 commit intoasheshgoplani:mainfrom
Steven17D:fix/ctrl-q-nested-tmux
Mar 26, 2026
Merged

fix(tmux): Ctrl+Q swallowed when agent-deck runs inside outer tmux#422
asheshgoplani merged 1 commit intoasheshgoplani:mainfrom
Steven17D:fix/ctrl-q-nested-tmux

Conversation

@Steven17D
Copy link
Copy Markdown
Contributor

Problem

When agent-deck runs inside an outer tmux session (e.g. auto-started from .zshrc), Ctrl+Q does nothing. The key is silently swallowed.

The bind-key -T root C-q uses if-shell with an exact session name match. Inside an outer tmux, the current session_name is the outer session, not the agentdeck session. The condition fails and the empty else clause consumes the key before it reaches agent-deck's PTY stdin reader.

Fix

  • Use grep -q '^agentdeck_' prefix match instead of exact session name
  • Forward send-keys C-q on mismatch instead of empty else clause

Relates to #410

Test plan

  • Run agent-deck inside an outer tmux session — Ctrl+Q detaches
  • Run agent-deck directly (no outer tmux) — Ctrl+Q still works

The bind-key -T root C-q used an exact session name match via if-shell.
When agent-deck runs inside an outer tmux session (e.g. auto-started from
.zshrc), the current session_name is "main", not the agentdeck session.
The condition fails and the empty else clause silently swallows the key,
preventing it from reaching agent-deck's PTY stdin reader.

- Use grep prefix match for all agentdeck_* sessions instead of exact name
- Forward send-keys C-q on mismatch so the key reaches the pane

Fixes asheshgoplani#410

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@asheshgoplani asheshgoplani merged commit 965cc83 into asheshgoplani:main Mar 26, 2026
1 check passed
asheshgoplani added a commit that referenced this pull request Mar 26, 2026
Reverts #422 (Ctrl+Q bind), #420 (ANSI reset), #418 (extended-keys CSI u),
#394 (keyboard mode after detach). These changes broke session creation and
restart on macOS due to terminal capability detection differences.

Also adds schema migration upgrade tests for statedb.

Committed by Ashesh Goplani
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.

3 participants