Clients: don't use stdin when loading steam overlay

This commit is contained in:
black-sliver 2022-04-06 00:06:48 +02:00 committed by Fabian Dill
parent 9bdcbb9008
commit 3d1f6d9b82
1 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,7 @@ from MultiServer import CommandProcessor
from NetUtils import Endpoint, decode, NetworkItem, encode, JSONtoTextParser, ClientStatus, Permission
from Utils import Version, stream_input
from worlds import network_data_package, AutoWorldRegister
import os
logger = logging.getLogger("Client")
@ -617,13 +618,16 @@ if __name__ == '__main__':
ctx = TextContext(args.connect, args.password)
ctx.server_task = asyncio.create_task(server_loop(ctx), name="server loop")
input_task = None
steam_overlay = False
if gui_enabled:
from kvui import TextManager
ctx.ui = TextManager(ctx)
ui_task = asyncio.create_task(ctx.ui.async_run(), name="UI")
steam_overlay = 'gameoverlayrenderer' in os.environ.get('LD_PRELOAD', '')
else:
ui_task = None
if sys.stdin:
if sys.stdin and not steam_overlay: # steam overlay breaks when starting console_loop
input_task = asyncio.create_task(console_loop(ctx), name="Input")
await ctx.exit_event.wait()