From b02d031680359b9104eca27fc6e570c9386b5329 Mon Sep 17 00:00:00 2001 From: Stephen-RA-King <33905365+Stephen-RA-King@users.noreply.github.com> Date: Mon, 13 Mar 2023 18:15:39 +0000 Subject: [PATCH] feat: add automatic shell restart --- src/pynball/pynball.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pynball/pynball.py b/src/pynball/pynball.py index ff7e4f9..03cbbf7 100644 --- a/src/pynball/pynball.py +++ b/src/pynball/pynball.py @@ -525,8 +525,13 @@ def system(ctx: Any, name: str) -> None: _setenv("system", "PATH", all_paths) message = "New version set" _feedback(message, "nominal") - message = "Remember to restart the shell to use the new version" + message = "restarting the shell to use the new version" _feedback(message, "warning") + if os.name == "nt": + os.system("taskkill /f /im explorer.exe > nul 2>&1") + else: + os.system("taskkill /f /im explorer.exe > /dev/null 2>&1") + os.system("start explorer.exe") @cli.command()