Merge branch 'obsd-master' into master

pull/3012/head
Thomas Adam 2021-12-07 09:52:59 +00:00
commit 138ffc7cb6
11 changed files with 142 additions and 106 deletions

25
input.c
View File

@ -2382,6 +2382,7 @@ static void
input_exit_rename(struct input_ctx *ictx) input_exit_rename(struct input_ctx *ictx)
{ {
struct window_pane *wp = ictx->wp; struct window_pane *wp = ictx->wp;
struct window *w;
struct options_entry *o; struct options_entry *o;
if (wp == NULL) if (wp == NULL)
@ -2394,17 +2395,20 @@ input_exit_rename(struct input_ctx *ictx)
if (!utf8_isvalid(ictx->input_buf)) if (!utf8_isvalid(ictx->input_buf))
return; return;
w = wp->window;
if (ictx->input_len == 0) { if (ictx->input_len == 0) {
o = options_get_only(wp->window->options, "automatic-rename"); o = options_get_only(w->options, "automatic-rename");
if (o != NULL) if (o != NULL)
options_remove_or_default(o, -1, NULL); options_remove_or_default(o, -1, NULL);
return; if (!options_get_number(w->options, "automatic-rename"))
window_set_name(w, "");
} else {
options_set_number(w->options, "automatic-rename", 0);
window_set_name(w, ictx->input_buf);
} }
window_set_name(wp->window, ictx->input_buf); server_redraw_window_borders(w);
options_set_number(wp->window->options, "automatic-rename", 0); server_status_window(w);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
} }
/* Open UTF-8 character. */ /* Open UTF-8 character. */
@ -2501,7 +2505,8 @@ input_osc_colour_reply(struct input_ctx *ictx, u_int n, int c)
end = "\007"; end = "\007";
else else
end = "\033\\"; end = "\033\\";
input_reply(ictx, "\033]%u;rgb:%02hhx/%02hhx/%02hhx%s", n, r, g, b, end); input_reply(ictx, "\033]%u;rgb:%02hhx%02hhx/%02hhx%02hhx/%02hhx%02hhx%s",
n, r, r, g, g, b, b, end);
} }
/* Handle the OSC 4 sequence for setting (multiple) palette entries. */ /* Handle the OSC 4 sequence for setting (multiple) palette entries. */
@ -2525,6 +2530,12 @@ input_osc_4(struct input_ctx *ictx, const char *p)
} }
s = strsep(&next, ";"); s = strsep(&next, ";");
if (strcmp(s, "?") == 0) {
c = colour_palette_get(ictx->palette, idx);
if (c != -1)
input_osc_colour_reply(ictx, 4, c);
continue;
}
if ((c = input_osc_parse_colour(s)) == -1) { if ((c = input_osc_parse_colour(s)) == -1) {
s = next; s = next;
continue; continue;

26
menu.c
View File

@ -89,22 +89,26 @@ menu_add_item(struct menu *menu, const struct menu_item *item,
keylen = strlen(key) + 3; /* 3 = space and two brackets */ keylen = strlen(key) + 3; /* 3 = space and two brackets */
/* /*
* Only add the key if there is space for the entire item text * Add the key if it is shorter than a quarter of the available
* and the key. * space or there is space for the entire item text and the
* key.
*/ */
if (keylen >= max_width || slen >= max_width - keylen) if (keylen <= max_width / 4)
max_width -= keylen;
else if (keylen >= max_width || slen >= max_width - keylen)
key = NULL; key = NULL;
} }
if (key != NULL) if (slen > max_width) {
xasprintf(&name, "%s#[default] #[align=right](%s)", s, key); max_width--;
else { suffix = ">";
if (slen > max_width) {
max_width--;
suffix = ">";
}
xasprintf(&name, "%.*s%s", (int)max_width, s, suffix);
} }
if (key != NULL)
xasprintf(&name, "%.*s%s#[default] #[align=right](%s)",
(int)max_width, s, suffix, key);
else
xasprintf(&name, "%.*s%s", (int)max_width, s, suffix);
new_item->name = name; new_item->name = name;
free(s); free(s);

View File

@ -736,10 +736,8 @@ mode_tree_draw(struct mode_tree_data *mtd)
} }
sy = screen_size_y(s); sy = screen_size_y(s);
if (!mtd->preview || sy <= 4 || h <= 4 || sy - h <= 4 || w <= 4) { if (!mtd->preview || sy <= 4 || h <= 4 || sy - h <= 4 || w <= 4)
screen_write_stop(&ctx); goto done;
return;
}
line = &mtd->line_list[mtd->current]; line = &mtd->line_list[mtd->current];
mti = line->item; mti = line->item;
@ -783,6 +781,8 @@ mode_tree_draw(struct mode_tree_data *mtd)
mtd->drawcb(mtd->modedata, mti->itemdata, &ctx, box_x, box_y); mtd->drawcb(mtd->modedata, mti->itemdata, &ctx, box_x, box_y);
} }
done:
screen_write_cursormove(&ctx, 0, mtd->current - mtd->offset, 0);
screen_write_stop(&ctx); screen_write_stop(&ctx);
} }
@ -1055,7 +1055,6 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
case '\016': /* C-n */ case '\016': /* C-n */
mode_tree_down(mtd, 1); mode_tree_down(mtd, 1);
break; break;
case 'g':
case KEYC_PPAGE: case KEYC_PPAGE:
case '\002': /* C-b */ case '\002': /* C-b */
for (i = 0; i < mtd->height; i++) { for (i = 0; i < mtd->height; i++) {
@ -1064,7 +1063,6 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
mode_tree_up(mtd, 1); mode_tree_up(mtd, 1);
} }
break; break;
case 'G':
case KEYC_NPAGE: case KEYC_NPAGE:
case '\006': /* C-f */ case '\006': /* C-f */
for (i = 0; i < mtd->height; i++) { for (i = 0; i < mtd->height; i++) {
@ -1073,10 +1071,12 @@ mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key,
mode_tree_down(mtd, 1); mode_tree_down(mtd, 1);
} }
break; break;
case 'g':
case KEYC_HOME: case KEYC_HOME:
mtd->current = 0; mtd->current = 0;
mtd->offset = 0; mtd->offset = 0;
break; break;
case 'G':
case KEYC_END: case KEYC_END:
mtd->current = mtd->line_size - 1; mtd->current = mtd->line_size - 1;
if (mtd->current > mtd->height - 1) if (mtd->current > mtd->height - 1)

