Author: mesyeti <mesyeti@mesyeti.uk>
add CSI n @
source/interpreter/vt100.c | 30 ++++++++++++++++++++++++++++++
diff --git a/source/interpreter/vt100.c b/source/interpreter/vt100.c index f57285cb711475632abc07c8b53777d15b4b4e79..c121826c52d746cb092436388ab9ecdd57d4f420 100644 --- a/source/interpreter/vt100.c +++ b/source/interpreter/vt100.c @@ -274,6 +274,27 @@ PrintCSI(parts, num, ch); switch (ch) { + case '@': { + int amount = 1; + if (num >= 1) amount = atoi(parts[0]); + + BufCell* from = Buffer_Get(&terminal->buffer, terminal->cursor.x, terminal->cursor.y); + BufCell* to = Buffer_Get( + &terminal->buffer, terminal->cursor.x + amount, terminal->cursor.y + ); + + int len = terminal->buffer.width - terminal->cursor.x - amount; + + memmove(to, from, len * sizeof(BufCell)); + + for (int i = 0; i < amount; ++ i) { + Buffer_Set( + &terminal->buffer, terminal->cursor.x + i, terminal->cursor.y, + BufAttr_BlankCell() + ); + } + break; + } case 'A': { // move cursor up # lines int amount = 1; if (num >= 1) amount = atoi(parts[0]); @@ -616,7 +637,16 @@ this->reading[0] = 0; // TODO: use a String for this break; } + bool isDone = false; + if (((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'))) { + isDone = true; + } + if (ch == '@') { + isDone = true; + } + + if (isDone) { this->mode = MODE_READY; HandleCSI(this, terminal, ch);