Check $TMUX variable to see if we're in a tmux session before printing list
This commit is contained in:
parent
f90198bf2b
commit
1f8f5e3a9f
1 changed files with 1 additions and 1 deletions
2
zprofile
2
zprofile
|
@ -12,7 +12,7 @@ print_heading -l 1 'Initializing login shell'
|
||||||
list_tmux_sessions()
|
list_tmux_sessions()
|
||||||
{
|
{
|
||||||
tmux_out=`tmux list-sessions 2>/dev/null`
|
tmux_out=`tmux list-sessions 2>/dev/null`
|
||||||
[[ -z "$tmux_out" ]] && return
|
[[ -z "$tmux_out" || -n "$TMUX" ]] && return
|
||||||
|
|
||||||
echo "You have the following active tmux sessions:"
|
echo "You have the following active tmux sessions:"
|
||||||
for session in ${(f)tmux_out}; do
|
for session in ${(f)tmux_out}; do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue