linuxmint / linuxmint/cinnamon-menus

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

Open
#82 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
27
Forks
21
Avg merge
13d 23h
Merged PRs (30d)
1

Description

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:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name a source file or test. Start by locating the custom launcher or Menu editor code that writes desktop files, reproduce a path containing spaces, and compare its Exec output with the desktop-entry specification. Done means reserved characters in executable paths are represented using the required quoting and the behavior is covered by a regression test if the project has tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.