screen: stricter matching in detached sessions counting

This commit is contained in:
Olivier Mengué 2013-12-04 23:38:20 +01:00
parent 8d090f584a
commit 34835335c7

View File

@ -665,7 +665,7 @@ _lp_jobcount_color()
local running=$(( $(jobs -r | wc -l) ))
local stopped=$(( $(jobs -s | wc -l) ))
local n_screen=$(screen -ls 2> /dev/null | grep -c '[Dd]etach[^)]*)$')
local n_screen=$(screen -ls 2> /dev/null | grep -c '([Dd]etach[^)]*)$')
local n_tmux=$(tmux list-sessions 2> /dev/null | grep -cv attached)
local detached=$(( $n_screen + $n_tmux ))
local m_detached="d"