You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gamescope always produces logs with terminal sequences such as \e[0;34m and \e[0m, even when it prints them into non-tty (not an interactive terminal) such as file or pipe. This makes it hard to read those logs with text editor, or to parse them with external command.
Most command line utilities usually deal with this problem by checking stderr with isatty(3). In gamescope those sequences appear to be hard-coded here LogScope::log and here GetLogPriorityText
Repro:
$ git clone --recursive https://github.com/ValveSoftware/gamescope.git
$ cd gamescope
$ meson setup build/
$ ninja -C build/
$ build/src/gamescope -- wine winemine 2> sample.txt # can be anything, I just used 'wine winemine'
$ xdg-open sample.txt
Result:
Expected: Terminal escape sequences should be omitted in this case.
Enviroment:
$ build/src/gamescope --version
[gamescope] [Info] console: gamescope version 3.16.1-39-gbafa157 (gcc 14.2.1)
$ uname -a
Linux MAL200424 6.13.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
Gamescope always produces logs with terminal sequences such as
\e[0;34m
and\e[0m
, even when it prints them into non-tty (not an interactive terminal) such as file or pipe. This makes it hard to read those logs with text editor, or to parse them with external command.Most command line utilities usually deal with this problem by checking
stderr
with isatty(3). In gamescope those sequences appear to be hard-coded here LogScope::log and here GetLogPriorityTextRepro:
Result:
Expected: Terminal escape sequences should be omitted in this case.
Enviroment:
The text was updated successfully, but these errors were encountered: