Merge pull request #1233 from zsh-users/refactor_tmuxp

refactoring _tmuxp
This commit is contained in:
Shohei YOSHIDA 2026-03-16 14:11:56 +09:00 committed by GitHub
commit f1cd0e8940
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 8 deletions

View File

@ -93,8 +93,8 @@ _tmuxp() {
&& ret=0 && ret=0
;; ;;
(shell) (shell)
local sessions="$(__tmux_sessions)" local sessions="$(__tmuxp_tmux_sessions)"
local windows="$(__tmux_windows)" local windows="$(__tmuxp_tmux_windows)"
_arguments \ _arguments \
'(- *)'{-h,--help}'[show help message and exit]' \ '(- *)'{-h,--help}'[show help message and exit]' \
'-S[pass-through for tmux -S]: :_files' \ '-S[pass-through for tmux -S]: :_files' \
@ -179,15 +179,13 @@ __tmuxp_import() {
esac esac
} }
__tmux_sessions () { __tmuxp_tmux_sessions() {
local tmux_sessions local tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
tmux_sessions=($(_call_program tmux_sessions 'tmux ls -F "#{session_name}"'))
echo $tmux_sessions echo $tmux_sessions
} }
__tmux_windows () { __tmuxp_tmux_windows() {
local tmux_windows local tmux_windows=($(_call_program tmux_sessions 'tmux ls -F "#{window_name}"'))
tmux_windows=($(_call_program tmux_sessions 'tmux ls -F "#{window_name}"'))
echo $tmux_windows echo $tmux_windows
} }