menulibre icon indicating copy to clipboard operation
menulibre copied to clipboard

Editing desktop entries with unescaped backslashes (e.g., those created by Wine) keeps adding backslashes

Open ernstki opened this issue 1 year ago • 0 comments

This is with Wine 5.0 from the Ubuntu 20.04 repositories, as seen with MenuLibre 2.2.1 (from the Ubunto repos) as well as 2.3.0 from GitHub.

Whenever a desktop entry created by a Wine program installer is edited and saved with MenuLibre, MenuLibre seems to stack on extra backslashes (with each subsequent edit) to command lines like

env WINEPREFIX="/home/me/.wine" wine-stable C:\\\\windows\\\\command\\\\start.exe /Unix /home/me/.wine/dosdevices/c:/users/me/Start\\ Menu/Programs/PuTTY/Pageant.lnk

such that you end up with

env WINEPREFIX="/home/me/.wine" wine C:\\\\\\\\windows\\\\\\\\command\\\\\\\\start.exe /Unix /home/me/.wine/dosdevices/c:/users/me/Start\\\\ Menu/Programs/PuTTY/PuTTY.lnk

and the launcher stops working.

I should note: a desktop entry created by Wine with backslashes in it. If, for example, I alter the Exec key to

  Exec=env WINEPREFIX="/home/me/.wine" wine start /unix "/home/me/.wine/dosdevices/c:/users/me/Start Menu/Programs/PuTTY/PuTTY.lnk"                                                                      

this behavior in MenuLibre isn't triggered. Probably this is what Wine should've done in the first place.

I think the desktop entries being created by the version on Wine on this system (5.0) aren't escaped properly, and there's only so much you can do about somebody else's brokenness. Figured you'd want to at least be aware of it, though.

ernstki avatar Dec 26 '22 21:12 ernstki