mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-09-29 00:56:25 +00:00
Fix missing args when running a script without exec perms via launch
This commit is contained in:
parent
4d3e2a07d1
commit
3dfdb3ac89
1 changed files with 3 additions and 0 deletions
|
|
@ -383,12 +383,15 @@ class Tab: # {{{
|
|||
import shlex
|
||||
with suppress(OSError):
|
||||
with open(old_exe) as f:
|
||||
cmd_rest = cmd[1:] if len(cmd) > 1 else []
|
||||
cmd = [kitty_exe(), '+hold']
|
||||
if f.read(2) == '#!':
|
||||
line = f.read(4096).splitlines()[0]
|
||||
cmd += shlex.split(line) + [old_exe]
|
||||
else:
|
||||
cmd += [resolved_shell(get_options())[0], cmd[0]]
|
||||
if cmd_rest:
|
||||
cmd += cmd_rest
|
||||
fenv: Dict[str, str] = {}
|
||||
if env:
|
||||
fenv.update(env)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue