Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
open_editor_or_terminalto the opener API: usesnew-session/new-windowtmux logic when the command is a known terminal, falls back toopen_in_editorfor IDEs(Some(cmd), None)branch incmd_opento the new function — tmux users with nopost:openhook no longer hit the invalidtmux /path/to/worktreeinvocationopen_hook_in_auto_terminalso IDE users with a hook also prefer a running tmux server over GUI terminal fallbacksCloses #52
Test plan
cargo fmt+cargo clippycleanopener/mod.rsstays at exactly 100 lines🤖 Generated with Claude Code