mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
LibVT: Support <esc>#8 to fill screen with E's
This is apparently a "confidence test" supported by VT100.
This commit is contained in:
parent
25f04b06ad
commit
ab77bd4c3a
2 changed files with 31 additions and 5 deletions
|
@ -774,16 +774,25 @@ void Terminal::on_char(u8 ch)
|
|||
#endif
|
||||
switch (m_escape_state) {
|
||||
case ExpectBracket:
|
||||
if (ch == '[')
|
||||
if (ch == '[') {
|
||||
m_escape_state = ExpectParameter;
|
||||
else if (ch == '(') {
|
||||
} else if (ch == '(') {
|
||||
m_swallow_current = true;
|
||||
m_escape_state = ExpectParameter;
|
||||
} else if (ch == ']')
|
||||
} else if (ch == ']') {
|
||||
m_escape_state = ExpectXtermParameter1;
|
||||
else
|
||||
} else if (ch == '#') {
|
||||
m_escape_state = ExpectHashtagDigit;
|
||||
} else {
|
||||
m_escape_state = Normal;
|
||||
}
|
||||
return;
|
||||
case ExpectHashtagDigit:
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
execute_hashtag(ch);
|
||||
m_escape_state = Normal;
|
||||
}
|
||||
break;
|
||||
case ExpectXtermParameter1:
|
||||
if (ch != ';') {
|
||||
m_xterm_param1.append(ch);
|
||||
|
@ -969,4 +978,20 @@ void Terminal::invalidate_cursor()
|
|||
line(m_cursor_row).dirty = true;
|
||||
}
|
||||
|
||||
void Terminal::execute_hashtag(u8 hashtag)
|
||||
{
|
||||
switch (hashtag) {
|
||||
case '8':
|
||||
// Confidence Test - Fill screen with E's
|
||||
for (size_t row = 0; row < m_rows; ++row) {
|
||||
for (size_t column = 0; column < m_columns; ++column) {
|
||||
put_character_at(row, column, 'E');
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dbg() << "Unknown hashtag: '" << hashtag << "'";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -195,6 +195,7 @@ private:
|
|||
|
||||
void execute_escape_sequence(u8 final);
|
||||
void execute_xterm_command();
|
||||
void execute_hashtag(u8);
|
||||
|
||||
enum EscapeState {
|
||||
Normal,
|
||||
|
@ -202,7 +203,7 @@ private:
|
|||
ExpectParameter,
|
||||
ExpectIntermediate,
|
||||
ExpectFinal,
|
||||
|
||||
ExpectHashtagDigit,
|
||||
ExpectXtermParameter1,
|
||||
ExpectXtermParameter2,
|
||||
ExpectXtermFinal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue