diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-29 22:10:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-29 22:10:56 +0000 |
commit | 722706b41f0f1ed17e9b9ac2bce350b3617e6f8b (patch) | |
tree | be475e92517c5e1d6fc3885f9f781d2eac8c9694 | |
parent | fc8f857022f028ec41d69ddbb49167b80eefa34e (diff) |
Add -n to break-pane.
-rw-r--r-- | usr.bin/tmux/cmd-break-pane.c | 22 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-source-file.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 5 |
3 files changed, 20 insertions, 13 deletions
diff --git a/usr.bin/tmux/cmd-break-pane.c b/usr.bin/tmux/cmd-break-pane.c index bc61c4852d6..9c37728707c 100644 --- a/usr.bin/tmux/cmd-break-pane.c +++ b/usr.bin/tmux/cmd-break-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-break-pane.c,v 1.40 2016/10/16 19:04:05 nicm Exp $ */ +/* $OpenBSD: cmd-break-pane.c,v 1.41 2017/01/29 22:10:55 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -34,8 +34,8 @@ const struct cmd_entry cmd_break_pane_entry = { .name = "break-pane", .alias = "breakp", - .args = { "dPF:s:t:", 0, 0 }, - .usage = "[-dP] [-F format] [-s src-pane] [-t dst-window]", + .args = { "dPF:n:s:t:", 0, 0 }, + .usage = "[-dP] [-F format] [-n window-name] [-s src-pane] [-t dst-window]", .sflag = CMD_PANE, .tflag = CMD_WINDOW_INDEX, @@ -53,8 +53,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item) struct session *dst_s = item->state.tflag.s; struct window_pane *wp = item->state.sflag.wp; struct window *w = wl->window; - char *name; - char *cause; + char *name, *cause; int idx = item->state.tflag.idx; struct format_tree *ft; const char *template; @@ -78,9 +77,16 @@ cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item) w = wp->window = window_create(dst_s->sx, dst_s->sy); TAILQ_INSERT_HEAD(&w->panes, wp, entry); w->active = wp; - name = default_window_name(w); - window_set_name(w, name); - free(name); + + if (!args_has(args, 'n')) { + name = default_window_name(w); + window_set_name(w, name); + free(name); + } else { + window_set_name(w, args_get(args, 'n')); + options_set_number(w->options, "automatic-rename", 0); + } + layout_init(w, wp); wp->flags |= PANE_CHANGED; diff --git a/usr.bin/tmux/cmd-source-file.c b/usr.bin/tmux/cmd-source-file.c index 8863610df02..d24f7b68a30 100644 --- a/usr.bin/tmux/cmd-source-file.c +++ b/usr.bin/tmux/cmd-source-file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-source-file.c,v 1.32 2017/01/09 19:29:12 nicm Exp $ */ +/* $OpenBSD: cmd-source-file.c,v 1.33 2017/01/29 22:10:55 nicm Exp $ */ /* * Copyright (c) 2008 Tiago Cunha <me@tiagocunha.org> @@ -53,7 +53,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item) struct cmdq_item *new_item; enum cmd_retval retval; glob_t g; - int i; + u_int i; quiet = args_has(args, 'q'); if (glob(args->argv[0], 0, NULL, &g) != 0) { @@ -64,7 +64,7 @@ cmd_source_file_exec(struct cmd *self, struct cmdq_item *item) } retval = CMD_RETURN_NORMAL; - for (i = 0; i < g.gl_pathc; i++) { + for (i = 0; i < (u_int)g.gl_pathc; i++) { if (load_cfg(g.gl_pathv[i], c, item, quiet) != 0) retval = CMD_RETURN_ERROR; } diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 8daef3bcfb3..26830ba8d89 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.531 2017/01/25 14:24:54 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.532 2017/01/29 22:10:55 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: January 25 2017 $ +.Dd $Mdocdate: January 29 2017 $ .Dt TMUX 1 .Os .Sh NAME @@ -1258,6 +1258,7 @@ Commands related to windows and panes are as follows: .It Xo Ic break-pane .Op Fl dP .Op Fl F Ar format +.Op Fl n Ar window-name .Op Fl s Ar src-pane .Op Fl t Ar dst-window .Xc |