Add a way of specifying a user filter for tmux list-sessions command in the following function of https://github.com/tmux-plugins/tmux-sessionist/blob/master/scripts/kill_session.sh.
Advantage: User can filter out any temporary sessions they might create during the run. For instance, I create a scratch session to hold a scratch pane, and would not want that to be accounted for while either while switching or deciding to not quit tmux. -f "#{!=:#{session_name},scratch}"
For instance,
number_of_sessions() {
tmux list-sessions |
wc -l |
sed "s/ //g"
}
would become:
number_of_sessions() {
tmux list-sessions -f "#{!=:#{session_name},scratch}" |
wc -l |
sed "s/ //g"
}