mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Show a message about how to exit --hold
This commit is contained in:
parent
9fdaef1da6
commit
2eccc81fee
2 changed files with 8 additions and 2 deletions
|
|
@ -30,8 +30,14 @@ def runpy(args: List[str]) -> None:
|
|||
|
||||
def hold(args: List[str]) -> None:
|
||||
import subprocess
|
||||
from contextlib import suppress
|
||||
import tty
|
||||
ret = subprocess.Popen(args[1:]).wait()
|
||||
sys.stdin.read()
|
||||
with suppress(BaseException):
|
||||
print('\n\x1b[1;32mPress any key to exit', end='', flush=True)
|
||||
with suppress(BaseException):
|
||||
tty.setraw(sys.stdin.fileno())
|
||||
sys.stdin.buffer.read(1)
|
||||
raise SystemExit(ret)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ created after startup.
|
|||
--hold
|
||||
type=bool-set
|
||||
Remain open after child process exits. Note that this only affects the first
|
||||
window. You can quit by either using the close window shortcut or :kbd:`Ctrl+d`.
|
||||
window. You can quit by either using the close window shortcut or pressing any key.
|
||||
|
||||
|
||||
--single-instance -1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue