summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-run-shell.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-03-12 11:16:49 +0000
committernicm <nicm@openbsd.org>2019-03-12 11:16:49 +0000
commit2c8678f77a1ff1cce3579aa4c6553911c9f4dde2 (patch)
treea58e089f82315aac5e2eef457bff6c90afac2435 /usr.bin/tmux/cmd-run-shell.c
parentAlmost all terminals now support hardware tabs so default to OXTABS (diff)
downloadwireguard-openbsd-2c8678f77a1ff1cce3579aa4c6553911c9f4dde2.tar.xz
wireguard-openbsd-2c8678f77a1ff1cce3579aa4c6553911c9f4dde2.zip
Allow multiple modes to be open in a pane. A stack of open modes is kept
and the previous restored when the top is exited. If a mode that is already on the stack is entered, the existing instance is moved to the top as the active mode rather than being opened new.
Diffstat (limited to 'usr.bin/tmux/cmd-run-shell.c')
-rw-r--r--usr.bin/tmux/cmd-run-shell.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c
index a639197f886..f22d9b3ae43 100644
--- a/usr.bin/tmux/cmd-run-shell.c
+++ b/usr.bin/tmux/cmd-run-shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-run-shell.c,v 1.57 2019/03/08 10:34:20 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.58 2019/03/12 11:16:50 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -60,6 +60,7 @@ cmd_run_shell_print(struct job *job, const char *msg)
struct cmd_run_shell_data *cdata = job_get_data(job);
struct window_pane *wp = NULL;
struct cmd_find_state fs;
+ struct window_mode_entry *wme;
if (cdata->wp_id != -1)
wp = window_pane_find_by_id(cdata->wp_id);
@@ -75,10 +76,9 @@ cmd_run_shell_print(struct job *job, const char *msg)
return;
}
- if (wp->mode == NULL || wp->mode->mode != &window_view_mode) {
- window_pane_reset_mode(wp);
+ wme = TAILQ_FIRST(&wp->modes);
+ if (wme == NULL || wme->mode != &window_view_mode)
window_pane_set_mode(wp, &window_view_mode, NULL, NULL);
- }
window_copy_add(wp, "%s", msg);
}