summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-new-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-05-24 09:42:50 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-05-24 09:42:50 +0000
commit31afe17b33a4799bc776cfe1f2d496c7c446d3f0 (patch)
tree4c64d0d7da21784371e533d1c0d568a7f6df51f4 /usr.bin/tmux/cmd-new-window.c
parent99ae952fb5951366f160e00bcb8af3ad15f5fed0 (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 'usr.bin/tmux/cmd-new-window.c')
-rw-r--r--usr.bin/tmux/cmd-new-window.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-new-window.c b/usr.bin/tmux/cmd-new-window.c
index bef114a97fd..f4004cd9772 100644
--- a/usr.bin/tmux/cmd-new-window.c
+++ b/usr.bin/tmux/cmd-new-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-new-window.c,v 1.74 2018/05/03 16:56:59 nicm Exp $ */
+/* $OpenBSD: cmd-new-window.c,v 1.75 2018/05/24 09:42:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -95,10 +95,8 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
if ((tmp = args_get(args, 'c')) != NULL)
cwd = format_single(item, tmp, c, s, NULL, NULL);
- else if (item->client != NULL && item->client->session == NULL)
- cwd = xstrdup(item->client->cwd);
else
- cwd = xstrdup(s->cwd);
+ cwd = xstrdup(server_client_get_cwd(item->client, s));
if ((tmp = args_get(args, 'n')) != NULL)
name = format_single(item, tmp, c, s, NULL, NULL);