diff --git a/docs/faq.rst b/docs/faq.rst index 8e4a43be7..258bf4f7a 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -484,7 +484,7 @@ 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 + env read_from_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. diff --git a/kitty/main.py b/kitty/main.py index ab27faa2e..2f5140cbf 100644 --- a/kitty/main.py +++ b/kitty/main.py @@ -480,7 +480,7 @@ def setup_environment(opts: Options, cli_opts: CLIOptions) -> None: if cli_opts.listen_on: cli_opts.listen_on = expand_listen_on(cli_opts.listen_on, from_config_file) path_from_shell = '' - if vars := opts.env.pop('read_from_login_shell', ''): + if vars := opts.env.pop('read_from_shell', ''): import fnmatch import re senv = read_shell_environment(opts) diff --git a/kitty/options/definition.py b/kitty/options/definition.py index 09ffde89c..e0064a57f 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -3272,11 +3272,11 @@ recursively, for example:: The value of :code:`VAR2` will be :code:`/a/b`. Use the special -value :code:`read_from_login_shell` to have kitty read the specified variables from +value :code:`read_from_shell` to have kitty read the specified variables from your :opt:`login shell ` configuration. Useful if your shell startup files setup a bunch of environment variables that you want available to kitty and in kitty session files. Each variable name is treated as a glob pattern to match. For example: -:code:`env read_from_login_shell=PATH LANG LC_* XDG_* EDITOR VISUAL`. Note that these variables are only +:code:`env read_from_shell=PATH LANG LC_* XDG_* EDITOR VISUAL`. Note that these variables are only read after the configuration is fully processed, thus they are not available for recursive expansion and they will override any variables set by other :opt:`env` directives. ''',