-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Try this abomination desktop entry:
[Desktop Entry]
Name=Default Terminal
Type=Application
Exec=printf "|||%%s|||\\\\n" "quoting terminal" "with 'complex' arguments," "quotes \\"," "" "empty args," "new\nlines," "and \\"back\\\\slashes\\""
Categories=TerminalEmulator;
from Vladimir-csp/xdg-terminal-exec
parse_exec()
parses this to:
[
"printf",
"\"|||%%s|||\\\\\\\\n\"",
"\"quoting",
"terminal\"",
"\"with",
"'complex'",
"arguments,\"",
"\"quotes",
"\\\\\",\"",
"\"\"",
"\"empty",
"args,\"",
"\"new\\nlines,\"",
"\"and",
"\\\\\"back\\\\\\\\slashes\\\\\"\"",
]
which should be parsed to:
[
"printf",
"|||%s|||\\\\n",
"quoting terminal",
"with 'complex' arguments,",
"quotes \\\",",
"",
"empty args,",
"new\nlines",
"and \\\"back\\\\slashes\\\"",
]
(if i unescaped and re-rust-escaped this manually correctly)
so basically what the spec says about the Exec
attribute
Quoting must be done by enclosing the argument between double quotes and escaping the double quote character, backtick character ("`"), dollar sign ("$") and backslash character ("") by preceding it with an additional backslash character. Implementations must undo quoting before expanding field codes and before passing the argument to the executable program.
[...]
Literal percentage characters must be escaped as %%.
aleb2000
Metadata
Metadata
Assignees
Labels
No labels