summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-split-window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-01-31 15:52:21 +0000
committernicm <nicm@openbsd.org>2012-01-31 15:52:21 +0000
commit1581b699ef821dd322aede7f215fdab865d0775a (patch)
tree2dca29d25608d60a8055ea3417f04dff65cce2b0 /usr.bin/tmux/cmd-split-window.c
parentadd missing calls to pf_pkt_addr_changed(); ok henning@ (diff)
downloadwireguard-openbsd-1581b699ef821dd322aede7f215fdab865d0775a.tar.xz
wireguard-openbsd-1581b699ef821dd322aede7f215fdab865d0775a.zip
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 'usr.bin/tmux/cmd-split-window.c')
-rw-r--r--usr.bin/tmux/cmd-split-window.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c
index a9bbcb70698..b6466d6f641 100644
--- a/usr.bin/tmux/cmd-split-window.c
+++ b/usr.bin/tmux/cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-split-window.c,v 1.27 2012/01/20 19:54:07 nicm Exp $ */
+/* $OpenBSD: cmd-split-window.c,v 1.28 2012/01/31 15:52:21 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -33,8 +33,9 @@ int cmd_split_window_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_split_window_entry = {
"split-window", "splitw",
- "dl:hp:Pt:v", 0, 1,
- "[-dhvP] [-p percentage|-l size] [-t target-pane] [command]",
+ "c:dl:hp:Pt:v", 0, 1,
+ "[-dhvP] [-c start-directory] [-p percentage|-l size] [-t target-pane] "
+ "[command]",
0,
cmd_split_window_key_binding,
NULL,
@@ -78,7 +79,7 @@ cmd_split_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'));
type = LAYOUT_TOPBOTTOM;
if (args_has(args, 'h'))