Use current session for cwd of new sessions, not the new session which

doesn't have one yet. GitHub issue 2091.
This commit is contained in:
nicm 2020-03-02 08:30:30 +00:00
parent f65b9c0d36
commit 8be179de46

View File

@ -230,9 +230,9 @@ spawn_pane(struct spawn_context *sc, char **cause)
* the pane's stored one unless specified. * the pane's stored one unless specified.
*/ */
if (sc->cwd != NULL) 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) 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 else
cwd = NULL; cwd = NULL;