summaryrefslogtreecommitdiff
path: root/Libraries/LibVT
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2020-05-29 22:13:51 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-30 15:01:18 +0200
commit66c6e0035e577e00d36c908554192abad052b6f4 (patch)
tree9e2196d35aac7dbfa41d9a2d2811be4c45b6d5c6 /Libraries/LibVT
parent52711921c636d6be2587744a55f0a782972e31ef (diff)
downloadserenity-66c6e0035e577e00d36c908554192abad052b6f4.zip
LibVT: Fix emitting \0 when pressing a modifier key
This causes the kernel to return EOF, which in turn confuses everything. This is a regression from the LibVT port of VirtualConsole.
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r--Libraries/LibVT/Terminal.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibVT/Terminal.cpp b/Libraries/LibVT/Terminal.cpp
index d35f64066e..22af6fa62b 100644
--- a/Libraries/LibVT/Terminal.cpp
+++ b/Libraries/LibVT/Terminal.cpp
@@ -1046,6 +1046,11 @@ void Terminal::handle_key_press(KeyCode key, u8 character, u8 flags)
break;
}
+ if (!character) {
+ // Probably a modifier being pressed.
+ return;
+ }
+
if (shift && key == KeyCode::Key_Tab) {
emit_string("\033[Z");
return;