-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backslashes are not escaped when running processes through Reaper #731
Comments
This is certainly not a Steam Runtime bug: the Launch Options are interpreted by the Steam client, not the Steam Runtime, so if it's a bug in anything, it would be ValveSoftware/steam-for-linux. I think this is working as intended, although the design is not what you thought it was. The arguments in Launch Options are interpreted as though they were appended to the command as part of a shell script, so in particular they use and require If you think about it for a while, you'll realise that there needs to be some sort of defined syntax here, because the input box takes a single string, but you want to be able to pass more than one argument, which means there needs to be some way to split the string into individual arguments - but Steam can't just split at whitespace, because then you wouldn't be able to pass an argument that contains whitespace. So the choices are to either adopt shell quoting syntax as-is, or reinvent it (most likely badly, and certainly with less documentation). The Steam developers have chosen to adopt shell quoting syntax, rather than reinventing it. This means that if you want to pass arbitrary user-specified arguments to a game via its Launch Options, then yes, you do need to quote those arguments according to POSIX sh(1) rules, so arguments with backslashes will need either single quotes or doubled backslashes. You can do this programmatically with bash's The final command that Steam actually runs is constructed from the Launch Options, some wrappers (reaper and steam-launch-wrapper), compatibility tools if any, the absolute path to the game, and the game's configured executable. Steam correctly adds quotes where necessary when interpolating those paths. More precisely, setting Launch Options to some arguments like For non-Steam games, a somewhat simpler code path is used (for example steam-launch-wrapper is missing) but the general operating principle is the same. All of the wrappers and compatibility tools "below" the Steam client are careful to pass through their
Steam runs the final composite command via |
Speaking of which, I wonder if we should change this to |
Perhaps, but we should be careful. Everyone (even NixOS) seems to agree that I believe Steam on Linux already does require
(We do guarantee the presence of Reasons to prefer bash:
Reasons to prefer
|
Your system information
steamapps/common/SteamLinuxRuntime/VERSIONS.txt
:steamapps/common/SteamLinuxRuntime_soldier/VERSIONS.txt
:steamapps/common/SteamLinuxRuntime_sniper/VERSIONS.txt
:Please describe your issue in as much detail as possible:
Launch Options should escape backslashes to pass them through properly. Mostly used for Wine/Proton apps when a file path needs to be specified.
Bash's printf "%q" would do, but it's not part of POSIX (man printf.1p). Does Steam care about POSIX shells?
PS: I hope this is in the correct repository
Steps for reproducing this issue:
-- /dev/zero --doubledash forward/slash back\slash double\\backslash
Expected:
/usr/bin/cat -- /dev/zero --doubledash forward/slash back\slash double\\backslash
Actual:
/usr/bin/cat -- /dev/zero --doubledash forward/slash backslash double\backslash
The text was updated successfully, but these errors were encountered: