Replace bare $var with ${var} everywhere it was still used, matching
the convention already established in rc.d/prompt and rc.d/history.
Positional parameters ($1, $@, $#) and special variables ($?, $$, $-)
are left as-is, consistent with existing usage in _helpers.bash.
rc.d/broot is auto-generated by the broot binary and will likely be
overwritten with its original formatting on the next broot update.
20 lines
680 B
Plaintext
20 lines
680 B
Plaintext
# GNU Screen stuff
|
|
if (command -v tmux &>/dev/null); then
|
|
if [ "$(pgrep -u "${UID}" "tmux" | wc -l)" -gt 0 ]; then
|
|
if [[ ${TERM} != screen* ]]; then
|
|
nb_sessions=$(tmux list-session | wc -l)
|
|
nb_sessions_attached=$(tmux list-session | grep -c "attached")
|
|
nb_sessions_detached=$(tmux list-session | grep -c -v "attached")
|
|
|
|
echo_info "tmux : found ${nb_sessions} session(s)"
|
|
|
|
echo "➤ ${nb_sessions_attached} session(s) attached"
|
|
tmux list-sessions | grep "attached" | sed -e 's/^/ • /'
|
|
|
|
echo "➤ ${nb_sessions_detached} session(s) detached"
|
|
tmux list-sessions | grep -v "attached" | sed -e 's/^/ • /'
|
|
|
|
fi
|
|
fi
|
|
fi
|