diff --git a/spawn.c b/spawn.c index 2cb2b65e..e63133fe 100644 --- a/spawn.c +++ b/spawn.c @@ -389,7 +389,7 @@ spawn_pane(struct spawn_context *sc, char **cause) */ if (chdir(new_wp->cwd) == 0) environ_set(child, "PWD", 0, "%s", new_wp->cwd); - else if ((tmp = find_home()) != NULL || chdir(tmp) == 0) + else if ((tmp = find_home()) != NULL && chdir(tmp) == 0) environ_set(child, "PWD", 0, "%s", tmp); else if (chdir("/") == 0) environ_set(child, "PWD", 0, "/");