mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 01:08:10 +02:00
Unset shell integration env var before exec command
This commit is contained in:
@@ -242,7 +242,7 @@ def prepare_exec_cmd(remote_args: Sequence[str], is_python: bool) -> str:
|
|||||||
if is_python:
|
if is_python:
|
||||||
return standard_b64encode(' '.join(remote_args).encode('utf-8')).decode('ascii')
|
return standard_b64encode(' '.join(remote_args).encode('utf-8')).decode('ascii')
|
||||||
args = ' '.join(c.replace("'", """'"'"'""") for c in remote_args)
|
args = ' '.join(c.replace("'", """'"'"'""") for c in remote_args)
|
||||||
return f"""exec "$login_shell" -c '{args}'"""
|
return f"""unset KITTY_SHELL_INTEGRATION; exec "$login_shell" -c '{args}'"""
|
||||||
|
|
||||||
|
|
||||||
def prepare_export_home_cmd(ssh_opts: SSHOptions, is_python: bool) -> str:
|
def prepare_export_home_cmd(ssh_opts: SSHOptions, is_python: bool) -> str:
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ def main():
|
|||||||
ksi = frozenset(filter(None, os.environ.get('KITTY_SHELL_INTEGRATION', '').split()))
|
ksi = frozenset(filter(None, os.environ.get('KITTY_SHELL_INTEGRATION', '').split()))
|
||||||
exec_cmd = b'EXEC_CMD'
|
exec_cmd = b'EXEC_CMD'
|
||||||
if exec_cmd:
|
if exec_cmd:
|
||||||
|
os.environ.pop('KITTY_SHELL_INTEGRATION', None)
|
||||||
cmd = base64.standard_b64decode(exec_cmd).decode('utf-8')
|
cmd = base64.standard_b64decode(exec_cmd).decode('utf-8')
|
||||||
os.execlp(login_shell, os.path.basename(login_shell), '-c', cmd)
|
os.execlp(login_shell, os.path.basename(login_shell), '-c', cmd)
|
||||||
TEST_SCRIPT # noqa
|
TEST_SCRIPT # noqa
|
||||||
|
|||||||
Reference in New Issue
Block a user