diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-11-19 08:33:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 08:33:48 +0000 |
commit | 42d89899162164128364c503cee29dc65103d55d (patch) | |
tree | 8e1511b4a5438272d1e9e958107a04f061b720d5 /src/input.rs | |
parent | e429b8dfdda3228838cd839783d17376a65b44fe (diff) | |
download | alacritty-42d89899162164128364c503cee29dc65103d55d.tar.gz alacritty-42d89899162164128364c503cee29dc65103d55d.zip |
Add keybinding action for clearing warns/errors
Since running `clear` inside of tmux doesn't actually clear any part of
the screen, but just resets the scrolling region, the warning and error
notices can't be removed without quitting tmux or Alacritty.
As a solution, a new action `ClearLogNotice` has been added which has
been bound to Ctrl+L by default. As a result, Ctrl+L can be used inside
of tmux to remove the messages, even though tmux doesn't clear the
screen.
This fixes #1811.
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs index d2f8f6b5..051a38db 100644 --- a/src/input.rs +++ b/src/input.rs @@ -76,6 +76,7 @@ pub trait ActionContext { fn clear_history(&mut self); fn hide_window(&mut self); fn url(&self, _: Point<usize>) -> Option<String>; + fn clear_log(&mut self); } /// Describes a state and action to take in that state @@ -200,6 +201,9 @@ pub enum Action { /// Quits Alacritty. Quit, + + /// Clears warning and error notices. + ClearLogNotice, } impl Action { @@ -292,6 +296,9 @@ impl Action { Action::ClearHistory => { ctx.clear_history(); }, + Action::ClearLogNotice => { + ctx.clear_log(); + } } } @@ -885,6 +892,7 @@ mod tests { } fn hide_window(&mut self) { } + fn clear_log(&mut self) {} } macro_rules! test_clickstate { |