Dont set KITTY_LISTEN_ON for windows with --allow-remote-control

This commit is contained in:
Kovid Goyal 2022-08-16 10:50:17 +05:30
parent 6961845167
commit 18bf76d49e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 3 deletions

View File

@ -224,8 +224,10 @@ class Child:
env: Optional[Dict[str, str]] = None, env: Optional[Dict[str, str]] = None,
cwd_from: Optional['CwdRequest'] = None, cwd_from: Optional['CwdRequest'] = None,
is_clone_launch: str = '', is_clone_launch: str = '',
add_listen_on_env_var: bool = True,
): ):
self.is_clone_launch = is_clone_launch self.is_clone_launch = is_clone_launch
self.add_listen_on_env_var = add_listen_on_env_var
self.argv = list(argv) self.argv = list(argv)
if cwd_from: if cwd_from:
try: try:
@ -250,7 +252,7 @@ class Child:
env['COLORTERM'] = 'truecolor' env['COLORTERM'] = 'truecolor'
env['KITTY_PID'] = getpid() env['KITTY_PID'] = getpid()
env['KITTY_PUBLIC_KEY'] = boss.encryption_public_key env['KITTY_PUBLIC_KEY'] = boss.encryption_public_key
if boss.listening_on: if self.add_listen_on_env_var and boss.listening_on:
env['KITTY_LISTEN_ON'] = boss.listening_on env['KITTY_LISTEN_ON'] = boss.listening_on
else: else:
env.pop('KITTY_LISTEN_ON', None) env.pop('KITTY_LISTEN_ON', None)

View File

@ -367,6 +367,7 @@ class Tab: # {{{
cwd: Optional[str] = None, cwd: Optional[str] = None,
env: Optional[Dict[str, str]] = None, env: Optional[Dict[str, str]] = None,
is_clone_launch: str = '', is_clone_launch: str = '',
add_listen_on_env_var: bool = True,
) -> Child: ) -> Child:
check_for_suitability = True check_for_suitability = True
if cmd is None: if cmd is None:
@ -415,7 +416,7 @@ class Tab: # {{{
pwid = platform_window_id(self.os_window_id) pwid = platform_window_id(self.os_window_id)
if pwid is not None: if pwid is not None:
fenv['WINDOWID'] = str(pwid) fenv['WINDOWID'] = str(pwid)
ans = Child(cmd, cwd or self.cwd, stdin, fenv, cwd_from, is_clone_launch=is_clone_launch) ans = Child(cmd, cwd or self.cwd, stdin, fenv, cwd_from, is_clone_launch=is_clone_launch, add_listen_on_env_var=add_listen_on_env_var)
ans.fork() ans.fork()
return ans return ans
@ -445,7 +446,7 @@ class Tab: # {{{
) -> Window: ) -> Window:
child = self.launch_child( child = self.launch_child(
use_shell=use_shell, cmd=cmd, stdin=stdin, cwd_from=cwd_from, cwd=cwd, env=env, use_shell=use_shell, cmd=cmd, stdin=stdin, cwd_from=cwd_from, cwd=cwd, env=env,
is_clone_launch=is_clone_launch is_clone_launch=is_clone_launch, add_listen_on_env_var=not allow_remote_control
) )
window = Window( window = Window(
self, child, self.args, override_title=override_title, self, child, self.args, override_title=override_title,