From 2b9834f625e32e646e4a393eb0f1ed70650e925e Mon Sep 17 00:00:00 2001 From: edschuy95 Date: Thu, 22 Jan 2026 20:24:19 -0500 Subject: [PATCH] . --- RA3MP3Playback.pyw | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/RA3MP3Playback.pyw b/RA3MP3Playback.pyw index 451f05f..2bebb4d 100644 --- a/RA3MP3Playback.pyw +++ b/RA3MP3Playback.pyw @@ -696,6 +696,20 @@ def game_launch(gameargs): def main(): global playlist, ra3_maps, pty_proc, playlist_path, ra3_maps_path, arena0_blacklist, arena0_bl_path, master_fd + # Linux-specific: Handle file manager launch + if os.name != 'nt' and not sys.stdout.isatty(): + # Redirect stdin/stdout/stderr to prevent issues when launched from file manager + import subprocess + sys.stdin = open('/dev/null', 'r') + sys.stdout = open('/dev/null', 'w') + sys.stderr = open('/dev/null', 'w') + + # Create a new session to detach from the file manager + try: + os.setsid() + except OSError: + pass # Already a session leader + game_exe = DEBUG_GAME_EXE if DEBUG else DEFAULT_GAME_EXE chosen_mod = None