summaryrefslogtreecommitdiffstats
path: root/cmd-run-shell.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-12 11:16:49 +0000
committernicm <nicm>2019-03-12 11:16:49 +0000
commit3f6bfbaf2babcc7f08f628a82ff31b0b52014e58 (patch)
treece4bf0c954cdfede0c2e86905bd85a9f565ed370 /cmd-run-shell.c
parentff4c80d53df96bb46eaa64107673e42d402f0d49 (diff)
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 'cmd-run-shell.c')
-rw-r--r--cmd-run-shell.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd-run-shell.c b/cmd-run-shell.c
index 8e99f90b..c9a478c7 100644
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@ -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);
}