1.0.25 no longer supports exec bindings with single or double quotes #2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From https://phab.enlightenment.org/T9014
StrlistDecodeEscaped() splits the string at spaces, and quoted arguments that contain spaces are split into many arguments. A binding with
exec echo '1 2'
displays the single quotes because the quotes are passed in the arguments. And bindings withexec sh -c 'cmd1 arg1 ; cmd2'
fail because the first single quote is not terminated.The code does support escaping spaces as
exec echo 1\ 2
andexec sh -c cmd1\ arg1\ ;\ cmd2
but that is harder to read with the escaped spaces and no quotes.Could it be changed to detect single or double quotes and scan for the next non-escaped matching quote, and store the text between them in the argument?
The normal space escaping is also slightly flawed because
cmd \\arg1\\ arg2
creates a single argument instead of two. This patch refactors the argument splitting to support escaping\
with\\
, and escaping spaces or the current ' or " quote. Anyone using subshells will need to wrap the bind with "sh -c" but this patch restores most of the functionality.Hi, I didn't get notifications about the phab ticket or this one so I just noticed it now.
I'll look at it as soon as possible.
I had some trouble with your patch and segvs on unmatched quoting and ended up making an alternative implementation (pushed).
Please let me know if you see problems with it.
Assuming ok.
Thank you, your fix works great. However, the execvp() in src/action.c EspawnApplication() is converting escape sequences.
exec echo '1\n2'
produces different output thanecho '1\n2'
does in the terminal.Placing that before the execvp() shows that StrlistDecodeEscaped() is not the cause.
Yeah, quoting is tricky, and I know that the exec quoting handling is not identical to the shell one.
But can you give an example where it is a problem?
Otherwise I'm inclined to leave things as they are :)
xvkbd -text
can use escape sequences to automate tasks in programs, but all of mine appear to work fine.The following program doesn't do it so execvp() might not be the problem.