sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.13k stars 71 forks source link

Menus: Display paths with backslashes properly #1074

Closed sonic2kk closed 6 months ago

sonic2kk commented 6 months ago

Partial fix for #1072. See also: #1073.

Overview

On various places on the UI, we may display paths with backslashes. This PR is concerned with those paths coming from the Steam Game Launch Options, and the Custom Command arguments, and fixes them by using printf in various ways.

Problem

The problems are as follows:

Solution

This PR fixes these problems in two different ways, both using printf:

Note that paths going as arguments to custom commands may need to be double-escaped, as they don't have quotes. This PR corrects the display and saving of these paths, and #1073 fixes the paths so that they are double-escaped.

Fwiw, Proton doesn't seem to get quotes for launch arguments either though (https://github.com/sonic2kk/steamtinkerlaunch/issues/1072#issuecomment-2016276706) so I think this is acceptable.

sonic2kk commented 6 months ago

Uh oh, we're running the CI twice... We can probably remove the PR one...

sonic2kk commented 6 months ago

Tested by me and @zany130 in #1072, appears to work as expected, so merging!