mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 11:27:29 +00:00
terminal: Add escape handling for CUB
This VT102 command is triggered by busybox when pressing the 'pos1' key.
This commit is contained in:
parent
cae79d30b8
commit
ff3b73825d
@ -77,6 +77,10 @@ class Static_character_screen : public Terminal::Character_screen
|
||||
{
|
||||
}
|
||||
|
||||
void cub(int)
|
||||
{
|
||||
}
|
||||
|
||||
void cuf(int)
|
||||
{
|
||||
if (_cursor_pos.x >= _boundary.width)
|
||||
|
@ -236,6 +236,14 @@ class Char_cell_array_character_screen : public Terminal::Character_screen
|
||||
_region_end = Genode::max(_region_end, _region_start);
|
||||
}
|
||||
|
||||
void cub(int dx)
|
||||
{
|
||||
Cursor_guard guard(*this);
|
||||
|
||||
_cursor_pos.x -= dx;
|
||||
_cursor_pos.x = Genode::max(0, _cursor_pos.x);
|
||||
}
|
||||
|
||||
void cuf(int dx)
|
||||
{
|
||||
Cursor_guard guard(*this);
|
||||
|
@ -61,6 +61,11 @@ namespace Terminal {
|
||||
*/
|
||||
virtual void csr(int, int) = 0;
|
||||
|
||||
/**
|
||||
* Move cursor backwards
|
||||
*/
|
||||
virtual void cub(int) = 0;
|
||||
|
||||
/**
|
||||
* Non-destructive space - move right #1 spaces
|
||||
*/
|
||||
|
@ -37,6 +37,7 @@ namespace Terminal {
|
||||
CS_TRACE_OP(cvvis);
|
||||
CS_TRACE_OP(cpr);
|
||||
CS_TRACE_OP_2(csr);
|
||||
CS_TRACE_OP_1(cub);
|
||||
CS_TRACE_OP(cuf1);
|
||||
CS_TRACE_OP_2(cup);
|
||||
CS_TRACE_OP(cuu1);
|
||||
|
@ -257,6 +257,7 @@ namespace Terminal {
|
||||
if (starts_with_digit(4, p1))
|
||||
return (_screen.setab(remove_first_digit(p1)), true);
|
||||
|
||||
case 'D': return (_screen.cub(p1), true);
|
||||
case 'd': return (_screen.vpa(p1), true);
|
||||
case 'g': return (p1 == 3) && (_screen.tbc(), true);
|
||||
case 'G': return (_screen.hpa(p1), true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user