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:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -104,6 +104,7 @@ public:
|
||||
void InsertLines(int32 numLines);
|
||||
|
||||
// delete chars/lines
|
||||
void EraseChars(int32 numChars);
|
||||
void EraseAbove();
|
||||
void EraseBelow();
|
||||
void DeleteChars(int32 numChars);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user