List tmux sessions when starting zsh login shells
This commit is contained in:
parent
e9de60c438
commit
7bb6389571
1 changed files with 13 additions and 1 deletions
14
zprofile
14
zprofile
|
@ -9,7 +9,19 @@ print_heading -l 1 'Initializing login shell'
|
||||||
|
|
||||||
[ -e $HOME/.profile ] && source $HOME/.profile
|
[ -e $HOME/.profile ] && source $HOME/.profile
|
||||||
|
|
||||||
# Any ZSH stuff goes here.
|
list_tmux_sessions()
|
||||||
|
{
|
||||||
|
tmux_out=`tmux list-sessions 2>/dev/null`
|
||||||
|
[[ -z "$tmux_out" ]] && return
|
||||||
|
|
||||||
|
echo "You have the following active tmux sessions:"
|
||||||
|
for session in ${(f)tmux_out}; do
|
||||||
|
echo " $session"
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
list_tmux_sessions
|
||||||
|
|
||||||
[ -e $HOME/.profile.$SYS ] && source $HOME/.profile.$SYS
|
[ -e $HOME/.profile.$SYS ] && source $HOME/.profile.$SYS
|
||||||
[ -e $HOME/.profile.local ] && source $HOME/.profile.local
|
[ -e $HOME/.profile.local ] && source $HOME/.profile.local
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue