fix(autocomplete): tx autocompletions

This commit is contained in:
2025-10-05 01:02:36 +03:00
parent 2fa27dee5e
commit fc44d7b5f4

View File

@@ -15,10 +15,38 @@ cmds=(
'remove:Remove a tmux workspace from the config file'
'create:Create a new tmux session (temporary)'
'attach:Attach to a tmux session'
'prj:Create a new tmux session (temporary) from project folder'
)
for i in $names; do
sessions+=("$i")
done
_describe 'session' sessions
# _describe 'cmds' cmds
case $words[2] in
show)
_arguments \
'2:session:compadd -a sessions' \
'--help[Show help]'
;;
edit)
_arguments \
'--local[Edit local config file (instead of global)]' \
;;
remove)
_arguments \
'2:session:compadd -a sessions' \
'--help[Show help]' \
'--key[The key to remove]' \
'--local[Remove from local config file (instead of global)]' \
'--dry[Dry run]'
;;
attach)
open_sessions=($(tmux ls | cut -d: -f1))
_arguments \
'2:session:compadd -a open_sessions' \
'--help[Show help]'
;;
*)
_describe 'session' sessions
_describe 'command' cmds
;;
esac