Skip to content

Instantly share code, notes, and snippets.

@ThomasAdam
Created October 23, 2013 20:33
Show Gist options
  • Select an option

  • Save ThomasAdam/7126171 to your computer and use it in GitHub Desktop.

Select an option

Save ThomasAdam/7126171 to your computer and use it in GitHub Desktop.
Don't allow clear-history to run if pane is in a mode
diff --git a/cmd-clear-history.c b/cmd-clear-history.c
index cce3ea1..8b16215 100644
--- a/cmd-clear-history.c
+++ b/cmd-clear-history.c
@@ -44,6 +44,10 @@ cmd_clear_history_exec(struct cmd *self, struct cmd_q *cmdq)
if (cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp) == NULL)
return (CMD_RETURN_ERROR);
+
+ if (wp->mode == &window_copy_mode)
+ return (CMD_RETURN_ERROR);
+
gd = wp->base.grid;
grid_move_lines(gd, 0, gd->hsize, gd->sy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment