diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-07-04 19:12:19 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-07-04 19:12:19 +0300 |
| commit | ecd6b555d957ebfc2717364399d8bbb3f29b6673 (patch) | |
| tree | e23abda3d8b6ab78a5a829a0c2b4418a7adcffd0 | |
| parent | ffce20cdf3f4e9a63ce9c8f15e104079c2888f56 (diff) | |
| download | fungus-launcher-ecd6b555d957ebfc2717364399d8bbb3f29b6673.tar.gz fungus-launcher-ecd6b555d957ebfc2717364399d8bbb3f29b6673.tar.xz | |
show both stderr & stdout in splash sequentially
| -rw-r--r-- | fungus/game_launcher.py | 4 | ||||
| -rw-r--r-- | fungus/run_manager.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/fungus/game_launcher.py b/fungus/game_launcher.py index 7ce0f6e..3e88161 100644 --- a/fungus/game_launcher.py +++ b/fungus/game_launcher.py @@ -94,7 +94,7 @@ class GameLauncher: game: Game, igpu: bool = False, *, - on_output_line: Callable[[str], None] | None = None, + on_output_line: Callable[[str, bool], None] | None = None, on_error: Callable[[str], None] | None = None, on_process_exit: Callable[[], None] | None = None, on_sandbox_warning: Callable[[str, list[str]], None] | None = None, @@ -585,7 +585,7 @@ class GameLauncher: # Dispatch to callback if self._on_output_line: - self._on_output_line(clean_line) + self._on_output_line(clean_line, is_stderr) # Check for game-running signals — signal the adapter to close. if self._detect_game_running(clean_line): diff --git a/fungus/run_manager.py b/fungus/run_manager.py index 7f1101d..851aa15 100644 --- a/fungus/run_manager.py +++ b/fungus/run_manager.py @@ -107,10 +107,11 @@ def handle_command( # ── Build callbacks (forward refs resolved below) ───────────── splash_container: list[SplashWindow | None] = [None] # mutable container for forward reference - def on_output_line(line: str) -> None: + def on_output_line(line: str, is_stderr: bool) -> None: + prefix = "[err] " if is_stderr else "[out] " s = splash_container[0] if s is not None: - GLib.idle_add(s.append_output, line) + GLib.idle_add(s.append_output, f"{prefix}{line}") def on_error(msg: str) -> None: log.error("GameLauncher error: %s", msg) |
