Clear terminal selection on escape

This commit is contained in:
Jeremy Soller 2024-01-11 14:37:18 -07:00
parent ac4472e45e
commit b38927364c
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -584,7 +584,15 @@ where
status = Status::Captured;
}
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;
}
KeyCode::Up => {