summaryrefslogtreecommitdiffstats
path: root/spawn.c
diff options
context:
space:
mode:
authornicm <nicm>2020-03-02 08:30:30 +0000
committernicm <nicm>2020-03-02 08:30:30 +0000
commit8be179de4669a76464d664d9af6b3301ca3f286d (patch)
tree8364422996342f7f90795b290974a13f8f658aa9 /spawn.c
parentf65b9c0d36e40ded66d4366b473cc2529e1aa8f8 (diff)
Use current session for cwd of new sessions, not the new session which
doesn't have one yet. GitHub issue 2091.
Diffstat (limited to 'spawn.c')
-rw-r--r--spawn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/spawn.c b/spawn.c
index 933f0c6a..6bcea168 100644
--- a/spawn.c
+++ b/spawn.c
@@ -230,9 +230,9 @@ spawn_pane(struct spawn_context *sc, char **cause)
* the pane's stored one unless specified.
*/
if (sc->cwd != NULL)
- cwd = format_single(item, sc->cwd, c, s, NULL, NULL);
+ cwd = format_single(item, sc->cwd, c, item->target.s, NULL, NULL);
else if (~sc->flags & SPAWN_RESPAWN)
- cwd = xstrdup(server_client_get_cwd(c, s));
+ cwd = xstrdup(server_client_get_cwd(c, item->target.s));
else
cwd = NULL;