Skip to content

Conversation

@jessedhillon
Copy link

This adds completion for session names. Commands which take a running session's name as an argument, for example attach-session, can now have those options completable. For example:

$ tmux list-sessions -F '#{session_name}'
bash-cmp
nix-config
$ tmux attach-session -t <tab>
bash-cmp    nix-config

I checked the tmux repo, and they do not maintain bash completions, so I'm submitting this here.

completions/tmux Outdated
file | *-file | path | *-path)
_comp_compgen_filedir
;;
target-session | src-session)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see src-session in output from tmux? I only found it in the tmux source, but it doesn't seem to be used currently. If we do want to have it here anyway, we should probably also have dst-session

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I asked an AI to look at tmux output and propose those options. I see that target-session is the only option that is used in the usage output, so we can trim this down to one option name.

@akinomyoga akinomyoga force-pushed the feat/tmux-session-completion branch from b5bc410 to 91c76c4 Compare December 31, 2025 07:16
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.

3 participants