View File

@ -18,6 +18,7 @@
#include <sys/param.h> /* MAXCOMLEN */ #include <sys/param.h> /* MAXCOMLEN */
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h>
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -348,6 +348,8 @@ recalculate_size_skip_client(struct client *loop, __unused int type,
* is not the current window - this is used for aggressive-resize. * is not the current window - this is used for aggressive-resize.
* Otherwise skip any session that doesn't contain the window. * Otherwise skip any session that doesn't contain the window.
*/ */
if (loop->session->curw == NULL)
return (1);
if (current) if (current)
return (loop->session->curw->window != w); return (loop->session->curw->window != w);
return (session_has(loop->session, w) == 0); return (session_has(loop->session, w) == 0);

View File

@ -1703,7 +1703,7 @@ server_client_reset_state(struct client *c)
struct window_pane *wp = server_client_get_pane(c), *loop; struct window_pane *wp = server_client_get_pane(c), *loop;
struct screen *s = NULL; struct screen *s = NULL;
struct options *oo = c->session->options; struct options *oo = c->session->options;
int mode = 0, cursor, flags; int mode = 0, cursor, flags, n;
u_int cx = 0, cy = 0, ox, oy, sx, sy; u_int cx = 0, cy = 0, ox, oy, sx, sy;
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED)) if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
@ -1731,7 +1731,20 @@ server_client_reset_state(struct client *c)
tty_margin_off(tty); tty_margin_off(tty);
/* Move cursor to pane cursor and offset. */ /* Move cursor to pane cursor and offset. */
if (c->overlay_draw == NULL) { if (c->prompt_string != NULL) {
n = options_get_number(c->session->options, "status-position");
if (n == 0)
cy = 0;
else {
n = status_line_size(c);
if (n == 0)
cy = tty->sy - 1;
else
cy = tty->sy - n;
}
cx = c->prompt_cursor;
mode &= ~MODE_CURSOR;
} else if (c->overlay_draw == NULL) {
cursor = 0; cursor = 0;
tty_window_offset(tty, &ox, &oy, &sx, &sy); tty_window_offset(tty, &ox, &oy, &sx, &sy);
if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx && if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx &&

View File

@ -748,6 +748,7 @@ status_prompt_redraw(struct client *c)
offset = 0; offset = 0;
if (pwidth > left) if (pwidth > left)
pwidth = left; pwidth = left;
c->prompt_cursor = start + c->prompt_index - offset;
width = 0; width = 0;
for (i = 0; c->prompt_buffer[i].size != 0; i++) { for (i = 0; c->prompt_buffer[i].size != 0; i++) {

153
tmux.1
View File

@ -1034,7 +1034,7 @@ The following commands are available to manage clients and sessions:
.Op Fl f Ar flags .Op Fl f Ar flags
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Xc .Xc
.D1 (alias: Ic attach ) .D1 Pq alias: Ic attach
If run from outside If run from outside
.Nm , .Nm ,
create a new client in the current terminal and attach it to create a new client in the current terminal and attach it to
@ -1121,7 +1121,7 @@ option will not be applied.
.Op Fl s Ar target-session .Op Fl s Ar target-session
.Op Fl t Ar target-client .Op Fl t Ar target-client
.Xc .Xc
.D1 (alias: Ic detach ) .D1 Pq alias: Ic detach
Detach the current client if bound to a key, the client specified with Detach the current client if bound to a key, the client specified with
.Fl t , .Fl t ,
or all clients currently attached to the session specified by or all clients currently attached to the session specified by
@ -1143,7 +1143,7 @@ run
to replace the client. to replace the client.
.Tg has .Tg has
.It Ic has-session Op Fl t Ar target-session .It Ic has-session Op Fl t Ar target-session
.D1 (alias: Ic has ) .D1 Pq alias: Ic has
Report an error and exit with 1 if the specified session does not exist. Report an error and exit with 1 if the specified session does not exist.
If it does exist, exit with 0. If it does exist, exit with 0.
.It Ic kill-server .It Ic kill-server
@ -1168,7 +1168,7 @@ session.
.Op Fl F Ar format .Op Fl F Ar format
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Xc .Xc
.D1 (alias: Ic lsc ) .D1 Pq alias: Ic lsc
List all clients attached to the server. List all clients attached to the server.
For the meaning of the For the meaning of the
.Fl F .Fl F
@ -1183,7 +1183,7 @@ is specified, list only clients connected to that session.
.Op Fl F Ar format .Op Fl F Ar format
.Op Ar command .Op Ar command
.Xc .Xc
.D1 (alias: Ic lscm ) .D1 Pq alias: Ic lscm
List the syntax of List the syntax of
.Ar command .Ar command
or - if omitted - of all commands supported by or - if omitted - of all commands supported by
@ -1193,7 +1193,7 @@ or - if omitted - of all commands supported by
.Op Fl F Ar format .Op Fl F Ar format
.Op Fl f Ar filter .Op Fl f Ar filter
.Xc .Xc
.D1 (alias: Ic ls ) .D1 Pq alias: Ic ls
List all sessions managed by the server. List all sessions managed by the server.
.Fl F .Fl F
specifies the format of each line and specifies the format of each line and
@ -1205,7 +1205,7 @@ See the
section. section.
.Tg lockc .Tg lockc
.It Ic lock-client Op Fl t Ar target-client .It Ic lock-client Op Fl t Ar target-client
.D1 (alias: Ic lockc ) .D1 Pq alias: Ic lockc
Lock Lock
.Ar target-client , .Ar target-client ,
see the see the
@ -1213,7 +1213,7 @@ see the
command. command.
.Tg locks .Tg locks
.It Ic lock-session Op Fl t Ar target-session .It Ic lock-session Op Fl t Ar target-session
.D1 (alias: Ic locks ) .D1 Pq alias: Ic locks
Lock all clients attached to Lock all clients attached to
.Ar target-session . .Ar target-session .
.Tg new .Tg new
@ -1230,7 +1230,7 @@ Lock all clients attached to
.Op Fl y Ar height .Op Fl y Ar height
.Op Ar shell-command .Op Ar shell-command
.Xc .Xc
.D1 (alias: Ic new ) .D1 Pq alias: Ic new
Create a new session with name Create a new session with name
.Ar session-name . .Ar session-name .
.Pp .Pp
@ -1346,7 +1346,7 @@ specified multiple times.
.Op Fl t Ar target-client .Op Fl t Ar target-client
.Op Ar adjustment .Op Ar adjustment
.Xc .Xc
.D1 (alias: Ic refresh ) .D1 Pq alias: Ic refresh
Refresh the current client if bound to a key, or a single client if one is given Refresh the current client if bound to a key, or a single client if one is given
with with
.Fl t . .Fl t .
@ -1477,7 +1477,7 @@ option.
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Ar new-name .Ar new-name
.Xc .Xc
.D1 (alias: Ic rename ) .D1 Pq alias: Ic rename
Rename the session to Rename the session to
.Ar new-name . .Ar new-name .
.Tg showmsgs .Tg showmsgs
@ -1485,7 +1485,7 @@ Rename the session to
.Op Fl JT .Op Fl JT
.Op Fl t Ar target-client .Op Fl t Ar target-client
.Xc .Xc
.D1 (alias: Ic showmsgs ) .D1 Pq alias: Ic showmsgs
Show server messages or information. Show server messages or information.
Messages are stored, up to a maximum of the limit set by the Messages are stored, up to a maximum of the limit set by the
.Ar message-limit .Ar message-limit
@ -1500,7 +1500,7 @@ show debugging information about jobs and terminals.
.Ar path .Ar path
.Ar ... .Ar ...
.Xc .Xc
.D1 (alias: Ic source ) .D1 Pq alias: Ic source
Execute commands from one or more files specified by Execute commands from one or more files specified by
.Ar path .Ar path
(which may be (which may be
@ -1523,7 +1523,7 @@ the file is parsed but no commands are executed.
shows the parsed commands and line numbers if possible. shows the parsed commands and line numbers if possible.
.Tg start .Tg start
.It Ic start-server .It Ic start-server
.D1 (alias: Ic start ) .D1 Pq alias: Ic start
Start the Start the
.Nm .Nm
server, if not already running, without creating any sessions. server, if not already running, without creating any sessions.
@ -1542,7 +1542,7 @@ $ tmux start \\; show -g
.It Xo Ic suspend-client .It Xo Ic suspend-client
.Op Fl t Ar target-client .Op Fl t Ar target-client
.Xc .Xc
.D1 (alias: Ic suspendc ) .D1 Pq alias: Ic suspendc
Suspend a client by sending Suspend a client by sending
.Dv SIGTSTP .Dv SIGTSTP
(tty stop). (tty stop).
@ -1553,7 +1553,7 @@ Suspend a client by sending
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Op Fl T Ar key-table .Op Fl T Ar key-table
.Xc .Xc
.D1 (alias: Ic switchc ) .D1 Pq alias: Ic switchc
Switch the current session for client Switch the current session for client
.Ar target-client .Ar target-client
to to
@ -1945,7 +1945,7 @@ Commands related to windows and panes are as follows:
.Op Fl s Ar src-pane .Op Fl s Ar src-pane
.Op Fl t Ar dst-window .Op Fl t Ar dst-window
.Xc .Xc
.D1 (alias: Ic breakp ) .D1 Pq alias: Ic breakp
Break Break
.Ar src-pane .Ar src-pane
off from its containing window to make it the only pane in off from its containing window to make it the only pane in
@ -1974,7 +1974,7 @@ but a different format may be specified with
.Op Fl S Ar start-line .Op Fl S Ar start-line
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Xc .Xc
.D1 (alias: Ic capturep ) .D1 Pq alias: Ic capturep
Capture the contents of a pane. Capture the contents of a pane.
If If
.Fl p .Fl p
@ -2226,7 +2226,7 @@ This command works only if at least one client is attached.
.Op Fl t Ar target-client .Op Fl t Ar target-client
.Op Ar template .Op Ar template
.Xc .Xc
.D1 (alias: Ic displayp ) .D1 Pq alias: Ic displayp
Display a visible indicator of each pane shown by Display a visible indicator of each pane shown by
.Ar target-client . .Ar target-client .
See the See the
@ -2266,7 +2266,7 @@ other commands are not blocked from running until the indicator is closed.
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Ar match-string .Ar match-string
.Xc .Xc
.D1 (alias: Ic findw ) .D1 Pq alias: Ic findw
Search for a Search for a
.Xr fnmatch 3 .Xr fnmatch 3
pattern or, with pattern or, with
@ -2296,7 +2296,7 @@ This command works only if at least one client is attached.
.Op Fl s Ar src-pane .Op Fl s Ar src-pane
.Op Fl t Ar dst-pane .Op Fl t Ar dst-pane
.Xc .Xc
.D1 (alias: Ic joinp ) .D1 Pq alias: Ic joinp
Like Like
.Ic split-window , .Ic split-window ,
but instead of splitting but instead of splitting
@ -2324,7 +2324,7 @@ the marked pane is used rather than the current pane.
.Op Fl a .Op Fl a
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Xc .Xc
.D1 (alias: Ic killp ) .D1 Pq alias: Ic killp
Destroy the given pane. Destroy the given pane.
If no panes remain in the containing window, it is also destroyed. If no panes remain in the containing window, it is also destroyed.
The The
@ -2336,7 +2336,7 @@ option kills all but the pane given with
.Op Fl a .Op Fl a
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Xc .Xc
.D1 (alias: Ic killw ) .D1 Pq alias: Ic killw
Kill the current window or the window at Kill the current window or the window at
.Ar target-window , .Ar target-window ,
removing it from any sessions to which it is linked. removing it from any sessions to which it is linked.
@ -2349,7 +2349,7 @@ option kills all but the window given with
.Op Fl deZ .Op Fl deZ
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Xc .Xc
.D1 (alias: Ic lastp ) .D1 Pq alias: Ic lastp
Select the last (previously selected) pane. Select the last (previously selected) pane.
.Fl Z .Fl Z
keeps the window zoomed if it was zoomed. keeps the window zoomed if it was zoomed.
@ -2359,7 +2359,7 @@ enables or
disables input to the pane. disables input to the pane.
.Tg last .Tg last
.It Ic last-window Op Fl t Ar target-session .It Ic last-window Op Fl t Ar target-session
.D1 (alias: Ic last ) .D1 Pq alias: Ic last
Select the last (previously selected) window. Select the last (previously selected) window.
If no If no
.Ar target-session .Ar target-session
@ -2370,7 +2370,7 @@ is specified, select the last window of the current session.
.Op Fl s Ar src-window .Op Fl s Ar src-window
.Op Fl t Ar dst-window .Op Fl t Ar dst-window
.Xc .Xc
.D1 (alias: Ic linkw ) .D1 Pq alias: Ic linkw
Link the window at Link the window at
.Ar src-window .Ar src-window
to the specified to the specified
@ -2402,7 +2402,7 @@ is given, the newly linked window is not selected.
.Op Fl f Ar filter .Op Fl f Ar filter
.Op Fl t Ar target .Op Fl t Ar target
.Xc .Xc
.D1 (alias: Ic lsp ) .D1 Pq alias: Ic lsp
If If
.Fl a .Fl a
is given, is given,
@ -2431,7 +2431,7 @@ section.
.Op Fl f Ar filter .Op Fl f Ar filter
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Xc .Xc
.D1 (alias: Ic lsw ) .D1 Pq alias: Ic lsw
If If
.Fl a .Fl a
is given, list all windows on the server. is given, list all windows on the server.
@ -2452,7 +2452,7 @@ section.
.Op Fl s Ar src-pane .Op Fl s Ar src-pane
.Op Fl t Ar dst-pane .Op Fl t Ar dst-pane
.Xc .Xc
.D1 (alias: Ic movep ) .D1 Pq alias: Ic movep
Does the same as Does the same as
.Ic join-pane . .Ic join-pane .
.Tg movew .Tg movew
@ -2461,7 +2461,7 @@ Does the same as
.Op Fl s Ar src-window .Op Fl s Ar src-window
.Op Fl t Ar dst-window .Op Fl t Ar dst-window
.Xc .Xc
.D1 (alias: Ic movew ) .D1 Pq alias: Ic movew
This is similar to This is similar to
.Ic link-window , .Ic link-window ,
except the window at except the window at
@ -2484,7 +2484,7 @@ option.
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Op Ar shell-command .Op Ar shell-command
.Xc .Xc
.D1 (alias: Ic neww ) .D1 Pq alias: Ic neww
Create a new window. Create a new window.
With With
.Fl a .Fl a
@ -2559,14 +2559,14 @@ but a different format may be specified with
.Fl F . .Fl F .
.Tg nextl .Tg nextl
.It Ic next-layout Op Fl t Ar target-window .It Ic next-layout Op Fl t Ar target-window
.D1 (alias: Ic nextl ) .D1 Pq alias: Ic nextl
Move a window to the next layout and rearrange the panes to fit. Move a window to the next layout and rearrange the panes to fit.
.Tg next .Tg next
.It Xo Ic next-window .It Xo Ic next-window
.Op Fl a .Op Fl a
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Xc .Xc
.D1 (alias: Ic next ) .D1 Pq alias: Ic next
Move to the next window in the session. Move to the next window in the session.
If If
.Fl a .Fl a
@ -2577,7 +2577,7 @@ is used, move to the next window with an alert.
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Op Ar shell-command .Op Ar shell-command
.Xc .Xc
.D1 (alias: Ic pipep ) .D1 Pq alias: Ic pipep
Pipe output sent by the program in Pipe output sent by the program in
.Ar target-pane .Ar target-pane
to a shell command or vice versa. to a shell command or vice versa.
@ -2624,14 +2624,14 @@ bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P'
.It Xo Ic previous-layout .It Xo Ic previous-layout
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Xc .Xc
.D1 (alias: Ic prevl ) .D1 Pq alias: Ic prevl
Move to the previous layout in the session. Move to the previous layout in the session.
.Tg prev .Tg prev
.It Xo Ic previous-window .It Xo Ic previous-window
.Op Fl a .Op Fl a
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Xc .Xc
.D1 (alias: Ic prev ) .D1 Pq alias: Ic prev
Move to the previous window in the session. Move to the previous window in the session.
With With
.Fl a , .Fl a ,
@ -2641,7 +2641,7 @@ move to the previous window with an alert.
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Ar new-name .Ar new-name
.Xc .Xc
.D1 (alias: Ic renamew ) .D1 Pq alias: Ic renamew
Rename the current window, or the window at Rename the current window, or the window at
.Ar target-window .Ar target-window
if specified, to if specified, to
@ -2654,7 +2654,7 @@ if specified, to
.Op Fl y Ar height .Op Fl y Ar height
.Op Ar adjustment .Op Ar adjustment
.Xc .Xc
.D1 (alias: Ic resizep ) .D1 Pq alias: Ic resizep
Resize a pane, up, down, left or right by Resize a pane, up, down, left or right by
.Ar adjustment .Ar adjustment
with with
@ -2699,7 +2699,7 @@ history to replace them.
.Op Fl y Ar height .Op Fl y Ar height
.Op Ar adjustment .Op Ar adjustment
.Xc .Xc
.D1 (alias: Ic resizew ) .D1 Pq alias: Ic resizew
Resize a window, up, down, left or right by Resize a window, up, down, left or right by
.Ar adjustment .Ar adjustment
with with
@ -2732,7 +2732,7 @@ to manual in the window options.
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Op Ar shell-command .Op Ar shell-command
.Xc .Xc
.D1 (alias: Ic respawnp ) .D1 Pq alias: Ic respawnp
Reactivate a pane in which the command has exited (see the Reactivate a pane in which the command has exited (see the
.Ic remain-on-exit .Ic remain-on-exit
window option). window option).
@ -2758,7 +2758,7 @@ command.
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Op Ar shell-command .Op Ar shell-command
.Xc .Xc
.D1 (alias: Ic respawnw ) .D1 Pq alias: Ic respawnw
Reactivate a window in which the command has exited (see the Reactivate a window in which the command has exited (see the
.Ic remain-on-exit .Ic remain-on-exit
window option). window option).
@ -2781,7 +2781,7 @@ command.
.Op Fl DUZ .Op Fl DUZ
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Xc .Xc
.D1 (alias: Ic rotatew ) .D1 Pq alias: Ic rotatew
Rotate the positions of the panes within a window, either upward (numerically Rotate the positions of the panes within a window, either upward (numerically
lower) with lower) with
.Fl U .Fl U
@ -2794,7 +2794,7 @@ keeps the window zoomed if it was zoomed.
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Op Ar layout-name .Op Ar layout-name
.Xc .Xc
.D1 (alias: Ic selectl ) .D1 Pq alias: Ic selectl
Choose a specific layout for a window. Choose a specific layout for a window.
If If
.Ar layout-name .Ar layout-name
@ -2817,7 +2817,7 @@ spreads the current pane and any panes next to it out evenly.
.Op Fl T Ar title .Op Fl T Ar title
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Xc .Xc
.D1 (alias: Ic selectp ) .D1 Pq alias: Ic selectp
Make pane Make pane
.Ar target-pane .Ar target-pane
the active pane in its window. the active pane in its window.
@ -2861,7 +2861,7 @@ and
.Op Fl lnpT .Op Fl lnpT
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Xc .Xc
.D1 (alias: Ic selectw ) .D1 Pq alias: Ic selectw
Select the window at Select the window at
.Ar target-window . .Ar target-window .
.Fl l , .Fl l ,
@ -2889,7 +2889,7 @@ the command behaves like
.Op Ar shell-command .Op Ar shell-command
.Op Fl F Ar format .Op Fl F Ar format
.Xc .Xc
.D1 (alias: Ic splitw ) .D1 Pq alias: Ic splitw
Create a new pane by splitting Create a new pane by splitting
.Ar target-pane : .Ar target-pane :
.Fl h .Fl h
@ -2946,7 +2946,7 @@ command.
.Op Fl s Ar src-pane .Op Fl s Ar src-pane
.Op Fl t Ar dst-pane .Op Fl t Ar dst-pane
.Xc .Xc
.D1 (alias: Ic swapp ) .D1 Pq alias: Ic swapp
Swap two panes. Swap two panes.
If If
.Fl U .Fl U
@ -2975,7 +2975,7 @@ the marked pane is used rather than the current pane.
.Op Fl s Ar src-window .Op Fl s Ar src-window
.Op Fl t Ar dst-window .Op Fl t Ar dst-window
.Xc .Xc
.D1 (alias: Ic swapw ) .D1 Pq alias: Ic swapw
This is similar to This is similar to
.Ic link-window , .Ic link-window ,
except the source and destination windows are swapped. except the source and destination windows are swapped.
@ -2996,7 +2996,7 @@ the window containing the marked pane is used rather than the current window.
.Op Fl k .Op Fl k
.Op Fl t Ar target-window .Op Fl t Ar target-window
.Xc .Xc
.D1 (alias: Ic unlinkw ) .D1 Pq alias: Ic unlinkw
Unlink Unlink
.Ar target-window . .Ar target-window .
Unless Unless
@ -3069,7 +3069,7 @@ Commands related to key bindings are as follows:
.Op Fl T Ar key-table .Op Fl T Ar key-table
.Ar key command Op Ar arguments .Ar key command Op Ar arguments
.Xc .Xc
.D1 (alias: Ic bind ) .D1 Pq alias: Ic bind
Bind key Bind key
.Ar key .Ar key
to to
@ -3127,7 +3127,7 @@ command.
.Op Fl P Ar prefix-string Fl T Ar key-table .Op Fl P Ar prefix-string Fl T Ar key-table
.Op Ar key .Op Ar key
.Xc .Xc
.D1 (alias: Ic lsk ) .D1 Pq alias: Ic lsk
List key bindings. List key bindings.
There are two forms: the default lists keys as There are two forms: the default lists keys as
.Ic bind-key .Ic bind-key
@ -3164,7 +3164,7 @@ lists the command for keys that do not have a note rather than skipping them.
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Ar key Ar ... .Ar key Ar ...
.Xc .Xc
.D1 (alias: Ic send ) .D1 Pq alias: Ic send
Send a key or keys to a window. Send a key or keys to a window.
Each argument Each argument
.Ar key .Ar key
@ -3215,7 +3215,7 @@ the secondary prefix key, to a window as if it was pressed.
.Op Fl T Ar key-table .Op Fl T Ar key-table
.Ar key .Ar key
.Xc .Xc
.D1 (alias: Ic unbind ) .D1 Pq alias: Ic unbind
Unbind the command bound to Unbind the command bound to
.Ar key . .Ar key .
.Fl n .Fl n
@ -3311,7 +3311,7 @@ Commands which set options are as follows:
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Ar option Ar value .Ar option Ar value
.Xc .Xc
.D1 (alias: Ic set ) .D1 Pq alias: Ic set
Set a pane option with Set a pane option with
.Fl p , .Fl p ,
a window option with a window option with
@ -3386,7 +3386,7 @@ the result would be the default background and a blue foreground.
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Op Ar option .Op Ar option
.Xc .Xc
.D1 (alias: Ic show ) .D1 Pq alias: Ic show
Show the pane options (or a single option if Show the pane options (or a single option if
.Ar option .Ar option
is provided) with is provided) with
@ -4427,7 +4427,8 @@ uses when the colour with that index is requested.
The index may be from zero to 255. The index may be from zero to 255.
.Pp .Pp
.It Ic cursor-style Ar style .It Ic cursor-style Ar style
Set the style of the cursor. Available styles are: Set the style of the cursor.
Available styles are:
.Ic default , .Ic default ,
.Ic blinking-block , .Ic blinking-block ,
.Ic block , .Ic block ,
@ -5425,7 +5426,7 @@ Commands to alter and view the environment are:
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Ar name Op Ar value .Ar name Op Ar value
.Xc .Xc
.D1 (alias: Ic setenv ) .D1 Pq alias: Ic setenv
Set or unset an environment variable. Set or unset an environment variable.
If If
.Fl g .Fl g
@ -5451,7 +5452,7 @@ marks the variable as hidden.
.Op Fl t Ar target-session .Op Fl t Ar target-session
.Op Ar variable .Op Ar variable
.Xc .Xc
.D1 (alias: Ic showenv ) .D1 Pq alias: Ic showenv
Display the environment for Display the environment for
.Ar target-session .Ar target-session
or the global environment with or the global environment with
@ -5534,7 +5535,7 @@ Commands related to the status line are as follows:
.It Xo Ic clear-prompt-history .It Xo Ic clear-prompt-history
.Op Fl T Ar prompt-type .Op Fl T Ar prompt-type
.Xc .Xc
.D1 (alias: Ic clrphist) .D1 Pq alias: Ic clrphist
Clear status prompt history for prompt type Clear status prompt history for prompt type
.Ar prompt-type . .Ar prompt-type .
If If
@ -5660,7 +5661,7 @@ until it is dismissed.
.Op Fl t Ar target-client .Op Fl t Ar target-client
.Ar command .Ar command
.Xc .Xc
.D1 (alias: Ic confirm ) .D1 Pq alias: Ic confirm
Ask for confirmation before executing Ask for confirmation before executing
.Ar command . .Ar command .
If If
@ -5689,7 +5690,7 @@ until it is dismissed.
.Ar command .Ar command
.Ar ... .Ar ...
.Xc .Xc
.D1 (alias: Ic menu ) .D1 Pq alias: Ic menu
Display a menu on Display a menu on
.Ar target-client . .Ar target-client .
.Ar target-pane .Ar target-pane
@ -5776,7 +5777,7 @@ The following keys are also available:
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Op Ar message .Op Ar message
.Xc .Xc
.D1 (alias: Ic display ) .D1 Pq alias: Ic display
Display a message. Display a message.
If If
.Fl p .Fl p
@ -5827,7 +5828,7 @@ forwards any input read from stdin to the empty pane given by
.Op Fl y Ar position .Op Fl y Ar position
.Op Ar shell-command .Op Ar shell-command
.Xc .Xc
.D1 (alias: Ic popup ) .D1 Pq alias: Ic popup
Display a popup running Display a popup running
.Ar shell-command .Ar shell-command
on on
@ -5900,7 +5901,7 @@ flag closes any popup on the client.
.It Xo Ic show-prompt-history .It Xo Ic show-prompt-history
.Op Fl T Ar prompt-type .Op Fl T Ar prompt-type
.Xc .Xc
.D1 (alias: Ic showphist) .D1 Pq alias: Ic showphist
Display status prompt history for prompt type Display status prompt history for prompt type
.Ar prompt-type . .Ar prompt-type .
If If
@ -6028,11 +6029,11 @@ starts without the preview.
This command works only if at least one client is attached. This command works only if at least one client is attached.
.Tg clearhist .Tg clearhist
.It Ic clear-history Op Fl t Ar target-pane .It Ic clear-history Op Fl t Ar target-pane
.D1 (alias: Ic clearhist ) .D1 Pq alias: Ic clearhist
Remove and free the history for the specified pane. Remove and free the history for the specified pane.
.Tg deleteb .Tg deleteb
.It Ic delete-buffer Op Fl b Ar buffer-name .It Ic delete-buffer Op Fl b Ar buffer-name
.D1 (alias: Ic deleteb ) .D1 Pq alias: Ic deleteb
Delete the buffer named Delete the buffer named
.Ar buffer-name , .Ar buffer-name ,
or the most recently added automatically named buffer if not specified. or the most recently added automatically named buffer if not specified.
@ -6041,7 +6042,7 @@ or the most recently added automatically named buffer if not specified.
.Op Fl F Ar format .Op Fl F Ar format
.Op Fl f Ar filter .Op Fl f Ar filter
.Xc .Xc
.D1 (alias: Ic lsb ) .D1 Pq alias: Ic lsb
List the global buffers. List the global buffers.
.Fl F .Fl F
specifies the format of each line and specifies the format of each line and
@ -6058,7 +6059,7 @@ section.
.Ar path .Ar path
.Xc .Xc
.Tg loadb .Tg loadb
.D1 (alias: Ic loadb ) .D1 Pq alias: Ic loadb
Load the contents of the specified paste buffer from Load the contents of the specified paste buffer from
.Ar path . .Ar path .
If If
@ -6075,7 +6076,7 @@ escape sequence, if possible.
.Op Fl s Ar separator .Op Fl s Ar separator
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Xc .Xc
.D1 (alias: Ic pasteb ) .D1 Pq alias: Ic pasteb
Insert the contents of a paste buffer into the specified pane. Insert the contents of a paste buffer into the specified pane.
If not specified, paste into the current one. If not specified, paste into the current one.
With With
@ -6099,7 +6100,7 @@ buffer if the application has requested bracketed paste mode.
.Op Fl b Ar buffer-name .Op Fl b Ar buffer-name
.Ar path .Ar path
.Xc .Xc
.D1 (alias: Ic saveb ) .D1 Pq alias: Ic saveb
Save the contents of the specified paste buffer to Save the contents of the specified paste buffer to
.Ar path . .Ar path .
The The
@ -6113,7 +6114,7 @@ option appends to rather than overwriting the file.
.Op Fl n Ar new-buffer-name .Op Fl n Ar new-buffer-name
.Ar data .Ar data
.Xc .Xc
.D1 (alias: Ic setb ) .D1 Pq alias: Ic setb
Set the contents of the specified buffer to Set the contents of the specified buffer to
.Ar data . .Ar data .
If If
@ -6134,7 +6135,7 @@ option renames the buffer to
.It Xo Ic show-buffer .It Xo Ic show-buffer
.Op Fl b Ar buffer-name .Op Fl b Ar buffer-name
.Xc .Xc
.D1 (alias: Ic showb ) .D1 Pq alias: Ic showb
Display the contents of the specified buffer. Display the contents of the specified buffer.
.El .El
.Sh MISCELLANEOUS .Sh MISCELLANEOUS
@ -6149,7 +6150,7 @@ Display a large clock.
.Ar shell-command command .Ar shell-command command
.Op Ar command .Op Ar command
.Xc .Xc
.D1 (alias: Ic if ) .D1 Pq alias: Ic if
Execute the first Execute the first
.Ar command .Ar command
if if
@ -6176,7 +6177,7 @@ is not executed but considered success if neither empty nor zero (after formats
are expanded). are expanded).
.Tg lock .Tg lock
.It Ic lock-server .It Ic lock-server
.D1 (alias: Ic lock ) .D1 Pq alias: Ic lock
Lock each client individually by running the command specified by the Lock each client individually by running the command specified by the
.Ic lock-command .Ic lock-command
option. option.
@ -6187,7 +6188,7 @@ option.
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Op Ar shell-command .Op Ar shell-command
.Xc .Xc
.D1 (alias: Ic run ) .D1 Pq alias: Ic run
Execute Execute
.Ar shell-command .Ar shell-command
or (with or (with
@ -6219,7 +6220,7 @@ If the command fails, the exit status is also displayed.
.Op Fl L | S | U .Op Fl L | S | U
.Ar channel .Ar channel
.Xc .Xc
.D1 (alias: Ic wait ) .D1 Pq alias: Ic wait
When used without options, prevents the client from exiting until woken using When used without options, prevents the client from exiting until woken using
.Ic wait-for .Ic wait-for
.Fl S .Fl S

1
tmux.h
View File

@ -1759,6 +1759,7 @@ struct client {
#define PROMPT_KEY 0x10 #define PROMPT_KEY 0x10
int prompt_flags; int prompt_flags;
enum prompt_type prompt_type; enum prompt_type prompt_type;
int prompt_cursor;
struct session *session; struct session *session;
struct session *last_session; struct session *last_session;

6
tty.c
View File

@ -302,7 +302,7 @@ tty_start_tty(struct tty *tty)
{ {
struct client *c = tty->client; struct client *c = tty->client;
struct termios tio; struct termios tio;
struct timeval tv = { .tv_sec = 1 }; struct timeval tv = { .tv_sec = 3 };
setblocking(c->fd, 0); setblocking(c->fd, 0);
event_add(&tty->event_in, NULL); event_add(&tty->event_in, NULL);
@ -937,7 +937,9 @@ tty_update_window_offset(struct window *w)
struct client *c; struct client *c;
TAILQ_FOREACH(c, &clients, entry) { TAILQ_FOREACH(c, &clients, entry) {
if (c->session != NULL && c->session->curw->window == w) if (c->session != NULL &&
c->session->curw != NULL &&
c->session->curw->window == w)
tty_update_client_offset(c); tty_update_client_offset(c);
} }
} }

View File

@ -398,11 +398,11 @@ window_customize_build_options(struct window_customize_modedata *data,
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
if (oo2 != NULL) if (oo2 != NULL)
o = options_get(oo0, list[i]); o = options_get(oo2, list[i]);
if (o == NULL && oo1 != NULL) if (o == NULL && oo1 != NULL)
o = options_get(oo1, list[i]); o = options_get(oo1, list[i]);
if (o == NULL) if (o == NULL)
o = options_get(oo2, list[i]); o = options_get(oo0, list[i]);
if (options_owner(o) == oo2) if (options_owner(o) == oo2)
scope = scope2; scope = scope2;
else if (options_owner(o) == oo1) else if (options_owner(o) == oo1)