1. mpstevens_uk
  2. pcw


Evan Gates  committed 830aeff

redirect stderr to /dev/null when checking for a tmux session, correct regex for windows to include status characters

  • Participants
  • Parent commits 13c87a0
  • Branches default

Comments (0)

Files changed (1)

File pcw_win.sh

View file
 # if you don't want color, you can change the cw_color.sh part to cw etc. like the other examples
-if ! tmux -L "$TITLE" list-sessions | grep -q "^$TITLE"; then
+if ! tmux -L "$TITLE" list-sessions 2>/dev/null | grep -q "^$TITLE:"; then
 	tmux -L "$TITLE" new-session -d -s "$TITLE" -n "$(basename "$CPATH")" "srw -p \"$(basename "$CPATH")> \" cw_color.sh -i \"$OUT\" -o \"$IN\" -n \"$NICK\""
-elif ! tmux -L "$TITLE" list-windows -t "$TITLE" | grep -q " $(basename "$CPATH") "; then
+elif ! tmux -L "$TITLE" list-windows -t "$TITLE" | grep -q " $(basename "$CPATH")[-*#!+~]\? "; then
 	tmux -L "$TITLE" new-window -d -t "$TITLE" -n "$(basename "$CPATH")" "srw -p \"$(basename "$CPATH")> \" cw_color.sh -i \"$OUT\" -o \"$IN\" -n \"$NICK\""