@@ -46,14 +46,17 @@ if [[ ! -f "$PID_FILE_PATH" ]]; then # If pane not yet monitored
4646 complete_message=" Tmux pane task completed!"
4747 fi
4848
49- # Create bash suffix list
50- # NOTE: Looks complicated but uses shell parameter expansion
51- # see https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion
52- prompt_suffixes=" $( get_tmux_option " $prompt_suffixes " " $prompt_suffixes_default " ) "
53- prompt_suffixes=${prompt_suffixes// / } # Remove whitespace
54- prompt_suffixes=${prompt_suffixes// ,/ |} # Replace comma with or operator
55- prompt_suffixes=$( escape_glob_chars " $prompt_suffixes " )
56- prompt_suffixes=" \(${prompt_suffixes} \)$"
49+ prompt_regex_value=" $( get_tmux_option " $prompt_regex " " $prompt_regex_default " ) "
50+ if [[ -z " $prompt_regex_value " ]]; then
51+ # Create bash suffix list
52+ # NOTE: Looks complicated but uses shell parameter expansion
53+ # see https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion
54+ prompt_regex_value=" $( get_tmux_option " $prompt_suffixes " " $prompt_suffixes_default " ) "
55+ prompt_regex_value=${prompt_regex_value// / } # Remove whitespace
56+ prompt_regex_value=${prompt_regex_value// ,/ |} # Replace comma with or operator
57+ prompt_regex_value=$( escape_glob_chars " $prompt_regex_value " )
58+ prompt_regex_value=" \(${prompt_regex_value} \)$"
59+ fi
5760
5861 # Check process status every 10 seconds to see if has is finished
5962 while true ; do
@@ -62,7 +65,7 @@ if [[ ! -f "$PID_FILE_PATH" ]]; then # If pane not yet monitored
6265
6366 # run tests to determine if work is done
6467 # if so, break and notify
65- if echo " $output " | tail -n2 | grep -e $prompt_suffixes & > /dev/null; then
68+ if echo " $output " | tail -n2 | grep -e $prompt_regex_value & > /dev/null; then
6669 # tmux display-message "$@"
6770 if [[ " $1 " == " true" ]]; then
6871 tmux switch -t \$ " $SESSION_ID "
0 commit comments