This commit is contained in:
Kovid Goyal
2023-02-22 19:51:33 +05:30
parent 1f84e2d4e5
commit de188faf55
3 changed files with 5 additions and 1 deletions

View File

@@ -579,6 +579,8 @@ def launch(
else: else:
if opts.hold: if opts.hold:
cmd = kw['cmd'] or [shell_path] 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 kw['cmd'] = [kitten_exe(), '__hold_till_enter__'] + cmd
if force_target_tab: if force_target_tab:
tab = 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 .options.utils import resize_window, to_layout_names, window_size
from .os_window_size import WindowSize, WindowSizeData, WindowSizes from .os_window_size import WindowSize, WindowSizeData, WindowSizes
from .typing import SpecialWindowInstance 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: if TYPE_CHECKING:
from .launch import LaunchSpec from .launch import LaunchSpec
@@ -234,6 +234,7 @@ def create_sessions(
if special_window is None: if special_window is None:
cmd = args.args if args and args.args else resolved_shell(opts) cmd = args.args if args and args.args else resolved_shell(opts)
if args and args.hold: if args and args.hold:
cmd[0] = which(cmd[0]) or cmd[0]
cmd = [kitten_exe(), '__hold_till_enter__'] + cmd cmd = [kitten_exe(), '__hold_till_enter__'] + cmd
from kitty.tabs import SpecialWindow from kitty.tabs import SpecialWindow
cwd: Optional[str] = args.directory if respect_cwd and args else None 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) cmd[:0] = shlex.split(line)
else: else:
cmd[:0] = [resolved_shell(get_options())[0]] cmd[:0] = [resolved_shell(get_options())[0]]
cmd[0] = which(cmd[0]) or cmd[0]
cmd[:0] = [kitten_exe(), '__hold_till_enter__'] cmd[:0] = [kitten_exe(), '__hold_till_enter__']
fenv: Dict[str, str] = {} fenv: Dict[str, str] = {}
if env: if env: