Also fix --hold not working if program to be executed is not found

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

View File

@ -35,6 +35,10 @@ def hold(args: List[str]) -> None:
ret = subprocess.Popen(args[1:]).wait()
except KeyboardInterrupt:
pass
except FileNotFoundError:
print(f'Could not find {args[1]!r} to execute', file=sys.stderr)
except Exception as e:
print(e, file=sys.stderr)
from kitty.utils import hold_till_enter
hold_till_enter()
raise SystemExit(ret)