summaryrefslogtreecommitdiffstats
path: root/cmd-new-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-01-31 15:52:21 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-01-31 15:52:21 +0000
commit908a22e41ce9b33156ee2fa7a68bd585033cf3a3 (patch)
tree218d3848ddddab98ee5021e11dc73865e1a05743 /cmd-new-window.c
parent49a5a587ec6c99e4030d51cb65f04d49c87e3c31 (diff)
Provide defined ways to set the various default-path possibilities: ~
for home directory, . for server start directory, - for session start directory and empty for the pane's working directory (the default). All can also be used as part of a relative path (eg -/foo). Also provide -c flags to neww and splitw to override default-path setting. Based on a diff from sthen. ok sthen
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r--cmd-new-window.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c
index d858ee30..cf93567d 100644
--- a/cmd-new-window.c
+++ b/cmd-new-window.c
@@ -30,8 +30,9 @@ int cmd_new_window_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_new_window_entry = {
"new-window", "neww",
- "adkn:Pt:", 0, 1,
- "[-adk] [-n window-name] [-t target-window] [command]",
+ "ac:dkn:Pt:", 0, 1,
+ "[-adk] [-c start-directory] [-n window-name] [-t target-window] "
+ "[command]",
0,
NULL,
NULL,
@@ -99,7 +100,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
cmd = options_get_string(&s->options, "default-command");
else
cmd = args->argv[0];
- cwd = cmd_get_default_path(ctx);
+ cwd = cmd_get_default_path(ctx, args_get(args, 'c'));
if (idx == -1)
idx = -1 - options_get_number(&s->options, "base-index");