mirror of
https://github.com/tmux/tmux.git
synced 2026-06-22 11:47:00 +00:00
Add -T title to new-pane and split-window commands.
This commit is contained in:
@@ -38,11 +38,11 @@ const struct cmd_entry cmd_new_pane_entry = {
|
|||||||
.name = "new-pane",
|
.name = "new-pane",
|
||||||
.alias = "newp",
|
.alias = "newp",
|
||||||
|
|
||||||
.args = { "bc:de:EfF:hIkl:Lm:p:PR:s:S:t:vx:X:y:Y:Z", 0, -1, NULL },
|
.args = { "bc:de:EfF:hIkl:Lm:p:PR:s:S:t:T:vx:X:y:Y:Z", 0, -1, NULL },
|
||||||
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
||||||
"[-F format] [-l size] [-m message] [-p percentage] "
|
"[-F format] [-l size] [-m message] [-p percentage] "
|
||||||
"[-s style] [-S active-border-style] "
|
"[-s style] [-S active-border-style] "
|
||||||
"[-R inactive-border-style] [-x width] [-y height] "
|
"[-R inactive-border-style] [-T title] [-x width] [-y height] "
|
||||||
"[-X x-position] [-Y y-position] " CMD_TARGET_PANE_USAGE " "
|
"[-X x-position] [-Y y-position] " CMD_TARGET_PANE_USAGE " "
|
||||||
"[shell-command [argument ...]]",
|
"[shell-command [argument ...]]",
|
||||||
|
|
||||||
@@ -56,11 +56,11 @@ const struct cmd_entry cmd_split_window_entry = {
|
|||||||
.name = "split-window",
|
.name = "split-window",
|
||||||
.alias = "splitw",
|
.alias = "splitw",
|
||||||
|
|
||||||
.args = { "bc:de:EfF:hIkl:m:p:PR:s:S:t:vZ", 0, -1, NULL },
|
.args = { "bc:de:EfF:hIkl:m:p:PR:s:S:t:T:vZ", 0, -1, NULL },
|
||||||
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
||||||
"[-F format] [-l size] [-m message] [-p percentage] "
|
"[-F format] [-l size] [-m message] [-p percentage] "
|
||||||
"[-s style] [-S active-border-style] "
|
"[-s style] [-S active-border-style] "
|
||||||
"[-R inactive-border-style] " CMD_TARGET_PANE_USAGE " "
|
"[-R inactive-border-style] [-T title] " CMD_TARGET_PANE_USAGE " "
|
||||||
"[shell-command [argument ...]]",
|
"[shell-command [argument ...]]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
@@ -85,7 +85,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
struct cmd_find_state fs;
|
struct cmd_find_state fs;
|
||||||
int input, empty, is_floating, flags = 0;
|
int input, empty, is_floating, flags = 0;
|
||||||
const char *template, *style;
|
const char *template, *style;
|
||||||
char *cause = NULL, *cp;
|
char *cause = NULL, *cp, *title;
|
||||||
struct args_value *av;
|
struct args_value *av;
|
||||||
u_int count = args_count(args);
|
u_int count = args_count(args);
|
||||||
|
|
||||||
@@ -194,6 +194,12 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
"remain-on-exit-format",
|
"remain-on-exit-format",
|
||||||
0, "%s", args_get(args, 'm'));
|
0, "%s", args_get(args, 'm'));
|
||||||
}
|
}
|
||||||
|
if (args_has(args, 'T')) {
|
||||||
|
title = format_single_from_target(item, args_get(args, 'T'));
|
||||||
|
screen_set_title(&new_wp->base, title);
|
||||||
|
notify_pane("pane-title-changed", new_wp);
|
||||||
|
free(title);
|
||||||
|
}
|
||||||
|
|
||||||
if (input) {
|
if (input) {
|
||||||
switch (window_pane_start_input(new_wp, item, &cause)) {
|
switch (window_pane_start_input(new_wp, item, &cause)) {
|
||||||
|
|||||||
4
tmux.1
4
tmux.1
@@ -3341,6 +3341,7 @@ but a different format may be specified with
|
|||||||
.Op Fl s Ar style
|
.Op Fl s Ar style
|
||||||
.Op Fl S Ar active\-border\-style
|
.Op Fl S Ar active\-border\-style
|
||||||
.Op Fl t Ar target\-pane
|
.Op Fl t Ar target\-pane
|
||||||
|
.Op Fl T Ar title
|
||||||
.Op Ar shell\-command Op Ar argument ...
|
.Op Ar shell\-command Op Ar argument ...
|
||||||
.Xc
|
.Xc
|
||||||
.D1 Pq alias: Ic newp
|
.D1 Pq alias: Ic newp
|
||||||
@@ -3359,6 +3360,8 @@ sets the border style when the pane is active and
|
|||||||
.Fl R
|
.Fl R
|
||||||
sets the border style when the pane is inactive (see
|
sets the border style when the pane is inactive (see
|
||||||
.Sx STYLES ) .
|
.Sx STYLES ) .
|
||||||
|
.Fl T
|
||||||
|
sets the pane title.
|
||||||
.Pp
|
.Pp
|
||||||
.Fl h
|
.Fl h
|
||||||
does a horizontal split and
|
does a horizontal split and
|
||||||
@@ -3756,6 +3759,7 @@ the command behaves like
|
|||||||
.Op Fl s Ar style
|
.Op Fl s Ar style
|
||||||
.Op Fl S Ar active\-border\-style
|
.Op Fl S Ar active\-border\-style
|
||||||
.Op Fl t Ar target\-pane
|
.Op Fl t Ar target\-pane
|
||||||
|
.Op Fl T Ar title
|
||||||
.Op Ar shell\-command Op Ar argument ...
|
.Op Ar shell\-command Op Ar argument ...
|
||||||
.Xc
|
.Xc
|
||||||
.D1 Pq alias: Ic splitw
|
.D1 Pq alias: Ic splitw
|
||||||
|
|||||||
Reference in New Issue
Block a user