Skip to content

fix(tmux): make tmux work as editor regardless of post:open hook#83

Merged
tupe12334 merged 2 commits into
mainfrom
issue-52
Mar 21, 2026
Merged

fix(tmux): make tmux work as editor regardless of post:open hook#83
tupe12334 merged 2 commits into
mainfrom
issue-52

Conversation

@tupe12334
Copy link
Copy Markdown
Contributor

Summary

  • Adds open_editor_or_terminal to the opener API: uses new-session/new-window tmux logic when the command is a known terminal, falls back to open_in_editor for IDEs
  • Wires the (Some(cmd), None) branch in cmd_open to the new function — tmux users with no post:open hook no longer hit the invalid tmux /path/to/worktree invocation
  • Adds tmux check in open_hook_in_auto_terminal so IDE users with a hook also prefer a running tmux server over GUI terminal fallbacks

Closes #52

Test plan

  • All 315 unit + integration tests pass
  • 100% line coverage maintained
  • cargo fmt + cargo clippy clean
  • opener/mod.rs stays at exactly 100 lines

🤖 Generated with Claude Code

vsajan and others added 2 commits March 22, 2026 02:18
- Add `open_editor_or_terminal` which uses terminal-specific spawn logic
  (tmux new-session/new-window) when cmd is a known terminal, falling
  back to `open_in_editor` for IDEs — fixes the `(Some(cmd), None)` path
- Wire `(Some(cmd), None)` in `cmd_open` to `open_editor_or_terminal`
  instead of `open_in_editor` so tmux users without a post:open hook
  no longer get the invalid `tmux /path/to/worktree` invocation
- Add tmux check in `open_hook_in_auto_terminal` so hook-only users
  (IDE + post:open hook) also prefer tmux over GUI terminals

Closes #52

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tupe12334 tupe12334 merged commit bc002f3 into main Mar 21, 2026
@tupe12334 tupe12334 deleted the issue-52 branch March 21, 2026 19:19
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