diff options
author | Linus Groh <mail@linusgroh.de> | 2020-01-26 14:21:54 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-26 15:58:06 +0100 |
commit | fd8c2508664a0bb89529c1f35d028ac3e5e06404 (patch) | |
tree | 188db6fef4fce67f2cf369ae7ab51885421a663c /Libraries/LibVT | |
parent | be57b813367113b772eaca489e23df992e9922c8 (diff) | |
download | serenity-fd8c2508664a0bb89529c1f35d028ac3e5e06404.zip |
LibVT: Replace escape$h_l with SM (Set Mode) / RM (Reset Mode)
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r-- | Libraries/LibVT/Terminal.cpp | 19 | ||||
-rw-r--r-- | Libraries/LibVT/Terminal.h | 5 |
2 files changed, 20 insertions, 4 deletions
diff --git a/Libraries/LibVT/Terminal.cpp b/Libraries/LibVT/Terminal.cpp index b82e281e83..d504247d0e 100644 --- a/Libraries/LibVT/Terminal.cpp +++ b/Libraries/LibVT/Terminal.cpp @@ -124,7 +124,7 @@ inline bool is_valid_final_character(u8 ch) return ch >= 0x40 && ch <= 0x7e; } -void Terminal::escape$h_l(bool should_set, bool question_param, const ParamVector& params) +void Terminal::alter_mode(bool should_set, bool question_param, const ParamVector& params) { int mode = 2; if (params.size() > 0) { @@ -153,6 +153,19 @@ void Terminal::escape$h_l(bool should_set, bool question_param, const ParamVecto } } +void Terminal::RM(bool question_param, const ParamVector& params) +{ + // RM – Reset Mode + alter_mode(true, question_param, params); +} + +void Terminal::SM(bool question_param, const ParamVector& params) +{ + // SM – Set Mode + alter_mode(false, question_param, params); +} + + void Terminal::SGR(const ParamVector& params) { // SGR – Select Graphic Rendition @@ -679,10 +692,10 @@ void Terminal::execute_escape_sequence(u8 final) escape$r(params); break; case 'l': - escape$h_l(true, question_param, params); + RM(question_param, params); break; case 'h': - escape$h_l(false, question_param, params); + SM(question_param, params); break; case 'c': DA(params); diff --git a/Libraries/LibVT/Terminal.h b/Libraries/LibVT/Terminal.h index d85917048c..b02dca2de5 100644 --- a/Libraries/LibVT/Terminal.h +++ b/Libraries/LibVT/Terminal.h @@ -148,6 +148,8 @@ private: void emit_string(const StringView&); + void alter_mode(bool, bool, const ParamVector&); + void CUU(const ParamVector&); void CUD(const ParamVector&); void CUF(const ParamVector&); @@ -169,7 +171,8 @@ private: void escape$S(const ParamVector&); void escape$T(const ParamVector&); void escape$L(const ParamVector&); - void escape$h_l(bool, bool, const ParamVector&); + void RM(bool, const ParamVector&); + void SM(bool, const ParamVector&); void DA(const ParamVector&); void HVP(const ParamVector&); void NEL(); |