Implemented \ESC[?47h and \ESC[?47l (use alternative/normal screen

buffer). These are the sequences our /etc/termcap uses (local less and
vim use the alternative screen buffer now). The ones already implemented
are used e.g. by the termcap of my Linux installation. A bit weird all
those different termcap files, some even with the same version
number.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26031 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-06-19 21:10:21 +00:00
parent f3c7795744
commit 1291c38c18
3 changed files with 17 additions and 6 deletions

View File

@ -1093,9 +1093,13 @@ TermParse::_DecPrivateModeSet(int value)
// Not supported yet.
break;
case 25:
// Show Cursor
// Show Cursor.
// Not supported yet.
break;
case 47:
// Use Alternate Screen Buffer.
fBuffer->UseAlternateScreenBuffer(false);
break;
case 1034:
// Interpret "meta" key, sets eighth bit.
// Not supported yet.
@ -1104,7 +1108,7 @@ TermParse::_DecPrivateModeSet(int value)
// Save cursor as in DECSC and use Alternate Screen Buffer, clearing
// it first.
fBuffer->SaveCursor();
fBuffer->UseAlternateScreenBuffer();
fBuffer->UseAlternateScreenBuffer(true);
break;
}
}
@ -1138,14 +1142,18 @@ TermParse::_DecPrivateModeReset(int value)
// Hide Cursor
// Not supported yet.
break;
case 47:
// Use Normal Screen Buffer.
fBuffer->UseNormalScreenBuffer();
break;
case 1034:
// Dont interpret "meta" key.
// Not supported yet.
break;
case 1049:
// Use Normal Screen Buffer and restore cursor as in DECRC.
fBuffer->RestoreCursor();
fBuffer->UseNormalScreenBuffer();
fBuffer->RestoreCursor();
break;
}
}

View File

@ -176,13 +176,16 @@ TerminalBuffer::ResizeTo(int32 width, int32 height, int32 historyCapacity)
void
TerminalBuffer::UseAlternateScreenBuffer()
TerminalBuffer::UseAlternateScreenBuffer(bool clear)
{
if (fAlternateScreenActive || fAlternateScreen == NULL)
return;
_SwitchScreenBuffer();
if (clear)
Clear(false);
_InvalidateAll();
}

View File

@ -32,7 +32,7 @@ public:
virtual status_t ResizeTo(int32 width, int32 height,
int32 historyCapacity);
void UseAlternateScreenBuffer();
void UseAlternateScreenBuffer(bool clear);
void UseNormalScreenBuffer();
protected: