This commit is contained in:
edschuy95 2026-01-22 20:24:19 -05:00
parent cc1864ca78
commit 2b9834f625

View file

@ -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