Use _call_program when gathering list of tmux sessions

This commit is contained in:
Bez Hermoso 2017-10-19 09:02:24 -07:00
parent e7132b01c4
commit a86e06b336
No known key found for this signature in database
GPG Key ID: 55BDEC097B885413
1 changed files with 8 additions and 1 deletions

View File

@ -70,8 +70,9 @@ _tmuxp() {
__tmuxp_import
;;
(freeze)
local sessions="$(__tmux_sessions)"
_arguments -C \
'1::session name:compadd $(command tmux ls -F "#{session_name}" 2>/dev/null)'
"1::session name:compadd $sessions"
;;
(convert)
_arguments -C \
@ -122,5 +123,11 @@ __tmuxp_import() {
esac
}
__tmux_sessions () {
local tmux_sessions
tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
echo $tmux_sessions
}
_tmuxp "$@"