This commit is contained in:
Kovid Goyal 2023-02-22 19:51:33 +05:30
parent 1f84e2d4e5
commit de188faf55
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 5 additions and 1 deletions

View File

@ -579,6 +579,8 @@ def launch(
else:
if opts.hold:
cmd = kw['cmd'] or [shell_path]
if not os.path.isabs(cmd[0]):
cmd[0] = which(cmd[0]) or cmd[0]
kw['cmd'] = [kitten_exe(), '__hold_till_enter__'] + cmd
if force_target_tab:
tab = target_tab

View File

@ -15,7 +15,7 @@ from .options.types import Options
from .options.utils import resize_window, to_layout_names, window_size
from .os_window_size import WindowSize, WindowSizeData, WindowSizes
from .typing import SpecialWindowInstance
from .utils import expandvars, log_error, resolve_custom_file, resolved_shell
from .utils import expandvars, log_error, resolve_custom_file, resolved_shell, which
if TYPE_CHECKING:
from .launch import LaunchSpec
@ -234,6 +234,7 @@ def create_sessions(
if special_window is None:
cmd = args.args if args and args.args else resolved_shell(opts)
if args and args.hold:
cmd[0] = which(cmd[0]) or cmd[0]
cmd = [kitten_exe(), '__hold_till_enter__'] + cmd
from kitty.tabs import SpecialWindow
cwd: Optional[str] = args.directory if respect_cwd and args else None

View File

@ -441,6 +441,7 @@ class Tab: # {{{
cmd[:0] = shlex.split(line)
else:
cmd[:0] = [resolved_shell(get_options())[0]]
cmd[0] = which(cmd[0]) or cmd[0]
cmd[:0] = [kitten_exe(), '__hold_till_enter__']
fenv: Dict[str, str] = {}
if env: