sync code with last fixes and improvements from OpenBSD
This commit is contained in:
parent
f57be82572
commit
58b04bcee7
468 changed files with 9958 additions and 7882 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: client.c,v 1.159 2023/01/06 07:09:27 nicm Exp $ */
|
||||
/* $OpenBSD: client.c,v 1.161 2023/07/10 12:00:08 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -246,9 +246,6 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
|
|||
u_int ncaps = 0;
|
||||
struct args_value *values;
|
||||
|
||||
/* Ignore SIGCHLD now or daemon() in the server will leave a zombie. */
|
||||
signal(SIGCHLD, SIG_IGN);
|
||||
|
||||
/* Set up the initial command. */
|
||||
if (shell_command != NULL) {
|
||||
msg = MSG_SHELL;
|
||||
|
@ -526,11 +523,22 @@ client_signal(int sig)
|
|||
{
|
||||
struct sigaction sigact;
|
||||
int status;
|
||||
pid_t pid;
|
||||
|
||||
log_debug("%s: %s", __func__, strsignal(sig));
|
||||
if (sig == SIGCHLD)
|
||||
waitpid(WAIT_ANY, &status, WNOHANG);
|
||||
else if (!client_attached) {
|
||||
if (sig == SIGCHLD) {
|
||||
for (;;) {
|
||||
pid = waitpid(WAIT_ANY, &status, WNOHANG);
|
||||
if (pid == 0)
|
||||
break;
|
||||
if (pid == -1) {
|
||||
if (errno == ECHILD)
|
||||
break;
|
||||
log_debug("waitpid failed: %s",
|
||||
strerror(errno));
|
||||
}
|
||||
}
|
||||
} else if (!client_attached) {
|
||||
if (sig == SIGTERM || sig == SIGHUP)
|
||||
proc_exit(client_proc);
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cmd-find.c,v 1.82 2022/11/01 09:46:14 nicm Exp $ */
|
||||
/* $OpenBSD: cmd-find.c,v 1.83 2023/07/10 09:24:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -583,7 +583,7 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane)
|
|||
|
||||
/* Try special characters. */
|
||||
if (strcmp(pane, "!") == 0) {
|
||||
fs->wp = fs->w->last;
|
||||
fs->wp = TAILQ_FIRST(&fs->w->last_panes);
|
||||
if (fs->wp == NULL)
|
||||
return (-1);
|
||||
return (0);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cmd-select-pane.c,v 1.68 2021/08/21 10:22:39 nicm Exp $ */
|
||||
/* $OpenBSD: cmd-select-pane.c,v 1.69 2023/07/10 09:24:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -98,7 +98,11 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
|
|||
struct options_entry *o;
|
||||
|
||||
if (entry == &cmd_last_pane_entry || args_has(args, 'l')) {
|
||||
lastwp = w->last;
|
||||
/*
|
||||
* Check for no last pane found in case the other pane was
|
||||
* spawned without being visited (for example split-window -d).
|
||||
*/
|
||||
lastwp = TAILQ_FIRST(&w->last_panes);
|
||||
if (lastwp == NULL && window_count_panes(w) == 2) {
|
||||
lastwp = TAILQ_PREV(w->active, window_panes, entry);
|
||||
if (lastwp == NULL)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: cmd-swap-pane.c,v 1.42 2023/01/17 06:50:55 nicm Exp $ */
|
||||
/* $OpenBSD: cmd-swap-pane.c,v 1.43 2023/07/10 09:24:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -128,10 +128,8 @@ cmd_swap_pane_exec(struct cmd *self, struct cmdq_item *item)
|
|||
window_set_active_pane(dst_w, src_wp, 1);
|
||||
}
|
||||
if (src_w != dst_w) {
|
||||
if (src_w->last == src_wp)
|
||||
src_w->last = NULL;
|
||||
if (dst_w->last == dst_wp)
|
||||
dst_w->last = NULL;
|
||||
window_pane_stack_remove(&src_w->last_panes, src_wp);
|
||||
window_pane_stack_remove(&dst_w->last_panes, dst_wp);
|
||||
colour_palette_from_option(&src_wp->palette, src_wp->options);
|
||||
colour_palette_from_option(&dst_wp->palette, dst_wp->options);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: format.c,v 1.315 2023/07/03 10:48:26 nicm Exp $ */
|
||||
/* $OpenBSD: format.c,v 1.316 2023/07/10 09:24:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -1902,7 +1902,7 @@ static void *
|
|||
format_cb_pane_last(struct format_tree *ft)
|
||||
{
|
||||
if (ft->wp != NULL) {
|
||||
if (ft->wp == ft->wp->window->last)
|
||||
if (ft->wp == TAILQ_FIRST(&ft->wp->window->last_panes))
|
||||
return (xstrdup("1"));
|
||||
return (xstrdup("0"));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: grid.c,v 1.129 2023/06/30 21:55:08 nicm Exp $ */
|
||||
/* $OpenBSD: grid.c,v 1.130 2023/07/13 06:03:48 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
/* Default grid cell data. */
|
||||
const struct grid_cell grid_default_cell = {
|
||||
{ { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 0, 0
|
||||
{ { ' ' }, 0, 1, 1 }, 0, 0, 8, 8, 8, 0
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -45,12 +45,12 @@ const struct grid_cell grid_default_cell = {
|
|||
* appears in the grid - because of this, they are always extended cells.
|
||||
*/
|
||||
static const struct grid_cell grid_padding_cell = {
|
||||
{ { '!' }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 8, 8, 0, 0
|
||||
{ { '!' }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 8, 8, 8, 0
|
||||
};
|
||||
|
||||
/* Cleared grid cell data. */
|
||||
static const struct grid_cell grid_cleared_cell = {
|
||||
{ { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0, 0
|
||||
{ { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 8, 0
|
||||
};
|
||||
static const struct grid_cell_entry grid_cleared_entry = {
|
||||
{ .data = { 0, 8, 8, ' ' } }, GRID_FLAG_CLEARED
|
||||
|
@ -528,7 +528,7 @@ grid_get_cell1(struct grid_line *gl, u_int px, struct grid_cell *gc)
|
|||
gc->bg = gce->data.bg;
|
||||
if (gce->flags & GRID_FLAG_BG256)
|
||||
gc->bg |= COLOUR_FLAG_256;
|
||||
gc->us = 0;
|
||||
gc->us = 8;
|
||||
utf8_set(&gc->data, gce->data.data);
|
||||
gc->link = 0;
|
||||
}
|
||||
|
@ -956,7 +956,7 @@ grid_string_cells_code(const struct grid_cell *lastgc,
|
|||
for (i = 0; i < nitems(attrs); i++) {
|
||||
if (((~attr & attrs[i].mask) &&
|
||||
(lastattr & attrs[i].mask)) ||
|
||||
(lastgc->us != 0 && gc->us == 0)) {
|
||||
(lastgc->us != 8 && gc->us == 8)) {
|
||||
s[n++] = 0;
|
||||
lastattr &= GRID_ATTR_CHARSET;
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: input.c,v 1.217 2023/07/03 16:47:43 nicm Exp $ */
|
||||
/* $OpenBSD: input.c,v 1.218 2023/07/13 06:03:48 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -2186,7 +2186,7 @@ input_csi_dispatch_sgr(struct input_ctx *ictx)
|
|||
gc->attr &= ~GRID_ATTR_OVERLINE;
|
||||
break;
|
||||
case 59:
|
||||
gc->us = 0;
|
||||
gc->us = 8;
|
||||
break;
|
||||
case 90:
|
||||
case 91:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: screen-write.c,v 1.214 2023/03/27 08:31:32 nicm Exp $ */
|
||||
/* $OpenBSD: screen-write.c,v 1.215 2023/07/14 19:32:59 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -326,7 +326,9 @@ screen_write_reset(struct screen_write_ctx *ctx)
|
|||
screen_reset_tabs(s);
|
||||
screen_write_scrollregion(ctx, 0, screen_size_y(s) - 1);
|
||||
|
||||
s->mode = MODE_CURSOR | MODE_WRAP;
|
||||
s->mode = MODE_CURSOR|MODE_WRAP;
|
||||
if (options_get_number(global_options, "extended-keys") == 2)
|
||||
s->mode |= MODE_KEXTENDED;
|
||||
|
||||
screen_write_clearscreen(ctx, 8);
|
||||
screen_write_set_cursor(ctx, 0, 0);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: session.c,v 1.93 2022/10/17 10:59:42 nicm Exp $ */
|
||||
/* $OpenBSD: session.c,v 1.94 2023/07/19 13:03:36 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -739,9 +739,12 @@ session_renumber_windows(struct session *s)
|
|||
memcpy(&old_lastw, &s->lastw, sizeof old_lastw);
|
||||
TAILQ_INIT(&s->lastw);
|
||||
TAILQ_FOREACH(wl, &old_lastw, sentry) {
|
||||
wl->flags &= ~WINLINK_VISITED;
|
||||
wl_new = winlink_find_by_window(&s->windows, wl->window);
|
||||
if (wl_new != NULL)
|
||||
if (wl_new != NULL) {
|
||||
TAILQ_INSERT_TAIL(&s->lastw, wl_new, sentry);
|
||||
wl_new->flags |= WINLINK_VISITED;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the current window. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: spawn.c,v 1.31 2022/08/10 14:03:59 nicm Exp $ */
|
||||
/* $OpenBSD: spawn.c,v 1.33 2023/07/10 09:24:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -115,6 +115,7 @@ spawn_window(struct spawn_context *sc, char **cause)
|
|||
window_pane_resize(sc->wp0, w->sx, w->sy);
|
||||
|
||||
layout_init(w, sc->wp0);
|
||||
w->active = NULL;
|
||||
window_set_active_pane(w, sc->wp0, 0);
|
||||
}
|
||||
|
||||
|
@ -415,8 +416,8 @@ spawn_pane(struct spawn_context *sc, char **cause)
|
|||
_exit(1);
|
||||
|
||||
/* Clean up file descriptors and signals and update the environment. */
|
||||
closefrom(STDERR_FILENO + 1);
|
||||
proc_clear_signals(server_proc, 1);
|
||||
closefrom(STDERR_FILENO + 1);
|
||||
sigprocmask(SIG_SETMASK, &oldset, NULL);
|
||||
log_close();
|
||||
environ_push(child);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.\" $OpenBSD: tmux.1,v 1.922 2023/07/03 16:47:43 nicm Exp $
|
||||
.\" $OpenBSD: tmux.1,v 1.924 2023/07/11 16:09:09 nicm Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
.\"
|
||||
|
@ -14,7 +14,7 @@
|
|||
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: July 3 2023 $
|
||||
.Dd $Mdocdate: July 11 2023 $
|
||||
.Dt TMUX 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
@ -1742,93 +1742,266 @@ Key tables may be viewed with the
|
|||
command.
|
||||
.Pp
|
||||
The following commands are supported in copy mode:
|
||||
.Bl -column "CommandXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "viXXXXXXXXXX" "emacs" -offset indent
|
||||
.It Sy "Command" Ta Sy "vi" Ta Sy "emacs"
|
||||
.It Li "append-selection" Ta "" Ta ""
|
||||
.It Li "append-selection-and-cancel" Ta "A" Ta ""
|
||||
.It Li "back-to-indentation" Ta "^" Ta "M-m"
|
||||
.It Li "begin-selection" Ta "Space" Ta "C-Space"
|
||||
.It Li "bottom-line" Ta "L" Ta ""
|
||||
.It Li "cancel" Ta "q" Ta "Escape"
|
||||
.It Li "clear-selection" Ta "Escape" Ta "C-g"
|
||||
.It Li "copy-end-of-line [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-end-of-line-and-cancel [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-end-of-line [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-end-of-line-and-cancel [<command>] [<prefix>]" Ta "D" Ta "C-k"
|
||||
.It Li "copy-line [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-line-and-cancel [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-line [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-line-and-cancel [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-no-clear [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-selection [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-selection-no-clear [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-selection-and-cancel [<prefix>]" Ta "Enter" Ta "M-w"
|
||||
.It Li "cursor-down" Ta "j" Ta "Down"
|
||||
.It Li "cursor-down-and-cancel" Ta "" Ta ""
|
||||
.It Li "cursor-left" Ta "h" Ta "Left"
|
||||
.It Li "cursor-right" Ta "l" Ta "Right"
|
||||
.It Li "cursor-up" Ta "k" Ta "Up"
|
||||
.It Li "end-of-line" Ta "$" Ta "C-e"
|
||||
.It Li "goto-line <line>" Ta ":" Ta "g"
|
||||
.It Li "halfpage-down" Ta "C-d" Ta "M-Down"
|
||||
.It Li "halfpage-down-and-cancel" Ta "" Ta ""
|
||||
.It Li "halfpage-up" Ta "C-u" Ta "M-Up"
|
||||
.It Li "history-bottom" Ta "G" Ta "M->"
|
||||
.It Li "history-top" Ta "g" Ta "M-<"
|
||||
.It Li "jump-again" Ta ";" Ta ";"
|
||||
.It Li "jump-backward <to>" Ta "F" Ta "F"
|
||||
.It Li "jump-forward <to>" Ta "f" Ta "f"
|
||||
.It Li "jump-reverse" Ta "," Ta ","
|
||||
.It Li "jump-to-backward <to>" Ta "T" Ta ""
|
||||
.It Li "jump-to-forward <to>" Ta "t" Ta ""
|
||||
.It Li "jump-to-mark" Ta "M-x" Ta "M-x"
|
||||
.It Li "middle-line" Ta "M" Ta "M-r"
|
||||
.It Li "next-matching-bracket" Ta "%" Ta "M-C-f"
|
||||
.It Li "next-paragraph" Ta "}" Ta "M-}"
|
||||
.It Li "next-prompt" Ta "" Ta ""
|
||||
.It Li "next-space" Ta "W" Ta ""
|
||||
.It Li "next-space-end" Ta "E" Ta ""
|
||||
.It Li "next-word" Ta "w" Ta ""
|
||||
.It Li "next-word-end" Ta "e" Ta "M-f"
|
||||
.It Li "other-end" Ta "o" Ta ""
|
||||
.It Li "page-down" Ta "C-f" Ta "PageDown"
|
||||
.It Li "page-down-and-cancel" Ta "" Ta ""
|
||||
.It Li "page-up" Ta "C-b" Ta "PageUp"
|
||||
.It Li "pipe [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "pipe-no-clear [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "previous-matching-bracket" Ta "" Ta "M-C-b"
|
||||
.It Li "previous-paragraph" Ta "{" Ta "M-{"
|
||||
.It Li "previous-prompt" Ta "" Ta ""
|
||||
.It Li "previous-space" Ta "B" Ta ""
|
||||
.It Li "previous-word" Ta "b" Ta "M-b"
|
||||
.It Li "rectangle-on" Ta "" Ta ""
|
||||
.It Li "rectangle-off" Ta "" Ta ""
|
||||
.It Li "rectangle-toggle" Ta "v" Ta "R"
|
||||
.It Li "refresh-from-pane" Ta "r" Ta "r"
|
||||
.It Li "scroll-down" Ta "C-e" Ta "C-Down"
|
||||
.It Li "scroll-down-and-cancel" Ta "" Ta ""
|
||||
.It Li "scroll-up" Ta "C-y" Ta "C-Up"
|
||||
.It Li "search-again" Ta "n" Ta "n"
|
||||
.It Li "search-backward <for>" Ta "?" Ta ""
|
||||
.It Li "search-backward-incremental <for>" Ta "" Ta "C-r"
|
||||
.It Li "search-backward-text <for>" Ta "" Ta ""
|
||||
.It Li "search-forward <for>" Ta "/" Ta ""
|
||||
.It Li "search-forward-incremental <for>" Ta "" Ta "C-s"
|
||||
.It Li "search-forward-text <for>" Ta "" Ta ""
|
||||
.It Li "scroll-bottom" Ta "" Ta ""
|
||||
.It Li "scroll-middle" Ta "z" Ta ""
|
||||
.It Li "scroll-top" Ta "" Ta ""
|
||||
.It Li "search-reverse" Ta "N" Ta "N"
|
||||
.It Li "select-line" Ta "V" Ta ""
|
||||
.It Li "select-word" Ta "" Ta ""
|
||||
.It Li "set-mark" Ta "X" Ta "X"
|
||||
.It Li "start-of-line" Ta "0" Ta "C-a"
|
||||
.It Li "stop-selection" Ta "" Ta ""
|
||||
.It Li "toggle-position" Ta "P" Ta "P"
|
||||
.It Li "top-line" Ta "H" Ta "M-R"
|
||||
.Bl -tag -width Ds
|
||||
.It Xo
|
||||
.Ic append-selection
|
||||
.Xc
|
||||
Append the selection to the top paste buffer.
|
||||
.It Xo
|
||||
.Ic append-selection-and-cancel
|
||||
(vi: A)
|
||||
.Xc
|
||||
Append the selection to the top paste buffer and exit copy mode.
|
||||
.It Xo
|
||||
.Ic back-to-indentation
|
||||
(vi: ^)
|
||||
(emacs: M-m)
|
||||
.Xc
|
||||
Move the cursor back to the indentation.
|
||||
.It Xo
|
||||
.Ic begin-selection
|
||||
(vi: Space)
|
||||
(emacs: C-Space)
|
||||
.Xc
|
||||
Begin selection.
|
||||
.It Xo
|
||||
.Ic bottom-line
|
||||
(vi: L)
|
||||
.Xc
|
||||
Move to the bottom line.
|
||||
.It Xo
|
||||
.Ic cancel
|
||||
(vi: q)
|
||||
(emacs: Escape)
|
||||
.Xc
|
||||
Exit copy mode.
|
||||
.It Xo
|
||||
.Ic clear-selection
|
||||
(vi: Escape)
|
||||
(emacs: C-g)
|
||||
.Xc
|
||||
Clear the current selection.
|
||||
.It Xo
|
||||
.Ic copy-end-of-line [<prefix>]
|
||||
.Xc
|
||||
Copy from the cursor position to the end of the line.
|
||||
.Ar prefix
|
||||
is used to name the new paste buffer.
|
||||
.It Xo
|
||||
.Ic copy-end-of-line-and-cancel [<prefix>]
|
||||
.Xc
|
||||
Copy from the cursor position and exit copy mode.
|
||||
.It Xo
|
||||
.Ic copy-line [<prefix>]
|
||||
.Xc
|
||||
Copy the entire line.
|
||||
.It Xo
|
||||
.Ic copy-line-and-cancel [<prefix>]
|
||||
.Xc
|
||||
Copy the entire line and exit copy mode.
|
||||
.It Xo
|
||||
.Ic copy-selection [<prefix>]
|
||||
.Xc
|
||||
Copies the current selection.
|
||||
.It Xo
|
||||
.Ic copy-selection-and-cancel [<prefix>]
|
||||
(vi: Enter)
|
||||
(emacs: M-w)
|
||||
.Xc
|
||||
Copy the current selection and exit copy mode.
|
||||
.It Xo
|
||||
.Ic cursor-down
|
||||
(vi: j)
|
||||
(emacs: Down)
|
||||
.Xc
|
||||
Move the cursor down.
|
||||
.It Xo
|
||||
.Ic cursor-left
|
||||
(vi: h)
|
||||
(emacs: Left)
|
||||
.Xc
|
||||
Move the cursor left.
|
||||
.It Xo
|
||||
.Ic cursor-right
|
||||
(vi: l)
|
||||
(emacs: Right)
|
||||
.Xc
|
||||
Move the cursor right.
|
||||
.It Xo
|
||||
.Ic cursor-up
|
||||
(vi: k)
|
||||
(emacs: Up)
|
||||
.Xc
|
||||
Move the cursor up.
|
||||
.It Xo
|
||||
.Ic end-of-line
|
||||
(vi: $)
|
||||
(emacs: C-e)
|
||||
.Xc
|
||||
Move the cursor to the end of the line.
|
||||
.It Xo
|
||||
.Ic goto-line <line>
|
||||
(vi: :)
|
||||
(emacs: g)
|
||||
.Xc
|
||||
Move the cursor to a specific line.
|
||||
.It Xo
|
||||
.Ic history-bottom
|
||||
(vi: G)
|
||||
(emacs: M->)
|
||||
.Xc
|
||||
Scroll to the bottom of the history.
|
||||
.It Xo
|
||||
.Ic history-top
|
||||
(vi: g)
|
||||
(emacs: M-<)
|
||||
.Xc
|
||||
Scroll to the top of the history.
|
||||
.It Xo
|
||||
.Ic jump-again
|
||||
(vi: ;)
|
||||
(emacs: ;)
|
||||
.Xc
|
||||
Repeat the last jump.
|
||||
.It Xo
|
||||
.Ic jump-backward <to>
|
||||
(vi: F)
|
||||
(emacs: F)
|
||||
.Xc
|
||||
Jump backwards to the specified text.
|
||||
.It Xo
|
||||
.Ic jump-forward <to>
|
||||
(vi: f)
|
||||
(emacs: f)
|
||||
.Xc
|
||||
Jump forward to the specified text.
|
||||
.It Xo
|
||||
.Ic jump-to-mark
|
||||
(vi: M-x)
|
||||
(emacs: M-x)
|
||||
.Xc
|
||||
Jump to the last mark.
|
||||
.It Xo
|
||||
.Ic middle-line
|
||||
(vi: M)
|
||||
(emacs: M-r)
|
||||
.Xc
|
||||
Move to the middle line.
|
||||
.It Xo
|
||||
.Ic next-matching-bracket
|
||||
(vi: %)
|
||||
(emacs: M-C-f)
|
||||
.Xc
|
||||
Move to the next matching bracket.
|
||||
.It Xo
|
||||
.Ic next-paragraph
|
||||
(vi: })
|
||||
(emacs: M-})
|
||||
.Xc
|
||||
Move to the next paragraph.
|
||||
.It Xo
|
||||
.Ic next-prompt
|
||||
.Xc
|
||||
Move to the next prompt.
|
||||
.It Xo
|
||||
.Ic next-word
|
||||
(vi: w)
|
||||
.Xc
|
||||
Move to the next word.
|
||||
.It Xo
|
||||
.Ic page-down
|
||||
(vi: C-f)
|
||||
(emacs: PageDown)
|
||||
.Xc
|
||||
Scroll down by one page.
|
||||
.It Xo
|
||||
.Ic page-up
|
||||
(vi: C-b)
|
||||
(emacs: PageUp)
|
||||
.Xc
|
||||
Scroll up by one page.
|
||||
.It Xo
|
||||
.Ic previous-matching-bracket
|
||||
(emacs: M-C-b)
|
||||
.Xc
|
||||
Move to the previous matching bracket.
|
||||
.It Xo
|
||||
.Ic previous-paragraph
|
||||
(vi: {)
|
||||
(emacs: M-{)
|
||||
.Xc
|
||||
Move to the previous paragraph.
|
||||
.It Xo
|
||||
.Ic previous-prompt
|
||||
.Xc
|
||||
Move to the previous prompt.
|
||||
.It Xo
|
||||
.Ic previous-word
|
||||
(vi: b)
|
||||
(emacs: M-b)
|
||||
.Xc
|
||||
Move to the previous word.
|
||||
.It Xo
|
||||
.Ic rectangle-toggle
|
||||
(vi: v)
|
||||
(emacs: R)
|
||||
.Xc
|
||||
Toggle rectangle selection mode.
|
||||
.It Xo
|
||||
.Ic refresh-from-pane
|
||||
(vi: r)
|
||||
(emacs: r)
|
||||
.Xc
|
||||
Refresh the content from the pane.
|
||||
.It Xo
|
||||
.Ic search-again
|
||||
(vi: n)
|
||||
(emacs: n)
|
||||
.Xc
|
||||
Repeat the last search.
|
||||
.It Xo
|
||||
.Ic search-backward <for>
|
||||
(vi: ?)
|
||||
.Xc
|
||||
Search backwards for the specified text.
|
||||
.It Xo
|
||||
.Ic search-forward <for>
|
||||
(vi: /)
|
||||
.Xc
|
||||
Search forward for the specified text.
|
||||
.It Xo
|
||||
.Ic select-line
|
||||
(vi: V)
|
||||
.Xc
|
||||
Select the current line.
|
||||
.It Xo
|
||||
.Ic select-word
|
||||
.Xc
|
||||
Select the current word.
|
||||
.It Xo
|
||||
.Ic start-of-line
|
||||
(vi: 0)
|
||||
(emacs: C-a)
|
||||
.Xc
|
||||
Move the cursor to the start of the line.
|
||||
.It Xo
|
||||
.Ic top-line
|
||||
(vi: H)
|
||||
(emacs: M-R)
|
||||
.Xc
|
||||
Move to the top line.
|
||||
.It Xo
|
||||
.Ic next-prompt
|
||||
(vi: C-n)
|
||||
(emacs: C-n)
|
||||
.Xc
|
||||
Move to the next prompt.
|
||||
.It Xo
|
||||
.Ic previous-prompt
|
||||
(vi: C-p)
|
||||
(emacs: C-p)
|
||||
.Xc
|
||||
Move to the previous prompt.
|
||||
.El
|
||||
.Pp
|
||||
The search commands come in several varieties:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: tmux.h,v 1.1200 2023/07/03 16:47:43 nicm Exp $ */
|
||||
/* $OpenBSD: tmux.h,v 1.1201 2023/07/10 09:24:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -1038,7 +1038,7 @@ struct window_pane {
|
|||
#define PANE_REDRAW 0x1
|
||||
#define PANE_DROP 0x2
|
||||
#define PANE_FOCUSED 0x4
|
||||
/* 0x8 unused */
|
||||
#define PANE_VISITED 0x8
|
||||
/* 0x10 unused */
|
||||
/* 0x20 unused */
|
||||
#define PANE_INPUTOFF 0x40
|
||||
|
@ -1093,7 +1093,8 @@ struct window_pane {
|
|||
int border_gc_set;
|
||||
struct grid_cell border_gc;
|
||||
|
||||
TAILQ_ENTRY(window_pane) entry;
|
||||
TAILQ_ENTRY(window_pane) entry; /* link in list of all panes */
|
||||
TAILQ_ENTRY(window_pane) sentry; /* link in list of last visited */
|
||||
RB_ENTRY(window_pane) tree_entry;
|
||||
};
|
||||
TAILQ_HEAD(window_panes, window_pane);
|
||||
|
@ -1114,7 +1115,7 @@ struct window {
|
|||
struct timeval activity_time;
|
||||
|
||||
struct window_pane *active;
|
||||
struct window_pane *last;
|
||||
struct window_panes last_panes;
|
||||
struct window_panes panes;
|
||||
|
||||
int lastlayout;
|
||||
|
@ -1167,6 +1168,7 @@ struct winlink {
|
|||
#define WINLINK_ACTIVITY 0x2
|
||||
#define WINLINK_SILENCE 0x4
|
||||
#define WINLINK_ALERTFLAGS (WINLINK_BELL|WINLINK_ACTIVITY|WINLINK_SILENCE)
|
||||
#define WINLINK_VISITED 0x8
|
||||
|
||||
RB_ENTRY(winlink) entry;
|
||||
TAILQ_ENTRY(winlink) wentry;
|
||||
|
@ -3041,6 +3043,10 @@ struct window_pane *window_pane_find_up(struct window_pane *);
|
|||
struct window_pane *window_pane_find_down(struct window_pane *);
|
||||
struct window_pane *window_pane_find_left(struct window_pane *);
|
||||
struct window_pane *window_pane_find_right(struct window_pane *);
|
||||
void window_pane_stack_push(struct window_panes *,
|
||||
struct window_pane *);
|
||||
void window_pane_stack_remove(struct window_panes *,
|
||||
struct window_pane *);
|
||||
void window_set_name(struct window *, const char *);
|
||||
void window_add_ref(struct window *, const char *);
|
||||
void window_remove_ref(struct window *, const char *);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: tty.c,v 1.431 2023/06/26 07:17:40 nicm Exp $ */
|
||||
/* $OpenBSD: tty.c,v 1.432 2023/07/13 06:03:48 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -2815,9 +2815,10 @@ tty_check_us(__unused struct tty *tty, struct colour_palette *palette,
|
|||
}
|
||||
|
||||
/* Underscore colour is set as RGB so convert. */
|
||||
gc->us = colour_force_rgb (gc->us);
|
||||
if (gc->us == -1)
|
||||
if ((c = colour_force_rgb (gc->us)) == -1)
|
||||
gc->us = 8;
|
||||
else
|
||||
gc->us = c;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2892,7 +2893,7 @@ tty_colours_us(struct tty *tty, const struct grid_cell *gc)
|
|||
u_char r, g, b;
|
||||
|
||||
/* Clear underline colour. */
|
||||
if (gc->us == 0) {
|
||||
if (COLOUR_DEFAULT(gc->us)) {
|
||||
tty_putcode(tty, TTYC_OL);
|
||||
goto save;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: window.c,v 1.285 2023/03/27 08:47:57 nicm Exp $ */
|
||||
/* $OpenBSD: window.c,v 1.286 2023/07/10 09:24:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
|
@ -248,21 +248,15 @@ winlink_stack_push(struct winlink_stack *stack, struct winlink *wl)
|
|||
|
||||
winlink_stack_remove(stack, wl);
|
||||
TAILQ_INSERT_HEAD(stack, wl, sentry);
|
||||
wl->flags |= WINLINK_VISITED;
|
||||
}
|
||||
|
||||
void
|
||||
winlink_stack_remove(struct winlink_stack *stack, struct winlink *wl)
|
||||
{
|
||||
struct winlink *wl2;
|
||||
|
||||
if (wl == NULL)
|
||||
return;
|
||||
|
||||
TAILQ_FOREACH(wl2, stack, sentry) {
|
||||
if (wl2 == wl) {
|
||||
TAILQ_REMOVE(stack, wl, sentry);
|
||||
return;
|
||||
}
|
||||
if (wl != NULL && (wl->flags & WINLINK_VISITED)) {
|
||||
TAILQ_REMOVE(stack, wl, sentry);
|
||||
wl->flags &= ~WINLINK_VISITED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -312,6 +306,7 @@ window_create(u_int sx, u_int sy, u_int xpixel, u_int ypixel)
|
|||
w->flags = 0;
|
||||
|
||||
TAILQ_INIT(&w->panes);
|
||||
TAILQ_INIT(&w->last_panes);
|
||||
w->active = NULL;
|
||||
|
||||
w->lastlayout = -1;
|
||||
|
@ -512,18 +507,23 @@ window_pane_update_focus(struct window_pane *wp)
|
|||
int
|
||||
window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
|
||||
{
|
||||
struct window_pane *lastwp;
|
||||
|
||||
log_debug("%s: pane %%%u", __func__, wp->id);
|
||||
|
||||
if (wp == w->active)
|
||||
return (0);
|
||||
w->last = w->active;
|
||||
lastwp = w->active;
|
||||
|
||||
window_pane_stack_remove(&w->last_panes, wp);
|
||||
window_pane_stack_push(&w->last_panes, lastwp);
|
||||
|
||||
w->active = wp;
|
||||
w->active->active_point = next_active_point++;
|
||||
w->active->flags |= PANE_CHANGED;
|
||||
|
||||
if (options_get_number(global_options, "focus-events")) {
|
||||
window_pane_update_focus(w->last);
|
||||
window_pane_update_focus(lastwp);
|
||||
window_pane_update_focus(w->active);
|
||||
}
|
||||
|
||||
|
@ -746,21 +746,21 @@ window_lost_pane(struct window *w, struct window_pane *wp)
|
|||
if (wp == marked_pane.wp)
|
||||
server_clear_marked();
|
||||
|
||||
window_pane_stack_remove(&w->last_panes, wp);
|
||||
if (wp == w->active) {
|
||||
w->active = w->last;
|
||||
w->last = NULL;
|
||||
w->active = TAILQ_FIRST(&w->last_panes);
|
||||
if (w->active == NULL) {
|
||||
w->active = TAILQ_PREV(wp, window_panes, entry);
|
||||
if (w->active == NULL)
|
||||
w->active = TAILQ_NEXT(wp, entry);
|
||||
}
|
||||
if (w->active != NULL) {
|
||||
window_pane_stack_remove(&w->last_panes, w->active);
|
||||
w->active->flags |= PANE_CHANGED;
|
||||
notify_window("window-pane-changed", w);
|
||||
window_update_focus(w);
|
||||
}
|
||||
} else if (wp == w->last)
|
||||
w->last = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -844,6 +844,11 @@ window_destroy_panes(struct window *w)
|
|||
{
|
||||
struct window_pane *wp;
|
||||
|
||||
while (!TAILQ_EMPTY(&w->last_panes)) {
|
||||
wp = TAILQ_FIRST(&w->last_panes);
|
||||
window_pane_stack_remove(&w->last_panes, wp);
|
||||
}
|
||||
|
||||
while (!TAILQ_EMPTY(&w->panes)) {
|
||||
wp = TAILQ_FIRST(&w->panes);
|
||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||
|
@ -1478,6 +1483,25 @@ window_pane_find_right(struct window_pane *wp)
|
|||
return (best);
|
||||
}
|
||||
|
||||
void
|
||||
window_pane_stack_push(struct window_panes *stack, struct window_pane *wp)
|
||||
{
|
||||
if (wp != NULL) {
|
||||
window_pane_stack_remove(stack, wp);
|
||||
TAILQ_INSERT_HEAD(stack, wp, sentry);
|
||||
wp->flags |= PANE_VISITED;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
window_pane_stack_remove(struct window_panes *stack, struct window_pane *wp)
|
||||
{
|
||||
if (wp != NULL && (wp->flags & PANE_VISITED)) {
|
||||
TAILQ_REMOVE(stack, wp, sentry);
|
||||
wp->flags &= ~PANE_VISITED;
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear alert flags for a winlink */
|
||||
void
|
||||
winlink_clear_flags(struct winlink *wl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue