Files
config-bash/rc.d/screen
T
Xavier LogeraisandCopilot 158c3f99f0 perf: remove unnecessary subshells in command -v checks
Replace 'if (command -v x &>/dev/null); then' with
'if command -v x &>/dev/null; then' across completion.d, rc.d and
profile.d. Parentheses forced a subshell fork for every 'if' check,
which is unnecessary overhead since command -v runs fine in the
current shell.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-28 18:17:13 +02:00

25 lines
707 B
Plaintext

# GNU Screen stuff
if command -v screen &> /dev/null
then
if [[ ${TERM} != screen* ]]
then
if [ "$(screen -ls | sed -ne 's/[[:space:]]//' -ne 's/(Attached)// p')" ]
then
echo ''
echo_reverse 'Il existe des sessions screen attachées sur cette machine pour cet utilisateur !'
echo ''
screen -ls | grep "Attached" | sed -e 's/^/ /'
echo ''
fi
if [ "$(screen -ls | sed -ne 's/[[:space:]]//' -ne 's/(Detached)// p')" ]
then
echo ''
echo_reverse "Il existe des sessions screen détachées sur cette machine pour cet utilisateur !"
echo ''
screen -ls | grep "Detached" | sed -e 's/^/ /'
echo ''
fi
fi
fi