From 9df7460fe149659c3e95262127471defcc27c731 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 22 Mar 2024 11:56:44 +0530 Subject: [PATCH] Add a note about how to use edit-in-kitty with sudo to edit root files --- docs/shell-integration.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/shell-integration.rst b/docs/shell-integration.rst index dfd160d7b..812151143 100644 --- a/docs/shell-integration.rst +++ b/docs/shell-integration.rst @@ -313,6 +313,10 @@ window, etc. Not all arguments are supported, see the discussion in the In order to avoid remote code execution, kitty will only execute the configured editor and pass the file path to edit to it. +.. note:: To edit files using sudo the best method is to set the + :code:`SUDO_EDITOR` environment variable to ``kitten edit-in-kitty`` and + then edit the file using the ``sudoedit`` or ``sudo -e`` commands. + .. _run_shell: