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

Comments (0)

Files changed (1)

 # if you don't want color, you can change the 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")> \" -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")> \" -i \"$OUT\" -o \"$IN\" -n \"$NICK\""