Version: (using KDE Devel) While working on the crash BR95990, I noticed this. Setting the 'Number of Lines' to 1, gives no History. Setting to 2, give 1 line of History. ... etc... etc... This appears to fix it. --- TEHistory.cpp 28 Jun 2003 10:31:38 -0000 1.25 +++ TEHistory.cpp 8 Jan 2005 19:27:04 -0000 @ -230,7 +230,7 @ void HistoryScrollBuffer::addCells(ca a[ m_buffFilled = true; } - if (m_nbLines < m_maxNbLines - 1) ++m_nbLines; + if (m_nbLines < m_maxNbLines) ++m_nbLines; // m_histBuffer.remove(m_arrayIndex); // not necessary m_histBuffer.insert(m_arrayIndex, newLine);
CVS commit by hindenburg: Correct # of history lines that are viewable. BUG: 96605 M +1 -1 TEHistory.cpp 1.28 --- kdebase/konsole/konsole/TEHistory.cpp #1.27:1.28 @@ -231,5 +231,5 @@ void HistoryScrollBuffer::addCells(ca a[ } - if (m_nbLines < m_maxNbLines - 1) ++m_nbLines; + if (m_nbLines < m_maxNbLines) ++m_nbLines; // m_histBuffer.remove(m_arrayIndex); // not necessary
I may end up reverting this for 3.4. It appears to have some side-effects. And this bug shouldn't affect many people.
CVS commit by hindenburg: Revert my earlier patch. CCMAIL: 96605@bugs.kde.org M +2 -1 TEHistory.cpp 1.29 --- kdebase/konsole/konsole/TEHistory.cpp #1.28:1.29 @@ -231,5 +231,6 @@ void HistoryScrollBuffer::addCells(ca a[ } - if (m_nbLines < m_maxNbLines) ++m_nbLines; + // FIXME: See BR96605 + if (m_nbLines < m_maxNbLines - 1) ++m_nbLines; // m_histBuffer.remove(m_arrayIndex); // not necessary
It seems ScrollHistoryBuffer was full of strangeness and one-off errors. I believe I have a fix; I'll attach my patch (against kdebase-3.5.5). I've tested it for a half-hour or so, and I don't see any more weirdness when resizing the history. Valgrind reports no memory problems (of mine), though when shrinking the history buffer, I don't see the VmSize decrease. I blame heap fragmentation.
Created attachment 19143 [details] Moderate changes to HistoryScrollBuffer, should fix problems
Thanks for your patch Tom, I have checked and committed it.