diff --git a/qt/aqt/package.py b/qt/aqt/package.py index c8d481312..a2d8fd4c4 100644 --- a/qt/aqt/package.py +++ b/qt/aqt/package.py @@ -156,12 +156,15 @@ def update_and_restart() -> None: creationflags = ( subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.DETACHED_PROCESS ) + # On Windows 10, changing the handles breaks ANSI display + io = None if sys.platform == "win32" else subprocess.DEVNULL + subprocess.Popen( [launcher], start_new_session=True, - stdin=subprocess.DEVNULL, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, + stdin=io, + stdout=io, + stderr=io, env=env, creationflags=creationflags, ) diff --git a/qt/launcher/addon/__init__.py b/qt/launcher/addon/__init__.py index 799406e86..5b7ce7fc3 100644 --- a/qt/launcher/addon/__init__.py +++ b/qt/launcher/addon/__init__.py @@ -95,12 +95,15 @@ def update_and_restart() -> None: creationflags = ( subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.DETACHED_PROCESS ) + # On Windows, changing the handles breaks ANSI display + io = None if sys.platform == "win32" else subprocess.DEVNULL + subprocess.Popen( [launcher], start_new_session=True, - stdin=subprocess.DEVNULL, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, + stdin=io, + stdout=io, + stderr=io, env=env, creationflags=creationflags, )