From a753859956cf27660c5dffc55ee46be840790366 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 22 Nov 2010 20:12:16 +0000 Subject: [PATCH] * Insert an extra space when doing a CR. This ensures the latest attribute setup gets inserted somehow in the line before we go elsewhere. This gets 256colors.pl to give the right output, as well as useable vim in TERM=xterm-color mode (as far as I can tell). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39578 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/BasicTerminalBuffer.cpp | 9 +++++++-- src/apps/terminal/BasicTerminalBuffer.h | 2 +- src/apps/terminal/TermParse.cpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp b/src/apps/terminal/BasicTerminalBuffer.cpp index e471799c44..7140fa7453 100644 --- a/src/apps/terminal/BasicTerminalBuffer.cpp +++ b/src/apps/terminal/BasicTerminalBuffer.cpp @@ -612,9 +612,14 @@ BasicTerminalBuffer::FillScreen(UTF8Char c, uint32 width, uint32 attributes) void -BasicTerminalBuffer::InsertCR() +BasicTerminalBuffer::InsertCR(uint32 attributes) { - _LineAt(fCursor.y)->softBreak = false; + TerminalLine* line = _LineAt(fCursor.y); + line->cells[fCursor.x].attributes = attributes; + line->cells[fCursor.x].character = ' '; + line->length ++; + + line->softBreak = false; fSoftWrappedCursor = false; fCursor.x = 0; _CursorChanged(); diff --git a/src/apps/terminal/BasicTerminalBuffer.h b/src/apps/terminal/BasicTerminalBuffer.h index 1571fbd1e0..96a899bfa7 100644 --- a/src/apps/terminal/BasicTerminalBuffer.h +++ b/src/apps/terminal/BasicTerminalBuffer.h @@ -105,7 +105,7 @@ public: uint32 width, uint32 attributes); void FillScreen(UTF8Char c, uint32 width, uint32 attr); - void InsertCR(); + void InsertCR(uint32 attrs); void InsertLF(); void InsertRI(); void InsertTab(uint32 attr); diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp index 824d88444a..32461ffe84 100644 --- a/src/apps/terminal/TermParse.cpp +++ b/src/apps/terminal/TermParse.cpp @@ -504,7 +504,7 @@ TermParse::EscParse() break; case CASE_CR: - fBuffer->InsertCR(); + fBuffer->InsertCR(fAttr); break; case CASE_SJIS_KANA: