protonscr

Games do not launch when using an alias as a launch option

steamopen Steam clientDistro Family: Arch
ValveSoftware/steam-for-linux#10133 · opened 2023-10-12 by wantija · updated 2023-10-30 · 1 comments · github
Wwantija 2023-10-12 github

Your system information

  • Steam client version (build number or date): 1696019606
  • Distribution (e.g. Ubuntu): Arch Linux
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes
  • Steam Logs: steam-logs.tar.gz
  • GPU: AMD

Please describe your issue in as much detail as possible:

When putting an alias (found in your .bashrc file or similar) as a launch option for a game, it will not launch. Using the entire non-aliased command in the launch options works but this is annoying.

Steps for reproducing this issue

  1. create alias in your .bashrc for a long command (alias vk60='MANGOHUD_CONFIG="fps_limit=60,no_display" mangohud')
  2. log out and log back in
  3. use vk60 %command% as a launch option for a game (Counter Strike 2, for example)
  4. game crashes
  5. use MANGOHUD_CONFIG="fps_limit=60,no_display" mangohud %command% as a launch option
  6. game works.
DDrKJeff16 2023-10-30 github

I recommend not using aliases as they do not export into subprocesses well. Also, this will fail if you have the explicit interactive shell check on top:

# If shell is not interactive, do not source.
[[ $- != *i* ]] && return
...

Instead make an executable bash script that executes the given instrucions in your PATH.

You can implement this in ~/.local/bin:

#!/bin/bash
MANGOHUD_CONFIG="fps_limit=60,no_display "$@"

Be sure $HOME/.local/bin is included into your path in ~/.profile. Export the variable pls. Use sh syntax, not bash syntax.

Launch options

Launch lines