Skip to content

[codex] fix(dev): avoid focusing created restart tmux window#69

Draft
miaoz wants to merge 1 commit intoalexei-led:mainfrom
miaoz:codex/avoid-tmux-window-focus
Draft

[codex] fix(dev): avoid focusing created restart tmux window#69
miaoz wants to merge 1 commit intoalexei-led:mainfrom
miaoz:codex/avoid-tmux-window-focus

Conversation

@miaoz
Copy link
Copy Markdown
Contributor

@miaoz miaoz commented Apr 29, 2026

Summary

  • Create the missing dev supervisor window in detached mode.
  • Insert it after the target session instead of making it the current tmux window.

Why

scripts/restart.sh status/start/restart calls ensure_target() before sending keys or capturing output. When the ccgram tmux session already exists but the __main__ window is missing, tmux new-window currently creates that window and makes it current for attached clients.

That can steal focus from whatever window the developer is actively using in the same tmux session. Using new-window -d keeps the current window unchanged while still creating the target window for subsequent send-keys and capture-pane calls.

Validation

  • bash -n scripts/restart.sh

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