Skip to content

Actions: Quoted %F field codes will not be escaped properly after expansion  #3138

@veractor

Description

@veractor
 * 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

  1. Write a .nemo_action file that sets the Exec entry as bash -c 'echo %F && sleep 1', and the Terminal entry to true.
  2. Place the .nemo_action file in $HOME/.local/share/actions/.
  3. Run the action on a path that contains a '.
  4. See that nothing happens, as Nemo cannot seem to parse the Exec line.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions