From 8be179de4669a76464d664d9af6b3301ca3f286d Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 2 Mar 2020 08:30:30 +0000 Subject: [PATCH] Use current session for cwd of new sessions, not the new session which doesn't have one yet. GitHub issue 2091. --- spawn.c | 4 ++-- 1 file 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;