completions/tmux: more send-keys completions, add switch-client key table argument

The switch client option is a bit weird (why does this command have a
key table-related function?), but seems helpful to add.
This commit is contained in:
Ilya Grigoriev
2025-02-02 01:56:11 -08:00
committed by Johannes Altmanninger
parent 5fecc2e355
commit f30a85f538

View File

@@ -378,6 +378,10 @@ complete -c tmux -n __fish_use_subcommand -a $lsk -d 'list all key bindings'
complete -c tmux -n __fish_use_subcommand -a $send -d 'send key or event'
complete -c tmux -n "__fish_seen_subcommand_from $send" -s R -d 'reset terminal state'
# TODO: Could list all possible copy mode commands
complete -c tmux -n "__fish_seen_subcommand_from $send" -s X -d 'copy mode command'
complete -c tmux -n "__fish_seen_subcommand_from $send" -s l -d 'literal chars'
complete -c tmux -n "__fish_seen_subcommand_from $send" -s H -d 'hex-encoded chars'
complete -c tmux -n "__fish_seen_subcommand_from $send" -xs t -a '(__fish_tmux_panes)' -d 'target pane'
complete -c tmux -n __fish_use_subcommand -a $sendprefix -d 'send the prefix key'
@@ -393,6 +397,7 @@ complete -c tmux -n "__fish_seen_subcommand_from $unbind" -s n -d 'command bound
# TODO: Could parse output of `tmux lsk` to get a dynamic list that includes any user key tables
set -l key_table 'copy-mode copy-mode-vi prefix root'
complete -c tmux -n "__fish_seen_subcommand_from $bind $unbind $lsk" -xs T -d 'key table' -xa "$key_table"
complete -c tmux -n "__fish_seen_subcommand_from $switchc" -xs T -d 'switch client key table' -xa "$key_table"
############### End: Key Bindings ###############