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.
This commit is contained in:
nicm
2019-03-08 10:34:20 +00:00
parent 9cc04a0f9a
commit de730f68a4
6 changed files with 66 additions and 51 deletions

View File

@ -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);
}