diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp b/src/apps/terminal/BasicTerminalBuffer.cpp index dec2fdc9ab..0174b000d5 100644 --- a/src/apps/terminal/BasicTerminalBuffer.cpp +++ b/src/apps/terminal/BasicTerminalBuffer.cpp @@ -448,7 +448,8 @@ BasicTerminalBuffer::LineLength(int32 index) const int32 BasicTerminalBuffer::GetLineColor(int32 index) const { - TerminalLine* line = _LineAt(index); + TerminalLine* lineBuffer = ALLOC_LINE_ON_STACK(fWidth); + TerminalLine* line = _HistoryLineAt(index, lineBuffer); return line != NULL ? line->attributes : 0; } diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 3dfa0565f5..5a2c974b47 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -1428,7 +1428,9 @@ TermView::Draw(BRect updateRect) SetHighColor(fSelectBackColor); FillRect(rect); } else { - uint32 backcolor = IS_BACKCOLOR(fVisibleTextBuffer->GetLineColor(j)); + int lineIndexInHistory = j + fTextBuffer->HistorySize(); + uint32 backcolor = IS_BACKCOLOR(fVisibleTextBuffer->GetLineColor( + lineIndexInHistory)); rgb_color rgb_back = kTermColorTable[backcolor]; SetHighColor(rgb_back); FillRect(rect);