summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibVT
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-20 16:58:34 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-20 17:04:46 +0100
commit81b21504a7ba1188a735e7ed4a983eeb79df05aa (patch)
tree1aa601f53aad5371dd4929ac533e27adf74f2ad1 /Userland/Libraries/LibVT
parent8c9ae4e537481873a9ecc7d513ae29ac97a67ae7 (diff)
downloadserenity-81b21504a7ba1188a735e7ed4a983eeb79df05aa.zip
LibVT: Implement switching between 80/132 column modes (DECCOLM)
This gets us past a few more screens in vttest. :^)
Diffstat (limited to 'Userland/Libraries/LibVT')
-rw-r--r--Userland/Libraries/LibVT/Terminal.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibVT/Terminal.cpp b/Userland/Libraries/LibVT/Terminal.cpp
index 3ab590470d..ed06b6bab1 100644
--- a/Userland/Libraries/LibVT/Terminal.cpp
+++ b/Userland/Libraries/LibVT/Terminal.cpp
@@ -88,6 +88,14 @@ void Terminal::alter_mode(bool should_set, bool question_param, const ParamVecto
}
} else {
switch (mode) {
+ case 3: {
+ // 80/132-column mode (DECCOLM)
+ unsigned new_columns = should_set ? 80 : 132;
+ dbgln("Setting {}-column mode", new_columns);
+ set_size(new_columns, rows());
+ clear();
+ break;
+ }
case 25:
// Hide cursor command, but doesn't need to be run (for now, because
// we don't do inverse control codes anyways)
@@ -97,6 +105,7 @@ void Terminal::alter_mode(bool should_set, bool question_param, const ParamVecto
dbgln("Terminal: Show Cursor escapecode received. Not needed: ignored.");
break;
default:
+ dbgln("Set Mode: Unimplemented mode {}", mode);
break;
}
}