diff --git a/kitty/launch.py b/kitty/launch.py index 85adcd386..278d7221f 100644 --- a/kitty/launch.py +++ b/kitty/launch.py @@ -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 diff --git a/kitty/session.py b/kitty/session.py index e814700ab..38b0f3344 100644 --- a/kitty/session.py +++ b/kitty/session.py @@ -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 diff --git a/kitty/tabs.py b/kitty/tabs.py index 7666c3178..5783f489f 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -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: