GOG games (start.sh) fail to launch from terminal without "TERM=xterm" set

Since I have a workaround this is more to bring awareness to the matter in case it’s something that can be solved. Manjaro’s terminal settings appear to have a configuration that interferes with running some shell scripts accordingly, in particular some Linux native games downloaded from Gog. When launching their start.sh script the following crash occurs before the game can launch:

AL lib: (EE) GetLoadedHrtf: Invalid header in /usr/share/openal/hrtf/Default HRTF.mhr: "MinPHR03"
AL lib: (EE) GetLoadedHrtf: Failed to load /usr/share/openal/hrtf/Default HRTF.mhr

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.Exception: Magic number is wrong: 542
  at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x00028] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.TermInfoDriver..ctor (System.String term) [0x00055] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.ConsoleDriver..cctor () [0x0004d] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.Console..cctor () [0x0008e] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
   --- End of inner exception stack trace ---
  at Dust.Program.Main (System.String[] args) [0x00089] in <5d7a814c409845baa5aaae407dcba4f7>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.Exception: Magic number is wrong: 542
  at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& position) [0x00028] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.TermInfoDriver..ctor (System.String term) [0x00055] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.ConsoleDriver..cctor () [0x0004d] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
  at System.Console..cctor () [0x0008e] in <4bafc978642b4fd6b6c08368db3d2bdc>:0 
   --- End of inner exception stack trace ---
  at Dust.Program.Main (System.String[] args) [0x00089] in <5d7a814c409845baa5aaae407dcba4f7>:0 
AL lib: (EE) alc_cleanup: 1 device not closed

Thankfully there are two workarounds to this problem: You can either click on the shell script directly in your DE (eg: Dolphin) or run export TERM=xterm after which the script executes via console.

I mainly mention this since while looking up what’s happening, some articles suggested this works fine in Ubuntu. So I wasn’t sure if Manjaro is doing something unique that can be resolved, like setting a different fallback terminal or whatever it is affected scripts expect.

What is the value of TERM on your side without forcing it, and what is the content of the SH script?

Anyway, I don’t think the issue is with Manjaro, but with GOG or whatever it tries to run.

//EDIT: quick Google

Thanks for that info. As for the default value…

echo $TERM
xterm-256color

Is it supposed to be that for Manjaro?

fwiw, thats mine here.

If you want to set it permanently you can do so in ~.Xresources and only there - no .bashrc, etc.
like:

XTerm.termName: xterm

And another way to check (bassically same as echo $TERM) is: tset -q

Changes should take effect when your Display Manager logs in and sources it again … or you can use something like xrdb -merge ~/.Xresources.

1 Like

Indeed. At least for the default Konsole config in KDE (edit your Konsole profile and click the Environment button):

TERM=xterm-256color
COLORTERM=truecolor

//EDIT: I guess you could export the variable in your Start.sh script for a simple solution without affecting your system.

1 Like