.
This commit is contained in:
parent
cc1864ca78
commit
2b9834f625
1 changed files with 14 additions and 0 deletions
|
|
@ -696,6 +696,20 @@ def game_launch(gameargs):
|
||||||
def main():
|
def main():
|
||||||
global playlist, ra3_maps, pty_proc, playlist_path, ra3_maps_path, arena0_blacklist, arena0_bl_path, master_fd
|
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
|
game_exe = DEBUG_GAME_EXE if DEBUG else DEFAULT_GAME_EXE
|
||||||
|
|
||||||
chosen_mod = None
|
chosen_mod = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue