1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Add support for \e[9xm and \e[10xm escape sequences.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-05-01 13:04:32 +02:00
parent 2ff72426ec
commit 20b8a3c639
2 changed files with 17 additions and 3 deletions

View file

@ -112,9 +112,9 @@ LFBTextBuffer* CreateLFBTextBuffer(uint8_t* lfb, uint32_t lfbformat,
ret->attrs = attrs;
for ( size_t i = 0; i < 16UL; i++ )
{
uint8_t r = i & 0b0100 ? (i & 0b1000 ? 255 : 191) : 0;
uint8_t g = i & 0b0010 ? (i & 0b1000 ? 255 : 191) : 0;
uint8_t b = i & 0b0001 ? (i & 0b1000 ? 255 : 191) : 0;
uint8_t r = i & 0b0100 ? (i & 0b1000 ? 255 : 191) : (i & 0b1000 ? 63 : 0);
uint8_t g = i & 0b0010 ? (i & 0b1000 ? 255 : 191) : (i & 0b1000 ? 63 : 0);
uint8_t b = i & 0b0001 ? (i & 0b1000 ? 255 : 191) : (i & 0b1000 ? 63 : 0);
ret->colors[i] = ColorFromRGB(r, g, b);
}
ret->cursorenabled = true;

View file

@ -560,6 +560,20 @@ void TextTerminal::RunAnsiCommand(TextBuffer* textbuf, char c)
vgacolor &= 0x0F;
vgacolor |= conversion[val] << 4;
}
// Set text color.
else if ( 90 <= cmd && cmd <= 97 )
{
unsigned val = cmd - 90;
vgacolor &= 0xF0;
vgacolor |= (0x8 | conversion[val]) << 0;
}
// Set background color.
else if ( 100 <= cmd && cmd <= 107 )
{
unsigned val = cmd - 100;
vgacolor &= 0x0F;
vgacolor |= (0x8 | conversion[val]) << 4;
}
// TODO: There are many other things we don't support.
}
} break;