slave: spawn: set PWD environment variable

This improves handling of symlinks (in CWD) when launching a new
terminal instance, either through ctrl+shift+n, or using the
--working-directory command line option.

Closes #1179
This commit is contained in:
Daniel Eklöf 2022-09-26 19:00:27 +02:00
parent 88c3128515
commit 9e58661093
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 3 additions and 0 deletions

View file

@ -352,6 +352,7 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv,
setenv("TERM", term_env, 1);
setenv("COLORTERM", "truecolor", 1);
setenv("PWD", cwd, 1);
#if defined(FOOT_TERMINFO_PATH)
setenv("TERMINFO", FOOT_TERMINFO_PATH, 1);