summaryrefslogtreecommitdiffstats
path: root/cmd-split-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-06-27 02:56:59 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-06-27 02:56:59 +0000
commit07a71fd432df5873515da82d2d620ec0d986b558 (patch)
treea4a9064b09cfc31f1ec1f49adb7e1f7b8308eaed /cmd-split-window.c
parent26524c99f68959b5a0d1698529f332934061d424 (diff)
Store the current working directory in the session, change the default-path
option to default to empty and make that mean that the stored session CWD is used.
Diffstat (limited to 'cmd-split-window.c')
-rw-r--r--cmd-split-window.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd-split-window.c b/cmd-split-window.c
index f4bfe4e2..e4f46c34 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -170,10 +170,13 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx)
cmd = data->cmd;
if (cmd == NULL)
cmd = options_get_string(&s->options, "default-command");
- if (ctx->cmdclient == NULL || ctx->cmdclient->cwd == NULL)
- cwd = options_get_string(&s->options, "default-path");
- else
- cwd = ctx->cmdclient->cwd;
+ cwd = options_get_string(&s->options, "default-path");
+ if (*cwd == '\0') {
+ if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL)
+ cwd = ctx->cmdclient->cwd;
+ else
+ cwd = s->cwd;
+ }
type = LAYOUT_TOPBOTTOM;
if (data->flag_horizontal)