mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
spawn: set $PWD, in addition to calling chdir(cwd)
This commit is contained in:
parent
90ce4f3008
commit
332cb90134
1 changed files with 6 additions and 3 deletions
9
spawn.c
9
spawn.c
|
|
@ -54,9 +54,12 @@ spawn(struct reaper *reaper, const char *cwd, char *const argv[],
|
|||
goto child_err;
|
||||
}
|
||||
|
||||
if (cwd != NULL && chdir(cwd) < 0) {
|
||||
LOG_WARN("failed to change working directory to %s: %s",
|
||||
cwd, strerror(errno));
|
||||
if (cwd != NULL) {
|
||||
setenv("PWD", cwd, 1);
|
||||
if (chdir(cwd) < 0) {
|
||||
LOG_WARN("failed to change working directory to %s: %s",
|
||||
cwd, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
if (xdg_activation_token != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue