Add directory completion for tmux new-session -c option#2355
Merged
seefood merged 4 commits intoBash-it:masterfrom Oct 12, 2025
Merged
Add directory completion for tmux new-session -c option#2355seefood merged 4 commits intoBash-it:masterfrom
seefood merged 4 commits intoBash-it:masterfrom
Conversation
Implements tab completion for the `-c` option in `tmux new-session` command, which sets the start directory for the new session. **Changes:** - Added `-c) _tmux_filedir -d ;;` case to complete directories after `-c` flag - Added `-c` to the options list for the new-session command **Usage:** ```bash tmux new-session -c <tab><tab> # Now shows directory completions ``` The fix uses the existing `_tmux_filedir -d` function which handles directory completion with tilde expansion support, providing better UX than raw compgen. Closes Bash-it#2245 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
* fix/artisan-shellcheck: I hope this is a fix that satisfies shellcheck and is correct functionally
Contributor
Author
|
I'll merge and close this since it "works for me". reopen if you feel this needs a fix. |
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
Implements tab completion for the
-coption intmux new-sessioncommand, which sets the start directory for the new session.Changes
-c) _tmux_filedir -d ;;case to complete directories after-cflag-cto the options list for thenew-sessioncommandUsage
Implementation Notes
The fix leverages the existing
_tmux_filedir -dfunction which provides:~/Documentsworks)This is cleaner than using raw
compgen -das it handles edge cases and user experience better.Testing
tmux new-session -c <tab>tmux new-session -c ~/Doc<tab>Closes #2245
🤖 Generated with Claude Code