Allow easily injecting env vars from the login shell config into the env in which kitty runs child processes

Fixes #9042
This commit is contained in:
Kovid Goyal
2025-10-07 22:21:15 +05:30
parent fcccadc8f3
commit a9f80fe05b
5 changed files with 48 additions and 10 deletions

View File

@@ -480,6 +480,16 @@ related to localization, such as :envvar:`LANG`, ``LC_*`` and loading of
configuration files such as ``XDG_*``, :envvar:`KITTY_CONFIG_DIRECTORY` and,
most importantly, ``PATH`` to locate binaries.
The simplest way to fix this is to have kitty load the environment variables
from your shell configuration at startup using the :opt:`env` directive,
adding the following to :file:`kitty.conf`::
env read_from_login_shell=PATH LANG LC_* XDG_* EDITOR VISUAL
This works for POSIX compliant shells and the fish shell. Note that it
does add significantly to kitty startup time, so use only if really necessary.
This feature was added in version ``0.43.2``.
To see the environment variables that kitty sees, you can add the following
mapping to :file:`kitty.conf`::