From 5722acad4f601bd31b77c434a2fb29f71d7d0b4e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Mar 2026 08:35:28 +0530 Subject: [PATCH] remote_control_script: resolve relative paths with respect to kitty config directory Fixes #9625 --- docs/changelog.rst | 3 +++ docs/remote-control.rst | 3 ++- kitty/boss.py | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7d99d7988..95f0823e9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -269,6 +269,9 @@ Detailed list of changes - Allow double clicking on a tab to rename it (:pull:`9609`) +- :ac:`remote_control_script` resolve relative paths with respect to kitty + config directory (:iss:`9625`) + 0.45.0 [2025-12-24] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/remote-control.rst b/docs/remote-control.rst index 8da691a98..cc3c68f9f 100644 --- a/docs/remote-control.rst +++ b/docs/remote-control.rst @@ -298,7 +298,8 @@ control commands as you like and process their output. :ac:`launch` command with ``--type=background --allow-remote-control``. For more advanced usage, including fine grained permissions, setting env vars, command line interpolation, passing data to STDIN, etc. -the :doc:`launch ` command should be used. +the :doc:`launch ` command should be used. Relative paths to scripts +are interpreted with respect to the kitty config directory. .. note:: You do not need :opt:`allow_remote_control` to use these mappings, as they are not actual remote programs, but are simply a way to reuse the diff --git a/kitty/boss.py b/kitty/boss.py index 52f9658e6..b8f9603f9 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -165,6 +165,7 @@ from .utils import ( parse_address_spec, parse_os_window_state, platform_window_id, + resolve_custom_file, safe_print, sanitize_url_for_display_to_user, shlex_split, @@ -855,9 +856,11 @@ class Boss: map f1 remote_control_script /path/to/script arg1 arg2 ... - See :ref:`rc_mapping` for details. + See :ref:`rc_mapping` for details. Relative paths are resolved with respect + to the kitty config directory. ''') def remote_control_script(self, path: str, *args: str) -> None: + path = resolve_custom_file(path) path = which(path) or path if not os.access(path, os.X_OK): self.show_error('Remote control script not executable', f'The script {path} is not executable check its permissions')