Proper fix for macOS argv[0]

This commit is contained in:
Kovid Goyal 2022-04-15 15:23:45 +05:30
parent e5322cdc52
commit 716813e38a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 1 deletions

View File

@ -284,6 +284,7 @@ class Child:
# testing.
argv[0] = (f'-{exe.split("/")[-1]}')
self.final_exe = which(exe) or exe
self.final_argv0 = argv[0]
pid = fast_data_types.spawn(self.final_exe, self.cwd, tuple(argv), env, master, slave, stdin_read_fd, stdin_write_fd, ready_read_fd, ready_write_fd)
os.close(slave)
self.pid = pid

View File

@ -591,7 +591,7 @@ def clone_and_launch(msg: str, window: Window) -> None:
cmdline = []
if not cmdline:
cmdline = list(window.child.argv)
if cmdline and cmdline[0] == window.child.argv[0]:
if cmdline and cmdline[0] == window.child.final_argv0:
cmdline[0] = window.child.final_exe
ssh_kitten_cmdline = window.ssh_kitten_cmdline()
if ssh_kitten_cmdline: