Support REP escape sequence defined in ECMA-48, section 8.3.103
Since ncurses 20170729, supporting REP is necessary for terminals with xterm compatibility (TERM=xterm or similar). This patch fixes layout issues with htop. [1] [1] http://lists.gnu.org/archive/html/bug-ncurses/2017-08/msg00051.html
This commit is contained in:
@@ -226,6 +226,28 @@ void Screen::insertChars(int n)
|
||||
screenLines[cuY].resize(columns);
|
||||
}
|
||||
|
||||
void Screen::repeatChars(int count)
|
||||
//=REP
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
count = 1;
|
||||
}
|
||||
/**
|
||||
* From ECMA-48 version 5, section 8.3.103
|
||||
* If the character preceding REP is a control function or part of a
|
||||
* control function, the effect of REP is not defined by this Standard.
|
||||
*
|
||||
* So, a "normal" program should always use REP immediately after a visible
|
||||
* character (those other than escape sequences). So, lastDrawnChar can be
|
||||
* safely used.
|
||||
*/
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
displayCharacter(lastDrawnChar);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::deleteLines(int n)
|
||||
{
|
||||
if (n == 0) n = 1; // Default
|
||||
@@ -663,6 +685,8 @@ void Screen::displayCharacter(unsigned short c)
|
||||
currentChar.backgroundColor = effectiveBackground;
|
||||
currentChar.rendition = effectiveRendition;
|
||||
|
||||
lastDrawnChar = c;
|
||||
|
||||
int i = 0;
|
||||
int newCursorX = cuX + w--;
|
||||
while(w)
|
||||
|
||||
Reference in New Issue
Block a user