From 0306c7c6f2129397d8671ace31fd29cfea2a6739 Mon Sep 17 00:00:00 2001 From: Stuart Brady Date: Tue, 5 May 2015 09:53:07 +0100 Subject: [PATCH] DtTerm: fix formatted text in history buffer Formatted text currently gets corrupted by DtTerm when copied into its history buffer. As soon as a line of text is copied into the history, the text of each segment of formatted text is altered so that it contains the text from the start of the line. For example: echo -e '\e[1mbold\e[m \e[4munderlined\e[m' When the text has scrolled off the screen, scrolling back to it reveals: boldbbold under This is fixed by adding the calls to _DtTermPrimBufferGetCharacterPointer that were missing which would update the buffer pointer when inserting text into the history buffer. --- cde/lib/DtTerm/TermPrim/TermPrimRender.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cde/lib/DtTerm/TermPrim/TermPrimRender.c b/cde/lib/DtTerm/TermPrim/TermPrimRender.c index 3f250f01..95827954 100644 --- a/cde/lib/DtTerm/TermPrim/TermPrimRender.c +++ b/cde/lib/DtTerm/TermPrim/TermPrimRender.c @@ -854,6 +854,9 @@ _DtTermPrimFillScreenGap(Widget w) eCol, eIndex, eValues[eIndex]); } + c1 = _DtTermPrimBufferGetCharacterPointer( + tBuffer, i1, eCol); + (void) _DtTermPrimBufferInsert( tpd->historyBuffer, tpd->lastUsedHistoryRow, @@ -879,6 +882,10 @@ _DtTermPrimFillScreenGap(Widget w) eCol, eIndex, 0); } } + + c1 = _DtTermPrimBufferGetCharacterPointer( + tBuffer, i1, eCol); + (void) _DtTermPrimBufferInsert( tpd->historyBuffer, tpd->lastUsedHistoryRow, -- 2.25.1