Skip to content

Fix tmux attach disconnect cleanup for issue #2197#2199

Open
Yeachan-Heo wants to merge 1 commit intodevfrom
omc/issue-2197-ssh-disconnect-tmux
Open

Fix tmux attach disconnect cleanup for issue #2197#2199
Yeachan-Heo wants to merge 1 commit intodevfrom
omc/issue-2197-ssh-disconnect-tmux

Conversation

@Yeachan-Heo
Copy link
Copy Markdown
Owner

Summary

  • split outside-tmux launch into separate tmux create/set-option/attach steps
  • preserve detached tmux sessions when attach is interrupted but the session still exists
  • add regression coverage for interrupted attach preservation and detached launch fallback

Testing

  • npx vitest run src/cli/tests/launch.test.ts
  • npx eslint src/cli/launch.ts src/cli/tests/launch.test.ts
  • npx tsc --noEmit

Closes #2197

The outside-tmux launch path used one compound tmux invocation and treated any attach failure as a failed launch, which killed valid detached sessions during SSH disconnects. Split detached startup from attach, keep mouse setup non-fatal, and only fall back to direct launch when detached session creation or post-attach session validation actually fails.

The regression tests now assert ordered tmux calls, preserve-session behavior on interrupted attach, and direct fallback when detached creation never succeeded.

Constraint: Keep issue #2197 scoped to tmux detach/attach/fallback behavior
Rejected: Keep one compound tmux call with unconditional cleanup | still conflates launch success with attach interruption
Rejected: Preserve sessions without probing tmux state after attach failure | weaker fallback discrimination when the detached session is actually gone
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep detached session creation and attach handling separate unless future tmux semantics are re-verified
Tested: npx vitest run src/cli/__tests__/launch.test.ts; npx eslint src/cli/launch.ts src/cli/__tests__/launch.test.ts; npx tsc --noEmit
Not-tested: Live SSH disconnect against a real tmux server
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions bot added the size/M label Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant