Clear terminal selection on escape
This commit is contained in:
parent
ac4472e45e
commit
b38927364c
1 changed files with 9 additions and 1 deletions
|
|
@ -584,7 +584,15 @@ where
|
||||||
status = Status::Captured;
|
status = Status::Captured;
|
||||||
}
|
}
|
||||||
KeyCode::Escape => {
|
KeyCode::Escape => {
|
||||||
terminal.input_scroll(b"\x1B".as_slice());
|
let had_selection = {
|
||||||
|
let mut term = terminal.term.lock();
|
||||||
|
term.selection.take().is_some()
|
||||||
|
};
|
||||||
|
if had_selection {
|
||||||
|
terminal.update();
|
||||||
|
} else {
|
||||||
|
terminal.input_scroll(b"\x1B".as_slice());
|
||||||
|
}
|
||||||
status = Status::Captured;
|
status = Status::Captured;
|
||||||
}
|
}
|
||||||
KeyCode::Up => {
|
KeyCode::Up => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue