Skip to content

Custom desktop file creation is not compliant with the standard when spaces are involved in Exec (and maybe other reserved characters) #82

@jmholla

Description

@jmholla

I discovered this will using the Albert launcher's applications plugin. When you create a custom launcher with the Menu editor, if that executable has spaces in the path, the created desktop file escapes it as so:

Exec=/path\\ with/spaces

But, the desktop file specification says:

Arguments may be quoted in whole. If an argument contains a reserved character the argument must be quoted. The rules for quoting of arguments is also applicable to the executable name or path of the executable program as provided.
[...] Reserved characters are space (" "), tab, newline, double quote, single quote ("'"), backslash character (""), greater-than sign (">"), less-than sign ("<"), tilde ("~"), vertical bar ("|"), ampersand ("&"), semicolon (";"), dollar sign ("$"), asterisk ("*"), question mark ("?"), hash mark ("#"), parenthesis ("(") and (")") and backtick character ("`").

So, the resulting file should actually have the following line:

Exec="/path with/spaces"

Related bug reports:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions