Added support for \ESC[%dX (erase characters).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25988 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-06-17 03:06:25 +00:00
parent 6df054ee2f
commit a177ec8cf6
5 changed files with 36 additions and 3 deletions
+23
View File
@@ -628,6 +628,29 @@ BasicTerminalBuffer::InsertSpace(int32 num)
}
void
BasicTerminalBuffer::EraseChars(int32 numChars)
{
TerminalLine* line = _LineAt(fCursor.y);
if (fCursor.y >= line->length)
return;
int32 first = fCursor.x;
int32 end = min_c(fCursor.x + numChars, line->length);
if (first > 0 && IS_WIDTH(line->cells[first - 1].attributes))
first--;
if (end > 0 && IS_WIDTH(line->cells[end - 1].attributes))
end++;
for (int32 i = first; i < end; i++) {
line->cells[i].character = kSpaceChar;
line->cells[i].attributes = 0;
}
_Invalidate(fCursor.y, fCursor.y);
}
void
BasicTerminalBuffer::EraseAbove()
{
+1
View File
@@ -104,6 +104,7 @@ public:
void InsertLines(int32 numLines);
// delete chars/lines
void EraseChars(int32 numChars);
void EraseAbove();
void EraseBelow();
void DeleteChars(int32 numChars);
+8
View File
@@ -959,6 +959,14 @@ TermParse::EscParse()
parsestate = groundtable;
break;
case CASE_ECH: // erase characters
if ((col = param[0]) < 1)
col = 1;
fBuffer->EraseChars(col);
parsestate = groundtable;
break;
default:
break;
}
+1 -1
View File
@@ -1122,7 +1122,7 @@ CASE_GROUND_STATE,
CASE_GROUND_STATE,
CASE_GROUND_STATE,
/* X Y Z [ */
CASE_GROUND_STATE,
CASE_ECH,
CASE_GROUND_STATE,
CASE_GROUND_STATE,
CASE_GROUND_STATE,
+3 -2
View File
@@ -120,5 +120,6 @@
#define CASE_VPA 87
#define CASE_HPA 88
#define CASE_SU 89 /* scroll screen up */
#define CASE_SD 90 /* scroll screen down */
#define CASE_SU 89 /* scroll screen up */
#define CASE_SD 90 /* scroll screen down */
#define CASE_ECH 91 /* erase characters */