mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
LibVT: Implement DECFI
and DECBI
These escape sequences are the horizontal scrolling equivalents of `IND` and `RI`. Normally, they move the cursor forward or backward. But if they hit the margins (which we just treat as the first and last columns), they scroll the line. Another VT420 feature done.
This commit is contained in:
parent
89843cd692
commit
13991eade7
2 changed files with 28 additions and 0 deletions
|
@ -888,6 +888,22 @@ void Terminal::RI()
|
|||
set_cursor(cursor_row() - 1, cursor_column());
|
||||
}
|
||||
|
||||
void Terminal::DECFI()
|
||||
{
|
||||
if (cursor_column() == columns() - 1)
|
||||
scroll_left(cursor_row(), 0, 1);
|
||||
else
|
||||
set_cursor(cursor_row(), cursor_column() + 1);
|
||||
}
|
||||
|
||||
void Terminal::DECBI()
|
||||
{
|
||||
if (cursor_column() == 0)
|
||||
scroll_right(cursor_row(), 0, 1);
|
||||
else
|
||||
set_cursor(cursor_row(), cursor_column() - 1);
|
||||
}
|
||||
|
||||
void Terminal::DSR(Parameters params)
|
||||
{
|
||||
if (params.size() == 1 && params[0] == 5) {
|
||||
|
@ -991,12 +1007,18 @@ void Terminal::execute_escape_sequence(Intermediates intermediates, bool ignore,
|
|||
case '\\':
|
||||
// ST (string terminator) -- do nothing
|
||||
return;
|
||||
case '6':
|
||||
DECBI();
|
||||
return;
|
||||
case '7':
|
||||
DECSC();
|
||||
return;
|
||||
case '8':
|
||||
DECRC();
|
||||
return;
|
||||
case '9':
|
||||
DECFI();
|
||||
return;
|
||||
}
|
||||
} else if (intermediates[0] == '#') {
|
||||
switch (last_byte) {
|
||||
|
|
|
@ -304,6 +304,12 @@ protected:
|
|||
// RI - Reverse Index (move up)
|
||||
void RI();
|
||||
|
||||
// DECBI - Back Index
|
||||
void DECBI();
|
||||
|
||||
// DECFI - Forward Index
|
||||
void DECFI();
|
||||
|
||||
// DSR - Device Status Reports
|
||||
void DSR(Parameters);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue