From e8de2def963cdc390368d4c4983d3804dc69e80d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 16 Aug 2022 11:42:39 +0530 Subject: [PATCH] Fix --allow-remote-control not working with allow_remote_control=no --- kitty/boss.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kitty/boss.py b/kitty/boss.py index 37368134c..7708b7e6e 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -453,10 +453,12 @@ class Boss: from .remote_control import is_cmd_allowed, parse_cmd response = None window = window or None - if self.allow_remote_control == 'n': - return {'ok': False, 'error': 'Remote control is disabled'} - if self.allow_remote_control == 'socket-only' and peer_id == 0: - return {'ok': False, 'error': 'Remote control is allowed over a socket only'} + window_has_remote_control = bool(window and window.allow_remote_control) + if not window_has_remote_control: + if self.allow_remote_control == 'n': + return {'ok': False, 'error': 'Remote control is disabled'} + if self.allow_remote_control == 'socket-only' and peer_id == 0: + return {'ok': False, 'error': 'Remote control is allowed over a socket only'} try: pcmd = parse_cmd(cmd, self.encryption_key) except Exception as e: