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

@ -63,8 +63,10 @@
* `DECRPM` replies (to `DECRQM` queries) now report a value of `4`
("permanently reset") instead of `2` ("reset") for DEC private
modes that are known but unsupported.
* Set `PWD` environment variable in the slave process ([#1179][1179]).
[1166]: https://codeberg.org/dnkl/foot/issues/1166
[1179]: https://codeberg.org/dnkl/foot/issues/1179
### Deprecated

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);