target=$(echo "$target_origin" | grep -o '^[[:alpha:][:digit:]/_-]*:' | sed 's/.$//g')
won't match on sessions such as My Session, as a space (or any whitespace character for that matter) won't be matched under the above character set.
Even if the above was fixed naively by changing to pattern
'^[[:alpha:][:digit:]/_ -]*:'
(there's now a space after the underscore)
The attach (or any action for that matter) will still fail because of xargs:
echo "$target" | xargs tmux switch-client -t
xargs delimits the parameters by space so switch-client sees two arguments instead of one (the session name with the space).
I assume this is written this way to support multi selection, but it doesn't seem to work regardless to me.
Locally I've patched the grep pattern to include space and xargs was removed from the attach command and is now used as
Specifically, the grep pattern in
session.sh
won't match on sessions such as
My Session
, as a space (or any whitespace character for that matter) won't be matched under the above character set.Even if the above was fixed naively by changing to pattern
(there's now a space after the underscore)
The attach (or any action for that matter) will still fail because of
xargs
:xargs
delimits the parameters by space soswitch-client
sees two arguments instead of one (the session name with the space). I assume this is written this way to support multi selection, but it doesn't seem to work regardless to me.Locally I've patched the grep pattern to include space and xargs was removed from the attach command and is now used as
and it works.