mirror of
https://github.com/tmux/tmux.git
synced 2025-12-25 02:16:15 +00:00
Merge branch 'obsd-master'
This commit is contained in:
15
cmd-find.c
15
cmd-find.c
@@ -924,6 +924,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
|
||||
const char *target, enum cmd_find_type type, int flags)
|
||||
{
|
||||
struct mouse_event *m;
|
||||
struct client *c;
|
||||
struct cmd_find_state current;
|
||||
char *colon, *period, *copy = NULL, tmp[256];
|
||||
const char *session, *window, *pane, *s;
|
||||
@@ -990,6 +991,20 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
|
||||
if (target == NULL || *target == '\0')
|
||||
goto current;
|
||||
|
||||
if (strcmp(target, "@") == 0 ||
|
||||
strcmp(target, "{active}") == 0 ||
|
||||
strcmp(target, "{current}") == 0) {
|
||||
c = cmdq_get_client(item);
|
||||
if (c == NULL) {
|
||||
cmdq_error(item, "no current client");
|
||||
goto error;
|
||||
}
|
||||
fs->wl = c->session->curw;
|
||||
fs->wp = c->session->curw->window->active;
|
||||
fs->w = c->session->curw->window;
|
||||
goto found;
|
||||
}
|
||||
|
||||
/* Mouse target is a plain = or {mouse}. */
|
||||
if (strcmp(target, "=") == 0 || strcmp(target, "{mouse}") == 0) {
|
||||
m = &cmdq_get_event(item)->m;
|
||||
|
||||
@@ -439,6 +439,7 @@ key_bindings_init(void)
|
||||
|
||||
/* Mouse button 1 down on pane. */
|
||||
"bind -n MouseDown1Pane { select-pane -t=; send -M }",
|
||||
"bind -n C-MouseDown1Pane { swap-pane -s@ }",
|
||||
|
||||
/* Mouse button 1 drag on pane. */
|
||||
"bind -n MouseDrag1Pane { if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -M } }",
|
||||
@@ -460,6 +461,7 @@ key_bindings_init(void)
|
||||
|
||||
/* Mouse button 1 down on status line. */
|
||||
"bind -n MouseDown1Status { switch-client -t= }",
|
||||
"bind -n C-MouseDown1Status { swap-window -t@ }",
|
||||
|
||||
/* Mouse wheel down on status line. */
|
||||
"bind -n WheelDownStatus { next-window }",
|
||||
|
||||
@@ -970,6 +970,15 @@ const struct options_table_entry options_table[] = {
|
||||
.text = "Style of the cursor when in the command prompt."
|
||||
},
|
||||
|
||||
{ .name = "prompt-command-cursor-style",
|
||||
.type = OPTIONS_TABLE_CHOICE,
|
||||
.scope = OPTIONS_TABLE_SESSION,
|
||||
.choices = options_table_cursor_style_list,
|
||||
.default_num = 0,
|
||||
.text = "Style of the cursor in the command prompt when in command "
|
||||
"mode, if 'status-keys' is set to 'vi'."
|
||||
},
|
||||
|
||||
{ .name = "session-status-current-style",
|
||||
.type = OPTIONS_TABLE_STRING,
|
||||
.scope = OPTIONS_TABLE_WINDOW,
|
||||
|
||||
10
status.c
10
status.c
@@ -804,7 +804,10 @@ status_prompt_redraw(struct client *c)
|
||||
|
||||
n = options_get_number(s->options, "prompt-cursor-colour");
|
||||
sl->active->default_ccolour = n;
|
||||
n = options_get_number(s->options, "prompt-cursor-style");
|
||||
if (c->prompt_mode == PROMPT_COMMAND)
|
||||
n = options_get_number(s->options, "prompt-command-cursor-style");
|
||||
else
|
||||
n = options_get_number(s->options, "prompt-cursor-style");
|
||||
screen_set_cursor_style(n, &sl->active->default_cstyle,
|
||||
&sl->active->default_mode);
|
||||
|
||||
@@ -936,6 +939,8 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
|
||||
return (1);
|
||||
case '\033': /* Escape */
|
||||
c->prompt_mode = PROMPT_COMMAND;
|
||||
if (c->prompt_index != 0)
|
||||
c->prompt_index--;
|
||||
c->flags |= CLIENT_REDRAWSTATUS;
|
||||
return (0);
|
||||
}
|
||||
@@ -961,10 +966,11 @@ status_prompt_translate_key(struct client *c, key_code key, key_code *new_key)
|
||||
*new_key = 'u'|KEYC_CTRL;
|
||||
return (1);
|
||||
case 'i':
|
||||
case '\033': /* Escape */
|
||||
c->prompt_mode = PROMPT_ENTRY;
|
||||
c->flags |= CLIENT_REDRAWSTATUS;
|
||||
return (0);
|
||||
case '\033': /* Escape */
|
||||
return (0);
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
|
||||
8
tmux.1
8
tmux.1
@@ -841,6 +841,7 @@ Each has a single-character alternative form.
|
||||
.It Li "{last}" Ta "!" Ta "The last (previously current) window"
|
||||
.It Li "{next}" Ta "+" Ta "The next window by number"
|
||||
.It Li "{previous}" Ta "-" Ta "The previous window by number"
|
||||
.It Li "{current}" Ta "@" Ta "The current window"
|
||||
.El
|
||||
.Pp
|
||||
.Ar target-pane
|
||||
@@ -873,6 +874,7 @@ The following special tokens are available for the pane index:
|
||||
.It Li "{down-of}" Ta "" Ta "The pane below the active pane"
|
||||
.It Li "{left-of}" Ta "" Ta "The pane to the left of the active pane"
|
||||
.It Li "{right-of}" Ta "" Ta "The pane to the right of the active pane"
|
||||
.It Li "{active}" Ta "@" Ta "The active pane"
|
||||
.El
|
||||
.Pp
|
||||
The tokens
|
||||
@@ -4696,6 +4698,12 @@ Set the style of the cursor in the command prompt.
|
||||
See the
|
||||
.Ic cursor-style
|
||||
options for available styles.
|
||||
.It Ic prompt-command-cursor-style Ar style
|
||||
Set the style of the cursor in the command prompt when vi keys are enabled and
|
||||
the prompt is in command mode.
|
||||
See the
|
||||
.Ic cursor-style
|
||||
options for available styles.
|
||||
.It Xo Ic renumber-windows
|
||||
.Op Ic on | off
|
||||
.Xc
|
||||
|
||||
Reference in New Issue
Block a user