mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 01:18:52 +00:00
Sync OpenBSD patchset 1049:
Add -P/-F flags to break-pane too, from George Nachman.
This commit is contained in:
parent
4d1c513968
commit
3893cc17a4
@ -30,8 +30,8 @@ int cmd_break_pane_exec(struct cmd *, struct cmd_ctx *);
|
|||||||
|
|
||||||
const struct cmd_entry cmd_break_pane_entry = {
|
const struct cmd_entry cmd_break_pane_entry = {
|
||||||
"break-pane", "breakp",
|
"break-pane", "breakp",
|
||||||
"dt:", 0, 0,
|
"dPF:t:", 0, 0,
|
||||||
"[-d] " CMD_TARGET_PANE_USAGE,
|
"[-dP] [-F format] " CMD_TARGET_PANE_USAGE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
@ -49,6 +49,10 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
char *name;
|
char *name;
|
||||||
char *cause;
|
char *cause;
|
||||||
int base_idx;
|
int base_idx;
|
||||||
|
struct client *c;
|
||||||
|
struct format_tree *ft;
|
||||||
|
const char *template;
|
||||||
|
char *cp;
|
||||||
|
|
||||||
if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL)
|
if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -88,5 +92,22 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
server_redraw_session(s);
|
server_redraw_session(s);
|
||||||
server_status_session_group(s);
|
server_status_session_group(s);
|
||||||
|
|
||||||
|
if (args_has(args, 'P')) {
|
||||||
|
template = "#{session_name}:#{window_index}";
|
||||||
|
if (args_has(args, 'F'))
|
||||||
|
template = args_get(args, 'F');
|
||||||
|
ft = format_create();
|
||||||
|
if ((c = cmd_find_client(ctx, NULL)) != NULL)
|
||||||
|
format_client(ft, c);
|
||||||
|
format_session(ft, s);
|
||||||
|
format_winlink(ft, s, wl);
|
||||||
|
format_window_pane(ft, wp);
|
||||||
|
|
||||||
|
cp = format_expand(ft, template);
|
||||||
|
ctx->print(ctx, "%s", cp);
|
||||||
|
xfree(cp);
|
||||||
|
|
||||||
|
format_free(ft);
|
||||||
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
10
tmux.1
10
tmux.1
@ -1000,7 +1000,8 @@ from which the layout was originally defined.
|
|||||||
Commands related to windows and panes are as follows:
|
Commands related to windows and panes are as follows:
|
||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
.It Xo Ic break-pane
|
.It Xo Ic break-pane
|
||||||
.Op Fl d
|
.Op Fl dP
|
||||||
|
.Op Fl F Ar format
|
||||||
.Op Fl t Ar target-pane
|
.Op Fl t Ar target-pane
|
||||||
.Xc
|
.Xc
|
||||||
.D1 (alias: Ic breakp )
|
.D1 (alias: Ic breakp )
|
||||||
@ -1010,6 +1011,13 @@ off from its containing window to make it the only pane in a new window.
|
|||||||
If
|
If
|
||||||
.Fl d
|
.Fl d
|
||||||
is given, the new window does not become the current window.
|
is given, the new window does not become the current window.
|
||||||
|
The
|
||||||
|
.Fl P
|
||||||
|
option prints information about the new window after it has been created.
|
||||||
|
By default, it uses the format
|
||||||
|
.Ql #{session_name}:#{window_index}
|
||||||
|
but a different format may be specified with
|
||||||
|
.Fl F .
|
||||||
.It Xo Ic capture-pane
|
.It Xo Ic capture-pane
|
||||||
.Op Fl b Ar buffer-index
|
.Op Fl b Ar buffer-index
|
||||||
.Op Fl E Ar end-line
|
.Op Fl E Ar end-line
|
||||||
|
Loading…
Reference in New Issue
Block a user