terminal: Fix certain keys being incorrectly inputted
This commit is contained in:
parent
0cb21c2e90
commit
bc14b01bf8
@ -88,7 +88,11 @@ Result<void> TerminalWidget::init(char* const* args)
|
|||||||
|
|
||||||
Result<ui::EventResult> TerminalWidget::handle_key_event(const ui::KeyEventRequest& request)
|
Result<ui::EventResult> TerminalWidget::handle_key_event(const ui::KeyEventRequest& request)
|
||||||
{
|
{
|
||||||
|
// Avoid handling "key released" events
|
||||||
if (!request.pressed) return ui::EventResult::DidNotHandle;
|
if (!request.pressed) return ui::EventResult::DidNotHandle;
|
||||||
|
// Non-printable key or key that has no special character (unlike Tab or Enter). We exit early to avoid inserting an
|
||||||
|
// invalid zero byte into the terminal input (this would also happen on Shift or Ctrl keypresses).
|
||||||
|
if (request.letter == '\0') return ui::EventResult::DidNotHandle;
|
||||||
|
|
||||||
query_termios();
|
query_termios();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user