The branch, master has been updated via 2874a431c050527244a56e7f241baf053c722f88 (commit) via 21062d74d5373699aad9fe8d77bd5312a33e9834 (commit) via 9bda7e881a01af4deabeccc7a292d873c9c7f4e6 (commit) via 8a473b57576a7deab9f498db1399b0d798fb45b2 (commit) via 733cea8847fadf922e239f05b4cdd8afc2f6c943 (commit) via 4e956d545a52fe6b8310cfb30a26a89976d55cd9 (commit) via e07519804957d5c41aa70e7f1132e29fe5f84862 (commit) via 2b79d366528294b80960f3a7ed0923bfa0bdc89c (commit) via 29d20a55b645600feca1b54a13333e598336dad2 (commit) via f518a077b176e65a30a187af21b00b0b9031dad7 (commit) from 5e7f1b9f0a5bcff8f9ba410c17de4e822428614c (commit)
- Log ----------------------------------------------------------------- commit 2874a431c050527244a56e7f241baf053c722f88 Merge: 5e7f1b9 21062d7 Author: Thomas Adam <tho...@xteddy.org> Commit: Thomas Adam <tho...@xteddy.org> Merge branch 'obsd-master' client.c | 4 ++-- cmd-list.c | 2 +- cmd-load-buffer.c | 2 +- cmd-new-window.c | 2 +- cmd-queue.c | 6 +++--- cmd-select-pane.c | 34 +++++++++++++++++++++++----------- cmd-set-option.c | 4 ++-- cmd-split-window.c | 2 +- cmd-wait-for.c | 26 ++++++++++++++++++++++++-- format.c | 5 ++++- grid.c | 12 +++++------- mode-key.c | 1 + paste.c | 7 +++++-- screen.c | 23 ++++++++++++++++++----- server-client.c | 2 +- server.c | 18 +++++++++++++++++- tmux.1 | 21 +++++++++++++++++---- tmux.h | 7 ++++++- window-copy.c | 7 ++++--- window.c | 7 ++++--- 20 files changed, 140 insertions(+), 52 deletions(-) commit 21062d74d5373699aad9fe8d77bd5312a33e9834 Author: nicm <nicm> Commit: nicm <nicm> Fix some comments (c -> colour) and join unnecessary line splits. --- grid.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/grid.c b/grid.c index 784ff72..afb0e04 100644 --- a/grid.c +++ b/grid.c @@ -514,20 +514,18 @@ grid_string_cells_code(const struct grid_cell *lastgc, s[n++] = attrs[i].code; } - /* If the foreground c changed, append its parameters. */ + /* If the foreground colour changed, append its parameters. */ nnewc = grid_string_cells_fg(gc, newc); noldc = grid_string_cells_fg(lastgc, oldc); - if (nnewc != noldc || - memcmp(newc,oldc, nnewc * sizeof newc[0]) != 0) { + if (nnewc != noldc || memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) { for (i = 0; i < nnewc; i++) s[n++] = newc[i]; } - /* If the background c changed, append its parameters. */ + /* If the background colour changed, append its parameters. */ nnewc = grid_string_cells_bg(gc, newc); noldc = grid_string_cells_bg(lastgc, oldc); - if (nnewc != noldc || - memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) { + if (nnewc != noldc || memcmp(newc, oldc, nnewc * sizeof newc[0]) != 0) { for (i = 0; i < nnewc; i++) s[n++] = newc[i]; } commit 9bda7e881a01af4deabeccc7a292d873c9c7f4e6 Author: nicm <nicm> Commit: nicm <nicm> Add window_last_flag and window_zoomed_flag. From John Morrissey. --- format.c | 5 ++++- tmux.1 | 2 ++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/format.c b/format.c index 400e432..ed3c203 100644 --- a/format.c +++ b/format.c @@ -494,7 +494,10 @@ format_winlink(struct format_tree *ft, struct session *s, struct winlink *wl) !!(wl->flags & WINLINK_ACTIVITY)); format_add(ft, "window_silence_flag", "%u", !!(wl->flags & WINLINK_SILENCE)); - + format_add(ft, "window_last_flag", "%u", + !!(wl == TAILQ_FIRST(&s->lastw))); + format_add(ft, "window_zoomed_flag", "%u", + !!(wl->flags & WINDOW_ZOOMED)); free(flags); } diff --git a/tmux.1 b/tmux.1 index e2ff7fc..4e86e9c 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3132,11 +3132,13 @@ The following variables are available, where appropriate: .It Li "window_height" Ta "" Ta "Height of window" .It Li "window_id" Ta "" Ta "Unique window ID" .It Li "window_index" Ta "#I" Ta "Index of window" +.It Li "window_last_flag" Ta "" Ta "1 if window is the last used" .It Li "window_layout" Ta "" Ta "Window layout description" .It Li "window_name" Ta "#W" Ta "Name of window" .It Li "window_panes" Ta "" Ta "Number of panes in window" .It Li "window_silence_flag" Ta "" Ta "1 if window has silence alert" .It Li "window_width" Ta "" Ta "Width of window" +.It Li "window_zoomed_flag" Ta "" Ta "1 if window is zoomed" .It Li "wrap_flag" Ta "" Ta "Pane wrap flag" .El .Sh NAMES AND TITLES commit 8a473b57576a7deab9f498db1399b0d798fb45b2 Author: nicm <nicm> Commit: nicm <nicm> Fix typo (paneas -> panes). --- tmux.1 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tmux.1 b/tmux.1 index ab51689..e2ff7fc 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2436,7 +2436,7 @@ see the option. Attributes are ignored. .It Ic pane-border-style Ar style -Set the pane border style for paneas aside from the active pane. +Set the pane border style for panes aside from the active pane. For how to specify .Ar style , see the commit 733cea8847fadf922e239f05b4cdd8afc2f6c943 Author: nicm <nicm> Commit: nicm <nicm> Wake up any clients waiting with the wait-for command when the server exits. --- cmd-wait-for.c | 22 ++++++++++++++++++++++ server.c | 18 +++++++++++++++++- tmux.h | 3 +++ 3 files changed, 42 insertions(+), 1 deletions(-) diff --git a/cmd-wait-for.c b/cmd-wait-for.c index 3654d4e..48a6fe3 100644 --- a/cmd-wait-for.c +++ b/cmd-wait-for.c @@ -194,3 +194,25 @@ cmd_wait_for_unlock(struct cmd_q *cmdq, const char *name, return (CMD_RETURN_NORMAL); } +void +cmd_wait_for_flush(void) +{ + struct wait_channel *wc, *wc1; + struct cmd_q *wq, *wq1; + + RB_FOREACH_SAFE(wc, wait_channels, &wait_channels, wc1) { + TAILQ_FOREACH_SAFE(wq, &wc->waiters, waitentry, wq1) { + TAILQ_REMOVE(&wc->waiters, wq, waitentry); + if (!cmdq_free(wq)) + cmdq_continue(wq); + } + while ((wq = TAILQ_FIRST(&wc->lockers)) != NULL) { + TAILQ_REMOVE(&wc->lockers, wq, waitentry); + if (!cmdq_free(wq)) + cmdq_continue(wq); + } + RB_REMOVE(wait_channels, &wait_channels, wc); + free((void *)wc->name); + free(wc); + } +} diff --git a/server.c b/server.c index 2cab88f..acf5aaf 100644 --- a/server.c +++ b/server.c @@ -217,16 +217,30 @@ server_loop(void) int server_should_shutdown(void) { - u_int i; + struct client *c; + u_int i; if (!options_get_number(&global_options, "exit-unattached")) { if (!RB_EMPTY(&sessions)) return (0); } + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c != NULL && c->session != NULL) + return (0); + } + + /* + * No attached clients therefore want to exit - flush any waiting + * clients but don't actually exit until they've gone. + */ + cmd_wait_for_flush(); for (i = 0; i < ARRAY_LENGTH(&clients); i++) { if (ARRAY_ITEM(&clients, i) != NULL) return (0); } + return (1); } @@ -238,6 +252,8 @@ server_send_shutdown(void) struct session *s, *next_s; u_int i; + cmd_wait_for_flush(); + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); if (c != NULL) { diff --git a/tmux.h b/tmux.h index c64459b..9be247f 100644 --- a/tmux.h +++ b/tmux.h @@ -1924,6 +1924,9 @@ void cmdq_flush(struct cmd_q *); int cmd_string_parse(const char *, struct cmd_list **, const char *, u_int, char **); +/* cmd-wait-for.c */ +void cmd_wait_for_flush(void); + /* client.c */ int client_main(int, char **, int); commit 4e956d545a52fe6b8310cfb30a26a89976d55cd9 Author: nicm <nicm> Commit: nicm <nicm> Various minor style and spacing nits. --- client.c | 4 ++-- cmd-list.c | 2 +- cmd-load-buffer.c | 2 +- cmd-new-window.c | 2 +- cmd-queue.c | 6 +++--- cmd-set-option.c | 4 ++-- cmd-split-window.c | 2 +- cmd-wait-for.c | 4 ++-- grid.c | 2 +- paste.c | 4 ++-- screen.c | 2 +- server-client.c | 2 +- tmux.h | 2 +- window-copy.c | 4 ++-- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/client.c b/client.c index f5f5556..e92724a 100644 --- a/client.c +++ b/client.c @@ -311,7 +311,7 @@ client_main(int argc, char **argv, int flags) /* Prepare command for server. */ data->argc = argc; - if (cmd_pack_argv(argc, argv, (char*)(data + 1), size) != 0) { + if (cmd_pack_argv(argc, argv, (char *)(data + 1), size) != 0) { fprintf(stderr, "command too long\n"); free(data); return (1); @@ -393,7 +393,7 @@ client_write_one(enum msgtype type, int fd, const void *buf, size_t len) int retval; retval = imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, fd, - (void*)buf, len); + (void *)buf, len); if (retval != 1) return (-1); return (0); diff --git a/cmd-list.c b/cmd-list.c index 6dc4493..0c75ed4 100644 --- a/cmd-list.c +++ b/cmd-list.c @@ -24,7 +24,7 @@ #include "tmux.h" struct cmd_list * -cmd_list_parse(int argc, char **argv, const char* file, u_int line, +cmd_list_parse(int argc, char **argv, const char *file, u_int line, char **cause) { struct cmd_list *cmdlist; diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c index 6c69391..26d6297 100644 --- a/cmd-load-buffer.c +++ b/cmd-load-buffer.c @@ -62,7 +62,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq) path = args->argv[0]; if (strcmp(path, "-") == 0) { error = server_set_stdin_callback(c, cmd_load_buffer_callback, - (void*)bufname, &cause); + (void *)bufname, &cause); if (error != 0) { cmdq_error(cmdq, "%s: %s", path, cause); free(cause); diff --git a/cmd-new-window.c b/cmd-new-window.c index fc2eb12..00fa53f 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -88,7 +88,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) cmd = options_get_string(&s->options, "default-command"); if (cmd != NULL && *cmd != '\0') { argc = 1; - argv = (char**)&cmd; + argv = (char **)&cmd; } else { argc = 0; argv = NULL; diff --git a/cmd-queue.c b/cmd-queue.c index 7bc154a..77460b2 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -124,14 +124,14 @@ cmdq_guard(struct cmd_q *cmdq, const char *guard, int flags) struct client *c = cmdq->client; if (c == NULL) - return 0; + return (0); if (!(c->flags & CLIENT_CONTROL)) - return 0; + return (0); evbuffer_add_printf(c->stdout_data, "%%%s %ld %u %d\n", guard, (long) cmdq->time, cmdq->number, flags); server_push_stdout(c); - return 1; + return (1); } /* Add command list to queue and begin processing if needed. */ diff --git a/cmd-set-option.c b/cmd-set-option.c index d4743d5..5cea493 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -201,7 +201,7 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq) /* Set user option. */ enum cmd_retval -cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr, +cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char *optstr, const char *valstr) { struct args *args = self->args; @@ -254,7 +254,7 @@ cmd_set_option_user(struct cmd *self, struct cmd_q *cmdq, const char* optstr, if (args_has(args, 'o') && options_find1(oo, optstr) != NULL) { if (!args_has(args, 'q')) { cmdq_error(cmdq, "already set: %s", optstr); - return CMD_RETURN_ERROR; + return (CMD_RETURN_ERROR); } return (CMD_RETURN_NORMAL); } diff --git a/cmd-split-window.c b/cmd-split-window.c index 5523113..8a608bd 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -85,7 +85,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) cmd = options_get_string(&s->options, "default-command"); if (cmd != NULL && *cmd != '\0') { argc = 1; - argv = (char**)&cmd; + argv = (char **)&cmd; } else { argc = 0; argv = NULL; diff --git a/cmd-wait-for.c b/cmd-wait-for.c index 42c7f42..3654d4e 100644 --- a/cmd-wait-for.c +++ b/cmd-wait-for.c @@ -108,7 +108,7 @@ cmd_wait_for_signal(struct cmd_q *cmdq, const char *name, if (!wc->locked) { RB_REMOVE(wait_channels, &wait_channels, wc); - free((void*) wc->name); + free((void *)wc->name); free(wc); } @@ -186,7 +186,7 @@ cmd_wait_for_unlock(struct cmd_q *cmdq, const char *name, wc->locked = 0; if (TAILQ_EMPTY(&wc->waiters)) { RB_REMOVE(wait_channels, &wait_channels, wc); - free((void*) wc->name); + free((void *)wc->name); free(wc); } } diff --git a/grid.c b/grid.c index 2821018..784ff72 100644 --- a/grid.c +++ b/grid.c @@ -572,7 +572,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, const struct grid_cell *gc; static struct grid_cell lastgc1; struct utf8_data ud; - const char* data; + const char *data; char *buf, code[128]; size_t len, off, size, codelen; u_int xx; diff --git a/paste.c b/paste.c index 586fbec..e8ea0c3 100644 --- a/paste.c +++ b/paste.c @@ -102,7 +102,7 @@ paste_get_name(const char *name) if (name == NULL || *name == '\0') return (NULL); - pbfind.name = (char*)name; + pbfind.name = (char *)name; return (RB_FIND(paste_name_tree, &paste_by_name, &pbfind)); } @@ -115,7 +115,7 @@ paste_free_name(const char *name) if (name == NULL || *name == '\0') return (-1); - pbfind.name = (char*)name; + pbfind.name = (char *)name; pb = RB_FIND(paste_name_tree, &paste_by_name, &pbfind); if (pb == NULL) return (-1); diff --git a/screen.c b/screen.c index 3e7d992..703f3e1 100644 --- a/screen.c +++ b/screen.c @@ -327,7 +327,7 @@ screen_check_selection(struct screen *s, u_int px, u_int py) return (0); if (py == sel->sy && px < sel->sx) - return 0; + return (0); if (py == sel->ey && px > sel->ex) return (0); diff --git a/server-client.c b/server-client.c index 4c58170..093f0a1 100644 --- a/server-client.c +++ b/server-client.c @@ -914,7 +914,7 @@ server_client_msg_command(struct client *c, struct imsg *imsg) fatalx("bad MSG_COMMAND size"); memcpy(&data, imsg->data, sizeof data); - buf = (char*)imsg->data + sizeof data; + buf = (char *)imsg->data + sizeof data; len = imsg->hdr.len - IMSG_HEADER_SIZE - sizeof data; if (len > 0 && buf[len - 1] != '\0') fatalx("bad MSG_COMMAND string"); diff --git a/tmux.h b/tmux.h index bfc7054..c64459b 100644 --- a/tmux.h +++ b/tmux.h @@ -2325,7 +2325,7 @@ void set_signals(void(*)(int, short, void *)); void clear_signals(int); /* control.c */ -void control_callback(struct client *, int, void*); +void control_callback(struct client *, int, void *); void printflike2 control_write(struct client *, const char *, ...); void control_write_buffer(struct client *, struct evbuffer *); diff --git a/window-copy.c b/window-copy.c index cb8ef57..c9ddf84 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1498,8 +1498,8 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess, void window_copy_copy_selection(struct window_pane *wp, const char *bufname) { - void* buf; - size_t len; + void *buf; + size_t len; buf = window_copy_get_selection(wp, &len); if (buf == NULL) commit e07519804957d5c41aa70e7f1132e29fe5f84862 Author: nicm <nicm> Commit: nicm <nicm> Don't allow pasting into input-disabled panes, from Anish R Athalye. --- paste.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/paste.c b/paste.c index 08f4bab..586fbec 100644 --- a/paste.c +++ b/paste.c @@ -298,6 +298,9 @@ paste_send_pane(struct paste_buffer *pb, struct window_pane *wp, const char *data = pb->data, *end = data + pb->size, *lf; size_t seplen; + if (wp->flags & PANE_INPUTOFF) + return; + if (bracket) bufferevent_write(wp->event, "\033[200~", 6); commit 2b79d366528294b80960f3a7ed0923bfa0bdc89c Author: nicm <nicm> Commit: nicm <nicm> No need to repeat other-end more than once, from Juho Pohjala. Also add it to the commands list while here. --- mode-key.c | 1 + window-copy.c | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/mode-key.c b/mode-key.c index c2bc043..77e7b69 100644 --- a/mode-key.c +++ b/mode-key.c @@ -130,6 +130,7 @@ const struct mode_key_cmdstr mode_key_cmdstr_copy[] = { { MODEKEYCOPY_NEXTSPACEEND, "next-space-end" }, { MODEKEYCOPY_NEXTWORD, "next-word" }, { MODEKEYCOPY_NEXTWORDEND, "next-word-end" }, + { MODEKEYCOPY_OTHEREND, "other-end" }, { MODEKEYCOPY_PREVIOUSPAGE, "page-up" }, { MODEKEYCOPY_PREVIOUSSPACE, "previous-space" }, { MODEKEYCOPY_PREVIOUSWORD, "previous-word" }, diff --git a/window-copy.c b/window-copy.c index 24f9412..cb8ef57 100644 --- a/window-copy.c +++ b/window-copy.c @@ -429,7 +429,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) window_pane_reset_mode(wp); return; case MODEKEYCOPY_OTHEREND: - for (; np != 0; np--) + if (np % 2) window_copy_other_end(wp); break; case MODEKEYCOPY_LEFT: commit 29d20a55b645600feca1b54a13333e598336dad2 Author: nicm <nicm> Commit: nicm <nicm> Fix two copy mode problems: 1. In vi mode the selection doesn't include the last character if you moved the cursor up or left. 2. In emacs mode the selection includes the last character if you moved the cursor to the left. From Balazs Kezes. --- screen.c | 23 ++++++++++++++++++----- tmux.h | 1 + window-copy.c | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/screen.c b/screen.c index 2b0e9fb..3e7d992 100644 --- a/screen.c +++ b/screen.c @@ -276,6 +276,7 @@ int screen_check_selection(struct screen *s, u_int px, u_int py) { struct screen_sel *sel = &s->sel; + u_int xx; if (!sel->flag) return (0); @@ -325,16 +326,24 @@ screen_check_selection(struct screen *s, u_int px, u_int py) if (py < sel->sy || py > sel->ey) return (0); - if ((py == sel->sy && px < sel->sx) - || (py == sel->ey && px > sel->ex)) + if (py == sel->sy && px < sel->sx) + return 0; + + if (py == sel->ey && px > sel->ex) return (0); } else if (sel->sy > sel->ey) { /* starting line > ending line -- upward selection. */ if (py > sel->sy || py < sel->ey) return (0); - if ((py == sel->sy && px >= sel->sx) - || (py == sel->ey && px < sel->ex)) + if (py == sel->ey && px < sel->ex) + return (0); + + if (sel->modekeys == MODEKEY_EMACS) + xx = sel->sx - 1; + else + xx = sel->sx; + if (py == sel->sy && px > xx) return (0); } else { /* starting line == ending line. */ @@ -343,7 +352,11 @@ screen_check_selection(struct screen *s, u_int px, u_int py) if (sel->ex < sel->sx) { /* cursor (ex) is on the left */ - if (px > sel->sx || px < sel->ex) + if (sel->modekeys == MODEKEY_EMACS) + xx = sel->sx - 1; + else + xx = sel->sx; + if (px > xx || px < sel->ex) return (0); } else { /* selection start (sx) is on the left */ diff --git a/tmux.h b/tmux.h index a0cbbd4..bfc7054 100644 --- a/tmux.h +++ b/tmux.h @@ -794,6 +794,7 @@ LIST_HEAD(joblist, job); struct screen_sel { int flag; int rectflag; + int modekeys; u_int sx; u_int sy; diff --git a/window-copy.c b/window-copy.c index 17f9751..24f9412 100644 --- a/window-copy.c +++ b/window-copy.c @@ -199,6 +199,7 @@ window_copy_init(struct window_pane *wp) mode_key_init(&data->mdata, &mode_key_tree_emacs_copy); else mode_key_init(&data->mdata, &mode_key_tree_vi_copy); + s->sel.modekeys = keys; data->backing = NULL; commit f518a077b176e65a30a187af21b00b0b9031dad7 Author: nicm <nicm> Commit: nicm <nicm> Add flags to selectp to enable and disable input to a pane, from Anish Athalye. --- cmd-select-pane.c | 34 +++++++++++++++++++++++----------- tmux.1 | 17 ++++++++++++++--- tmux.h | 1 + window.c | 7 ++++--- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/cmd-select-pane.c b/cmd-select-pane.c index 1a1072d..a491c43 100644 --- a/cmd-select-pane.c +++ b/cmd-select-pane.c @@ -29,8 +29,8 @@ enum cmd_retval cmd_select_pane_exec(struct cmd *, struct cmd_q *); const struct cmd_entry cmd_select_pane_entry = { "select-pane", "selectp", - "lDLRt:U", 0, 0, - "[-lDLRU] " CMD_TARGET_PANE_USAGE, + "DdeLlRt:U", 0, 0, + "[-DdeLlRU] " CMD_TARGET_PANE_USAGE, 0, cmd_select_pane_key_binding, cmd_select_pane_exec @@ -38,8 +38,8 @@ const struct cmd_entry cmd_select_pane_entry = { const struct cmd_entry cmd_last_pane_entry = { "last-pane", "lastp", - "t:", 0, 0, - CMD_TARGET_WINDOW_USAGE, + "det:", 0, 0, + "[-de] " CMD_TARGET_WINDOW_USAGE, 0, NULL, cmd_select_pane_exec @@ -78,10 +78,16 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); } - server_unzoom_window(wl->window); - window_set_active_pane(wl->window, wl->window->last); - server_status_window(wl->window); - server_redraw_window_borders(wl->window); + if (args_has(self->args, 'e')) + wl->window->last->flags &= ~PANE_INPUTOFF; + else if (args_has(self->args, 'd')) + wl->window->last->flags |= PANE_INPUTOFF; + else { + server_unzoom_window(wl->window); + window_set_active_pane(wl->window, wl->window->last); + server_status_window(wl->window); + server_redraw_window_borders(wl->window); + } return (CMD_RETURN_NORMAL); } @@ -108,9 +114,15 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_ERROR); } - window_set_active_pane(wl->window, wp); - server_status_window(wl->window); - server_redraw_window_borders(wl->window); + if (args_has(self->args, 'e')) + wp->flags &= ~PANE_INPUTOFF; + else if (args_has(self->args, 'd')) + wp->flags |= PANE_INPUTOFF; + else { + window_set_active_pane(wl->window, wp); + server_status_window(wl->window); + server_redraw_window_borders(wl->window); + } return (CMD_RETURN_NORMAL); } diff --git a/tmux.1 b/tmux.1 index f70ac39..ab51689 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1292,7 +1292,7 @@ flag, see the section. This command works only if at least one client is attached. .It Ic display-panes Op Fl t Ar target-client -.D1 (alias: Ic displayp) +.D1 (alias: Ic displayp ) Display a visible indicator of each pane shown by .Ar target-client . See the @@ -1382,9 +1382,16 @@ The .Fl a option kills all but the window given with .Fl t . -.It Ic last-pane Op Fl t Ar target-window +.It Xo Ic last-pane +.Op Fl de +.Op Fl t Ar target-window +.Xc .D1 (alias: Ic lastp ) Select the last (previously selected) pane. +.Fl e +enables or +.Fl d +disables input to the pane. .It Ic last-window Op Fl t Ar target-session .D1 (alias: Ic last ) Select the last (previously selected) window. @@ -1701,7 +1708,7 @@ and .Ic previous-layout commands. .It Xo Ic select-pane -.Op Fl lDLRU +.Op Fl DdeLlRU .Op Fl t Ar target-pane .Xc .D1 (alias: Ic selectp ) @@ -1721,6 +1728,10 @@ target pane is used. is the same as using the .Ic last-pane command. +.Fl e +enables or +.Fl d +disables input to the pane. .It Xo Ic select-window .Op Fl lnpT .Op Fl t Ar target-window diff --git a/tmux.h b/tmux.h index 614b707..a0cbbd4 100644 --- a/tmux.h +++ b/tmux.h @@ -956,6 +956,7 @@ struct window_pane { #define PANE_FOCUSED 0x4 #define PANE_RESIZE 0x8 #define PANE_FOCUSPUSH 0x10 +#define PANE_INPUTOFF 0x20 int argc; char **argv; diff --git a/window.c b/window.c index a0c53ca..21dd8d5 100644 --- a/window.c +++ b/window.c @@ -1057,8 +1057,9 @@ window_pane_key(struct window_pane *wp, struct session *sess, int key) return; } - if (wp->fd == -1) + if (wp->fd == -1 || wp->flags & PANE_INPUTOFF) return; + input_key(wp, key); if (options_get_number(&wp->window->options, "synchronize-panes")) { TAILQ_FOREACH(wp2, &wp->window->panes, entry) { @@ -1071,8 +1072,8 @@ window_pane_key(struct window_pane *wp, struct session *sess, int key) } void -window_pane_mouse( - struct window_pane *wp, struct session *sess, struct mouse_event *m) +window_pane_mouse(struct window_pane *wp, struct session *sess, + struct mouse_event *m) { if (!window_pane_visible(wp)) return; ----------------------------------------------------------------------- Summary of changes: client.c | 4 ++-- cmd-list.c | 2 +- cmd-load-buffer.c | 2 +- cmd-new-window.c | 2 +- cmd-queue.c | 6 +++--- cmd-select-pane.c | 34 +++++++++++++++++++++++----------- cmd-set-option.c | 4 ++-- cmd-split-window.c | 2 +- cmd-wait-for.c | 26 ++++++++++++++++++++++++-- format.c | 5 ++++- grid.c | 12 +++++------- mode-key.c | 1 + paste.c | 7 +++++-- screen.c | 23 ++++++++++++++++++----- server-client.c | 2 +- server.c | 18 +++++++++++++++++- tmux.1 | 21 +++++++++++++++++---- tmux.h | 7 ++++++- window-copy.c | 7 ++++--- window.c | 7 ++++--- 20 files changed, 140 insertions(+), 52 deletions(-) hooks/post-receive -- tmux ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ tmux-cvs mailing list tmux-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-cvs