mirror of
https://github.com/hykilpikonna/hyfetch.git
synced 2026-08-27 19:25:13 -05:00
This commit is contained in:
@@ -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:]])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user