Add a --hold option for the launch command

This commit is contained in:
Kovid Goyal
2022-01-07 13:32:25 +05:30
parent 5bfed4fe2f
commit 5c343c918d
2 changed files with 10 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ from .boss import Boss
from .child import Child
from .cli import parse_args
from .cli_stub import LaunchCLIOptions
from .constants import kitty_exe, shell_path
from .fast_data_types import patch_color_profiles, set_clipboard_string
from .options.utils import env as parse_env
from .tabs import Tab
@@ -71,6 +72,11 @@ Using :code:`name=` will set to empty string and just :code:`name` will
remove the environment variable.
--hold
type=bool-set
Keep the window open even after the command being executed exits.
--copy-colors
type=bool-set
Set the colors of the newly created window to be the same as the colors in the
@@ -398,6 +404,9 @@ def launch(
else:
set_primary_selection(stdin)
else:
if opts.hold:
cmd = kw['cmd'] or [shell_path]
kw['cmd'] = [kitty_exe(), '+hold'] + cmd
if force_target_tab:
tab = target_tab
else:

View File

@@ -33,6 +33,7 @@ class Launch(RemoteCommand):
copy_colors: Boolean indicating whether to copy the colors from the current window
copy_cmdline: Boolean indicating whether to copy the cmdline from the current window
copy_env: Boolean indicating whether to copy the environ from the current window
hold: Boolean indicating whether to keep window open after cmd exits
location: Where in the tab to open the new window
allow_remote_control: Boolean indicating whether to allow remote control from the new window
stdin_source: Where to get stdin for thew process from