Fix --hold not working with some programs that cause keyboard interrupt to be passed to python

This commit is contained in:
Kovid Goyal 2022-02-17 11:12:33 +05:30
parent 1c9cf32735
commit 185c3320a4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -31,7 +31,10 @@ def runpy(args: List[str]) -> None:
def hold(args: List[str]) -> None: def hold(args: List[str]) -> None:
import subprocess import subprocess
ret = subprocess.Popen(args[1:]).wait() try:
ret = subprocess.Popen(args[1:]).wait()
except KeyboardInterrupt:
pass
from kitty.utils import hold_till_enter from kitty.utils import hold_till_enter
hold_till_enter() hold_till_enter()
raise SystemExit(ret) raise SystemExit(ret)