summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authornicm <nicm>2018-05-24 09:42:49 +0000
committernicm <nicm>2018-05-24 09:42:49 +0000
commitb9a6162d2f9bea63c3ad421e9c3969eea2852b00 (patch)
treed944f370a3a21ea175f9fe958f9773146cdbfc1a /cmd-new-session.c
parent8f5903d7c3d75763ed5dc37ff49a39fe3b3b7831 (diff)
Make server_client_get_cwd used (almost) everywhere we need to work out
the cwd, and do not fall back to "." as it is pretty useless. GitHub issue 1331.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c4
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