diff options
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r-- | cmd-new-session.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c index 26cb08ba..7af67a11 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -156,10 +156,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) /* Get the new session working directory. */ if ((tmp = args_get(args, 'c')) != NULL) cwd = format_single(item, tmp, c, NULL, NULL, NULL); - else if (c != NULL && c->session == NULL && c->cwd != NULL) - cwd = xstrdup(c->cwd); else - cwd = xstrdup("."); + cwd = xstrdup(server_client_get_cwd(c, NULL)); /* * If this is a new client, check for nesting and save the termios |