Expose complete history to QML
The use case for this functionality is to be able to e.g. display the terminal application's output after it was terminated. This requires exposing a `clearScreen` method to QML as the history only contains the lines not currently displayed in the widget. If we want to access the whole output we have to be able to flush the screen beforehand. The single argument overload of `Emulation::writeToStream` simplifies reading the complete history at once without having to further expose it's length.
This commit is contained in:
@@ -296,6 +296,11 @@ void Emulation::writeToStream( TerminalCharacterDecoder* _decoder ,
|
||||
_currentScreen->writeLinesToStream(_decoder,startLine,endLine);
|
||||
}
|
||||
|
||||
void Emulation::writeToStream( TerminalCharacterDecoder* _decoder)
|
||||
{
|
||||
_currentScreen->writeLinesToStream(_decoder, 0, _currentScreen->getHistLines());
|
||||
}
|
||||
|
||||
int Emulation::lineCount() const
|
||||
{
|
||||
// sum number of lines currently on _screen plus number of lines in history
|
||||
|
||||
Reference in New Issue
Block a user