File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,20 @@ additional_input() {
8989}
9090
9191handle_output () {
92- target=$( echo " $@ " | tr -d ' \n' )
92+ if [ -d " $@ " ]; then
93+ # No special handling because there isn't a window number or window name present
94+ # except in unlikely and contrived situations (e.g.
95+ # "/home/person/projects:0\ bash" could be a path on your filesystem.)
96+ target=$( echo " $@ " | tr -d ' \n' )
97+ elif echo " $@ " | grep ' :' > /dev/null 2>&1 ; then
98+ # Colon probably delimits session name and window number
99+ session_name=$( echo " $@ " | cut -d: -f1)
100+ num=$( echo " $@ " | cut -d: -f2 | cut -d' ' -f1)
101+ target=$( echo " ${session_name} :${num} " | tr -d ' \n' )
102+ else
103+ # All tokens represent a session name
104+ target=$( echo " $@ " | tr -d ' \n' )
105+ fi
93106
94107 if [[ -z " $target " ]]; then
95108 exit 0
You can’t perform that action at this time.
0 commit comments