Fix launcher display on Tools>Upgrade/Downgrade on Windows 10

Thanks to abdo:
https://forums.ankiweb.net/t/anki-25-08-beta-3/64738/6
This commit is contained in:
Damien Elmes 2025-07-28 21:43:11 +10:00
parent baeccfa3e4
commit 69d54864a8
2 changed files with 12 additions and 6 deletions

View file

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

View file

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