-
Notifications
You must be signed in to change notification settings - Fork 346
Actions: Quoted %F field codes will not be escaped properly after expansion #3138
Description
* Nemo version (nemo --version) 5.6.1
* Is issue with desktop or windowed nemo? both
* 64 bit
Issue
In a Nemo Action file, if the %F field code in the Exec entry is within quotes, they will not be properly escaped, and the expanded file paths may not be passed on with special characters escaped properly, causing the action to either pass on an incorrect file path, or to not run at all.
Steps to reproduce
- Write a
.nemo_actionfile that sets theExecentry asbash -c 'echo %F && sleep 1', and theTerminalentry totrue. - Place the
.nemo_actionfile in$HOME/.local/share/actions/. - Run the action on a path that contains a
'. - See that nothing happens, as Nemo cannot seem to parse the
Execline.
Expected behaviour
The action runs, with the expansion of %F properly escaped and passed on to the shell, which then shows up on a terminal window and is echoed correctly.
Other information
Normally, this behaviour should be correct, since quoting field codes would disturb the normal character escaping mechanism, and should not be done. A close cousin of the Nemo Actions file, the .desktop file, also seems to be in agreement for this. From freedesktop.org's Desktop Entry Specifcation:
Field codes must not be used inside a quoted argument, the result of field code expansion inside a quoted argument is undefined.
However, many action files are already written with the %F field code quoted in some way or another, so this is an issue of backwards compatibility.