summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-run-shell.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-03-08 10:34:20 +0000
committernicm <nicm@openbsd.org>2019-03-08 10:34:20 +0000
commitadfef3cc825948f47024d5fcc73db9b8e5347afd (patch)
treef8b08236873c96512f8f9d9a076b9743eca111ea /usr.bin/tmux/cmd-run-shell.c
parentDo not use window mode entry after free. (diff)
downloadwireguard-openbsd-adfef3cc825948f47024d5fcc73db9b8e5347afd.tar.xz
wireguard-openbsd-adfef3cc825948f47024d5fcc73db9b8e5347afd.zip
Make the mode used to view command output (a variant of copy mode) use
its own mode definition struct with a different init function rather than calling special setup functions.
Diffstat (limited to 'usr.bin/tmux/cmd-run-shell.c')
-rw-r--r--usr.bin/tmux/cmd-run-shell.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c
index 29ffcb440b8..a639197f886 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.56 2019/03/07 19:34:22 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.57 2019/03/08 10:34:20 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -75,7 +75,10 @@ cmd_run_shell_print(struct job *job, const char *msg)
return;
}
- window_copy_init_for_output(wp);
+ if (wp->mode == NULL || wp->mode->mode != &window_view_mode) {
+ window_pane_reset_mode(wp);
+ window_pane_set_mode(wp, &window_view_mode, NULL, NULL);
+ }
window_copy_add(wp, "%s", msg);
}