mirror of
https://github.com/tmux/tmux.git
synced 2024-11-05 10:28:48 +00:00
Merge branch 'master' of github.com:tmux/tmux
This commit is contained in:
commit
9b9a5a292d
@ -98,7 +98,6 @@ cmd_attach_session(struct cmdq_item *item, int dflag, int rflag,
|
||||
environ_update(s->options, c->environ, s->environ);
|
||||
|
||||
c->session = s;
|
||||
server_client_set_key_table(c, NULL);
|
||||
status_timer_start(c);
|
||||
notify_client("client-session-changed", c);
|
||||
session_update_activity(s, NULL);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -277,7 +277,6 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
|
||||
} else if (c->session != NULL)
|
||||
c->last_session = c->session;
|
||||
c->session = s;
|
||||
server_client_set_key_table(c, NULL);
|
||||
status_timer_start(c);
|
||||
notify_client("client-session-changed", c);
|
||||
session_update_activity(s, NULL);
|
||||
|
@ -109,7 +109,7 @@ cmd_show_options_print(struct cmd *self, struct cmdq_item *item,
|
||||
name = options_name(o);
|
||||
}
|
||||
|
||||
value = options_tostring(o, idx);
|
||||
value = options_tostring(o, idx, 0);
|
||||
if (args_has(self->args, 'v'))
|
||||
cmdq_print(item, "%s", value);
|
||||
else if (options_isstring(o)) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -108,7 +108,6 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
|
||||
if (c->session != NULL && c->session != s)
|
||||
c->last_session = c->session;
|
||||
c->session = s;
|
||||
server_client_set_key_table(c, NULL);
|
||||
status_timer_start(c);
|
||||
session_update_activity(s, NULL);
|
||||
gettimeofday(&s->last_attached_time, NULL);
|
||||
|
2
format.c
2
format.c
@ -658,7 +658,7 @@ format_find(struct format_tree *ft, const char *key, int modifiers)
|
||||
if (o == NULL)
|
||||
o = options_parse_get(global_s_options, key, &idx, 0);
|
||||
if (o != NULL) {
|
||||
found = options_tostring(o, idx);
|
||||
found = options_tostring(o, idx, 1);
|
||||
goto found;
|
||||
}
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ options_isstring(struct options_entry *o)
|
||||
}
|
||||
|
||||
const char *
|
||||
options_tostring(struct options_entry *o, int idx)
|
||||
options_tostring(struct options_entry *o, int idx, int numeric)
|
||||
{
|
||||
static char s[1024];
|
||||
const char *tmp;
|
||||
@ -355,7 +355,10 @@ options_tostring(struct options_entry *o, int idx)
|
||||
tmp = attributes_tostring(o->number);
|
||||
break;
|
||||
case OPTIONS_TABLE_FLAG:
|
||||
tmp = (o->number ? "on" : "off");
|
||||
if (numeric)
|
||||
xsnprintf(s, sizeof s, "%lld", o->number);
|
||||
else
|
||||
tmp = (o->number ? "on" : "off");
|
||||
break;
|
||||
case OPTIONS_TABLE_CHOICE:
|
||||
tmp = o->tableentry->choices[o->number];
|
||||
|
1
tmux.1
1
tmux.1
@ -1262,6 +1262,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
|
||||
|
2
tmux.h
2
tmux.h
@ -1564,7 +1564,7 @@ int options_array_set(struct options_entry *, u_int, const char *,
|
||||
int options_array_size(struct options_entry *, u_int *);
|
||||
void options_array_assign(struct options_entry *, const char *);
|
||||
int options_isstring(struct options_entry *);
|
||||
const char *options_tostring(struct options_entry *, int);
|
||||
const char *options_tostring(struct options_entry *, int, int);
|
||||
char *options_parse(const char *, int *);
|
||||
struct options_entry *options_parse_get(struct options *, const char *, int *,
|
||||
int);
|
||||
|
Loading…
Reference in New Issue
Block a user