From e1a32ad34456671190e18eae81173f5ca291d009 Mon Sep 17 00:00:00 2001 From: Azalea Date: Mon, 1 Jun 2026 12:34:34 +0000 Subject: [PATCH] [F] Fix #498 --- hyfetch/rs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hyfetch/rs.py b/hyfetch/rs.py index 33fefef5..bbc33b1a 100644 --- a/hyfetch/rs.py +++ b/hyfetch/rs.py @@ -35,6 +35,17 @@ def run_rust(): run_py() return + # Keep using execv on POSIX so the Rust binary replaces this Python wrapper. + # Windows has no equivalent process replacement; Python's execv starts the + # Rust executable and exits, which lets MSYS2 print the next prompt while + # hyfetch is still writing to the terminal. + if platform.system() == 'Windows': + try: + proc = subprocess.run([str(pd), *sys.argv[1:]]) + except KeyboardInterrupt: + raise SystemExit(130) + raise SystemExit(proc.returncode) + # Run the rust executable, passing in all arguments os.execv(str(pd), [str(pd), *sys.argv[1:]])