Skip to content

Commit 4941cdb

Browse files
committed
_get_command_arguments: make trailing space optional
When pane_full_command has no arguments, the regex doesn't find argv[0] as there is no trailing space. For example, if pane_full_command was "vim" and the restore option was "~Vim->vim *", the command "vim vim" would get executed instead of just "vim". Make the trailing space optional to match having only the command without arguments.
1 parent a2ddfb9 commit 4941cdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/process_restore_helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ _get_command_arguments() {
121121
if _proc_starts_with_tildae "$match"; then
122122
match="$(remove_first_char "$match")"
123123
fi
124-
echo "$pane_full_command" | sed "s,^.*${match}[^ ]* ,,"
124+
echo "$pane_full_command" | sed "s,^.*${match}[^ ]* *,,"
125125
}
126126

127127
_get_proc_restore_command() {

0 commit comments

Comments
 (0)