Problem
I am trying to get the edit-in-kitty command to work on my local workstation (not over SSH, yet), but it seems like the environment variables — which are usually exported while sourcing my shell's rc file — aren't carried over to the child process while executing this command. This causes a number of errors while starting the editor.
To be more specific, the editor is Vim, and examples of issues I am facing include:
- The global variable
g:colors_nameis set based on the value the environment variableBASE16_THEME— which is set in my shell's rc file — and some plugin's theme cannot be applied without it. - Some plugin is looking for an executable inside my
PATH, and fails because thePATHvisible to Vim is only the system widePATH(/usr/bin:/bin:/usr/sbin:/sbin).
I am quite certain that edit-in-kitty does receive the fully populated environment during execution, since it runs my manually installed version of Vim instead of the one that ships with the OS, which is what I expect. To me, it seems like the environment is cleared right before starting the editor.
Components:
- kitty 0.25.2
- zsh 5.8.1
- Vim 9.0 (macOS version, part of MacVim)
What I tried
I set the env option explicitly inside my kitty configuration to env BASE16_THEME=default-dark, and can confirm that it carries over to Vim when I run edit-in-kitty.
Setting PATH in the same fashion, e.g. via env PATH=/custom/bin:${PATH}, would most certainly work too.
Question
The method above doesn't feel very portable to me since the environment depends heavily on my shell's configuration, which varies from system to system. Since kitty runs the shell to evaluate its environment, is there a way to instruct it to preserve this environment while launching the text editor?