From c7e3c92a0a1439e246af2ec0a195b7f15f5c25ae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 Aug 2022 20:39:10 +0530 Subject: [PATCH] Allow listen_on to be used even without allow_remote_control Since we intend to allow password based access, which works regardless of the value of allow_remote_control --- kitty/boss.py | 2 +- kitty/cli.py | 4 +--- kitty/main.py | 2 +- kitty/options/definition.py | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/kitty/boss.py b/kitty/boss.py index cb07c0509..46351eecb 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -256,7 +256,7 @@ class Boss: # we dont allow reloading the config file to change # allow_remote_control self.allow_remote_control = opts.allow_remote_control - if args.listen_on and (self.allow_remote_control in ('y', 'socket-only')): + if args.listen_on: listen_fd = listen_on(args.listen_on) self.prewarm = prewarm self.child_monitor = ChildMonitor( diff --git a/kitty/cli.py b/kitty/cli.py index be3801a4c..8b140111f 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -684,9 +684,7 @@ also use abstract UNIX sockets, not associated with a file, like this: expanded and relative paths are resolved with respect to the temporary directory. To control kitty, you can send commands to it with :italic:`{appname} @` using the :option:`{appname} @ --to` option to specify -this address. Unless you enabled :opt:`allow_remote_control` in -:file:`{conf_name}.conf`, this option will be ignored. Note that if you run -:italic:`{appname} @` within a kitty window, there is +this address. Note that if you run :italic:`{appname} @` within a kitty window, there is no need to specify the :option:`{appname} @ --to` option as it will automatically read from the environment. For UNIX sockets, this can also be specified in :file:`{conf_name}.conf`. diff --git a/kitty/main.py b/kitty/main.py index af72ff7fc..170c25b5f 100644 --- a/kitty/main.py +++ b/kitty/main.py @@ -324,7 +324,7 @@ def setup_environment(opts: Options, cli_opts: CLIOptions) -> None: if not cli_opts.listen_on and opts.listen_on.startswith('unix:'): cli_opts.listen_on = opts.listen_on from_config_file = True - if cli_opts.listen_on and opts.allow_remote_control != 'n': + if cli_opts.listen_on: cli_opts.listen_on = expand_listen_on(cli_opts.listen_on, from_config_file) os.environ['KITTY_LISTEN_ON'] = cli_opts.listen_on env = opts.env.copy() diff --git a/kitty/options/definition.py b/kitty/options/definition.py index af18cff4f..91ec0ce19 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -2739,8 +2739,7 @@ socket. This option accepts only UNIX sockets, such as variables are expanded and relative paths are resolved with respect to the temporary directory. If :code:`{kitty_pid}` is present, then it is replaced by the PID of the kitty process, otherwise the PID of the kitty process is -appended to the value, with a hyphen. This option is ignored unless you also set -:opt:`allow_remote_control` to enable remote control. See the help for +appended to the value, with a hyphen. See the help for :option:`kitty --listen-on` for more details. Changing this option by reloading the config is not supported. '''