History log of /haiku/src/apps/terminal/BasicTerminalBuffer.cpp
Revision Date Author Comments
# c0b591c5 10-Apr-2022 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Terminal: implement 24-bit colour.

* Changes `TERM` to `xterm`, as we're now a full colour capable terminal
* Removes now-obsolete GuessPaletteColor from an RGB triple
* Since it's using a struct instead of uint32 for attributes, add a bunch
of helpers for a cleaner implementation
* Pass the TerminalBuffer's palette to the foreground/background get
helpers, for when an indexed colour is returned

Change-Id: I33bd3bb1407b87a237a8bc355093fe549e05b43a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5195
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 242adb20 06-Jan-2021 Jérôme Duval <jerome.duval@gmail.com>

Terminal: implement ECMA-48 "REP"

fix #16724

Change-Id: Ie9f8252393a65a0101a6d78db2360f48bb52bc73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3607
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# e998f2e4 18-May-2018 Murai Takashi <tmurai01@gmail.com>

Terminal: Fix -Werror=class-memaccess

Fix -Werror=class-memaccess pointed out by gcc8.
* Use TerminalLine::Clear() instead of memset()
* Use rgb_color::operator=() instead of memcpy()

Change-Id: I41360e245fd55c526d9c2802a2f247ba22583080
Reviewed-on: https://review.haiku-os.org/483
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 1fb59be1 14-Apr-2018 Jérôme Duval <jerome.duval@gmail.com>

Fix some usages of BStackOrHeapArray.

Validates the buffer with IsValid() before actually using it. Thanks Rene!


# ecfaa77a 03-Nov-2016 Jérôme Duval <jerome.duval@gmail.com>

Terminal: Implement a few cursor CSI commands.

* Cursor back tab, cursor forward tab.
* Cursor next line, cursor previous line.
* also add size 13 to the list of font sizes.


# 2085048e 02-Nov-2016 Jérôme Duval <jerome.duval@gmail.com>

Terminal: insert space on tab only at the end of the line.


# f4c2f7eb 10-Jan-2014 Jonathan Schleifer <js@webkeks.org>

Remove variable length arrays of non-PODs.

Variable length arrays of non-PODs are not part of the C++ standard, but
a GNU extension that never worked correctly. Instead, BStackOrHeap array
is used now, which makes sure that it's not too big for the stack, calls
all constructors and is valid C++.


# 314e8a20 10-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BasicTerminalBuffer: Add {Previous,Next}LinePos()


# 3d149248 03-Apr-2013 Siarzhuk Zharski <zharik@gmx.li>

Fix support of East Asian Full Width characters

* Re-enable full-width characters detection and display;
* Fix cursor drawing on full-width characters;
* Fix debug dump for multi-byte characters;
* Fix file permissions for debug capture log.

Fixes #6717. Also may improve behaviour related to #6227.


# c7047b8f 17-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Improve handling of mbyte chars in UTF8Char::IsSpace

* Switch UTF8Char's IsSpace, IsAlNum, ToLower functions to use
system-wide BUnicodeChar service routines;
* Switch TermView::CharClassifier to use UTF8Char instead of
raw char* string ponter. That reduces count of conversions
and simplify code;

Fixes #7423.


# 1dd3b537 16-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Fix Alternate/Normal screen's current attributes handling

Handle the current attributes of the TextBuffer consistently with other
Alt/Normal buffer sensitive variables. That fixes, for example, issues
with wrong background coloring of new lines in normal text buffer after
maximizing the terminal window running applications (like MC) performing
output onto alternate screen.


# 0ac0b4d4 16-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Fix Terminal cursor Save/Restore behaviour

Yet another fix for the terminal cursor save/restore functionality.
Fixes wrong cursor positions observed in modern versions of the
Midnight Commander during switching between Alternate and Normal buffers.


# 5b41331f 09-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

CodeStyle fixes, some refactoring and cleanup

* Clear some codestyle issues catched by checker script;
* Rename RestartDebugCapture to more consistent StartStopDebugCapture;
* Updated Copyrights and authors lists, some occurences of the raw MIT
licence text replaced with "under the terms of MIT licence" reference;
* Fixes for x86_64 build.

This is cumulative cleanup commit for series of Terminal refactoring
changes I have introduced last time. No significant functional changes.


# b0b7933e 07-Feb-2013 Siarzhuk Zharski <zharik@gmx.li>

Use stack for storing saved cursor positions

That fixes issue with latest versions of Midnight Commander - it
"restores" on exit the latest postion was set, that is equal to 0.0.


# b512213b 31-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

Support Background Color Erase, switch to xterm-256color

* Lot of fixes to add support of BCE (background color erase). Shell
is switched to emulate xterm-256colors terminal, that is modern and
declare the colors capabilities of our Terminal more precisely;
* Move current character attributes fAttr from TermView to
BasicTerminalBuffer. This reduces count of function parameters on call
various InsertXXX routines;
* In alternative screen buffer mode the whole cells "matrix" of the
screen buffers is taken into account during drawing background of the
cells in the view. In normal mode the "attributes" field of the
TerminalLine is used to detect color of the area after the last
character - there should be no changes with previous behaviour;
* Fix attributes on kSpaceChar-padding short lines. Current _line_
attributes should be used instead of current _global_ attributes;
* Fixed pads and gaps attributes, more accurate handling of ESC[K and K°;
* _Invalidate strings just erased. Fix EraseChars DCH processing;
* Fixes for ESC[J erase lines control sequences;
* Added handling SGR 90-97, 100-107 codes;
* Clean the newly allocated TerminalLine lines;
* More precise cursor background [off-]color estimation at ends of
lines. The current line attributes should be used instead of
hard-coding it to fTextBackground;
* Fixed background color erase in normal screen buffer modes. Wrong
line indexes calculation messed the drawing results or just returned
0 [default] line attributes;
* Some more BCE support: TerminalLine::Clear() now honors current
character attributes;
* Fixes #6143, #6510 and #6424.


# 718a28ce 30-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

Add Debug snapshots and capture of Terminal data flow

Two helper functions introduced: "make debug snapshots" triggered by
Ctrl-Cmd-S shortcut and "capture data flow" triggered by Ctrl-Cmd-C
shortcut. The first one makes debug dump of current data both in visual
and in text buffer, including history lines if they available. The second
one mirrors all characters and control sequences that are flowing
through the Parser. Both dump and capture files are saved under /var/log
folder. That functionality available only if the USE_DEBUG_SNAPSHOTS switch is
defined.


# a2f89c58 02-Feb-2012 Siarzhuk Zharski <zharik@gmx.li>

[Coverity] Fixed some uninit fields and return values checks

* Fixed CID2398, CID9945, CID9943, CID4215


# 150b717e 30-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix crash in terminal : GetLinecolor was accessing lines with negative offsets.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39684 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d410728 28-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Remove useless comment. Thanks Ingo for watching out.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39671 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 627ced12 28-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Use a better way to store the attributes for end of line. This should also fix some other bugs, as there were occasionalaccess to out-of-range chars.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39669 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a7538599 22-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* 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


# 384fe022 22-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Use the attributes from the parser instead of trying to guess blindly when inserting a tab. This avoids strange things hapenning when a tab is inserted at the start of a line.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ad52ae4 23-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

When inserting tabs or other whitespace, propagate the attributes of the previous characters.
This allows mc to render properly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38318 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6100b6aa 13-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Enlarge attributes to 32 bit instead of 16. This prepares 256-color support for terminal.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38089 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c35b7b93 24-Feb-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

BasicTerminalBuffer::ResizeTo(): Introduced laxer buffer size limits than
the terminal size limits defined in TermConst.h. Fixes #3440, although the
main cause -- the incorrect computation of the window size limits -- still
exists.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35599 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74d2e159 04-Jan-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Invoke the shell using /bin/bash instead of /bin/sh.
Use convert_to/from_utf8() directly instead of the homebrewn proxy methods.
Removed CodeConv from the repository.
Remove UTF8WidthTbl.c from the repository, since it's not used anymore.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34894 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02c89a14 28-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Fix some more style violations.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33344 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 630426d6 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:

Implement correctly handling tab stop escape sequences.

Resolves ticket #4657. Thanks!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33326 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 138343f4 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:

Implement DECALN escape sequence.

Resolves ticket #4658. Thanks!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33325 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c8f11fe 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:
Fix another pair of Terminal scrolling bugs.

Resolves ticket #4655. Thanks!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33324 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ae29b1c3 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:

Implement origin mode.
Save origin mode and text attributes when saving the cursor.
Have RI respect the scroll region.
When erasing the screen actually erase the screen, not just the scroll region.
Implement all three variants of the EL (erase line) sequence.

Thanks! Resolves ticket #4652.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33319 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ea060d4 27-Sep-2009 Stephan Aßmus <superstippi@gmx.de>

patch by Joshua R. Elsasser: (ticket #4651)
* Fixed upward scrolling of a partial screen which is anchored at line 0.

Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33318 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8560c5b0 27-Sep-2009 Stephan Aßmus <superstippi@gmx.de>

Patch by Joshua R. Elsasser: (ticket #4650)
* In _InsertGap(), be sure not to set a line's length longer than the space
allocated for it.

Nice catch, thanks a bunch!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33317 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80abc271 14-Aug-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the Ctrl-L behavior: The current screen is now scrolled up completely
instead of actually clearing it, so that it is still in the history.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32398 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cd672ff 14-Aug-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed some gcc 4 warnings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 728c7f10 19-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30267 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f498be92 03-Feb-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied patch by h.z. (slightly modified by myself) included in bug #2715. I tested it briefly with Konatu Tohaba font and it seems to work correctly. Please review.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29129 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bb69160b 11-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed GetStringFromRegion() to not insert '\n' for soft line breaks.
Fixes bug #2515.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26387 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b43255b9 19-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Squashed TODO: When writing a character in the last column of a line we
wrapped to the next line and a subsequent LF would advance another line.
We behave like xterm now, i.e. visually the cursor stays on the same
line (on the last character), but the next character will be wrapped to
the next line.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26033 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 13315c57 17-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* The old screen buffer wasn't freed in _ResizeSimple().
* Updated some debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26005 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d04aae8b 17-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Some preparations for DEC private mode settings support.
* Implemented alternate screen buffer support. Not used by any program
yet, since we still use the beterm termcap entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26003 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a177ec8c 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for \ESC[%dX (erase characters).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25988 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5d2d3a84 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed \ESC[0J (erase screen below). It shall not erase any character
on the line before the cursor.
* Implemented \ESC[1J (erase screen above.
* Fixed \ESC[2J (erase all). It shall not move the cursor.
* When scrolling only the top part of the screen, we do now also
invalidate the line below the scroll region. Otherwise the view
wouldn't know that they have not been scrolled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25986 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 00b997a8 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing invalidation when inserting space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25980 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c85eff19 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Incorrect array index calculation in case of scrolling only part of the
screen (as vim does for instance). Should fix #2382 and #2386.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17b889de 14-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed TerminalLine::length from int16 to uint16.
* BasicTerminalBuffer::Init() no longer uses _ClearLines() to clear
the screen lines, since that expects the lines to be somewhat valid
at least and also needlessly updates the dirty region.
* _ClearLines() always clears lines, even if they were empty. This way
the "softBreak" flag is cleared too.
* Be a bit more careful when multiplying a potentially negative signed
number by an unsigned one. Shouldn't have caused a problem in this
case, though.

Either of the first three items should fix #2379.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25958 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c9d4b02 14-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Change the line history to a more compact format. We reserve
lines * (width + 8) bytes which is only a little more than a sixth of
what it was before. The effect on performance is relatively small. In
my tests I measured about 2% slowdown.
* Fixed artifacts after soft-wrapped lines.
* Re-enabled cursor blinking. I changed it so that the cursor is 1s
shown and 0.5s hidden (instead of 1s each). Tell me what you think.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25957 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 90ab7ea3 10-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added a SetHistoryCapacity() method.
* Added a ResizeTo() version that allows to set the history capacity at
the same time.
* Added a SynchronizeWith() method that allows synchronizing with (a
part of) another buffer.
* Fixed TODO in _Scroll().
* Improved the dirty region update code in _Scroll(). It would in
certain (not exactly uncommon) situations needlessly invalidate the
whole screen.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25912 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23450280 09-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Pulled base class BasicTerminalBuffer out of TerminalBuffer. It contains
pretty much all the meaty code. Left in TerminalBuffer is only stuff
that didn't quite fit, like the encoding and view notifications.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25893 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f4c2f7ebdb11576420c00fc4ecb23b32c3ce3137 10-Jan-2014 Jonathan Schleifer <js@webkeks.org>

Remove variable length arrays of non-PODs.

Variable length arrays of non-PODs are not part of the C++ standard, but
a GNU extension that never worked correctly. Instead, BStackOrHeap array
is used now, which makes sure that it's not too big for the stack, calls
all constructors and is valid C++.


# 314e8a20c6828d67b6f4c2362710c0a9ae27bc08 10-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BasicTerminalBuffer: Add {Previous,Next}LinePos()


# 3d1492487d880a3518397a6326bc7fe26228ccf6 03-Apr-2013 Siarzhuk Zharski <zharik@gmx.li>

Fix support of East Asian Full Width characters

* Re-enable full-width characters detection and display;
* Fix cursor drawing on full-width characters;
* Fix debug dump for multi-byte characters;
* Fix file permissions for debug capture log.

Fixes #6717. Also may improve behaviour related to #6227.


# c7047b8fd2b48529091fccb925469a2432e65054 17-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Improve handling of mbyte chars in UTF8Char::IsSpace

* Switch UTF8Char's IsSpace, IsAlNum, ToLower functions to use
system-wide BUnicodeChar service routines;
* Switch TermView::CharClassifier to use UTF8Char instead of
raw char* string ponter. That reduces count of conversions
and simplify code;

Fixes #7423.


# 1dd3b537c3d9e3545d78c50cc26775174eec2051 16-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Fix Alternate/Normal screen's current attributes handling

Handle the current attributes of the TextBuffer consistently with other
Alt/Normal buffer sensitive variables. That fixes, for example, issues
with wrong background coloring of new lines in normal text buffer after
maximizing the terminal window running applications (like MC) performing
output onto alternate screen.


# 0ac0b4d4a67b92b0896e6de831502d4aeed5de20 16-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Fix Terminal cursor Save/Restore behaviour

Yet another fix for the terminal cursor save/restore functionality.
Fixes wrong cursor positions observed in modern versions of the
Midnight Commander during switching between Alternate and Normal buffers.


# 5b41331f1100c78541d87b7ad5a15d5652acb079 09-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

CodeStyle fixes, some refactoring and cleanup

* Clear some codestyle issues catched by checker script;
* Rename RestartDebugCapture to more consistent StartStopDebugCapture;
* Updated Copyrights and authors lists, some occurences of the raw MIT
licence text replaced with "under the terms of MIT licence" reference;
* Fixes for x86_64 build.

This is cumulative cleanup commit for series of Terminal refactoring
changes I have introduced last time. No significant functional changes.


# b0b7933ee7fb52833ec82118e00a6c085b4a4237 07-Feb-2013 Siarzhuk Zharski <zharik@gmx.li>

Use stack for storing saved cursor positions

That fixes issue with latest versions of Midnight Commander - it
"restores" on exit the latest postion was set, that is equal to 0.0.


# b512213be6f7cf9660c07e24a81b7597c8776116 31-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

Support Background Color Erase, switch to xterm-256color

* Lot of fixes to add support of BCE (background color erase). Shell
is switched to emulate xterm-256colors terminal, that is modern and
declare the colors capabilities of our Terminal more precisely;
* Move current character attributes fAttr from TermView to
BasicTerminalBuffer. This reduces count of function parameters on call
various InsertXXX routines;
* In alternative screen buffer mode the whole cells "matrix" of the
screen buffers is taken into account during drawing background of the
cells in the view. In normal mode the "attributes" field of the
TerminalLine is used to detect color of the area after the last
character - there should be no changes with previous behaviour;
* Fix attributes on kSpaceChar-padding short lines. Current _line_
attributes should be used instead of current _global_ attributes;
* Fixed pads and gaps attributes, more accurate handling of ESC[K and K°;
* _Invalidate strings just erased. Fix EraseChars DCH processing;
* Fixes for ESC[J erase lines control sequences;
* Added handling SGR 90-97, 100-107 codes;
* Clean the newly allocated TerminalLine lines;
* More precise cursor background [off-]color estimation at ends of
lines. The current line attributes should be used instead of
hard-coding it to fTextBackground;
* Fixed background color erase in normal screen buffer modes. Wrong
line indexes calculation messed the drawing results or just returned
0 [default] line attributes;
* Some more BCE support: TerminalLine::Clear() now honors current
character attributes;
* Fixes #6143, #6510 and #6424.


# 718a28ceadb872b766b13cb3743c575fe416e501 30-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

Add Debug snapshots and capture of Terminal data flow

Two helper functions introduced: "make debug snapshots" triggered by
Ctrl-Cmd-S shortcut and "capture data flow" triggered by Ctrl-Cmd-C
shortcut. The first one makes debug dump of current data both in visual
and in text buffer, including history lines if they available. The second
one mirrors all characters and control sequences that are flowing
through the Parser. Both dump and capture files are saved under /var/log
folder. That functionality available only if the USE_DEBUG_SNAPSHOTS switch is
defined.


# a2f89c5843433b8d93a96fc2cfc98c29ddc628f8 02-Feb-2012 Siarzhuk Zharski <zharik@gmx.li>

[Coverity] Fixed some uninit fields and return values checks

* Fixed CID2398, CID9945, CID9943, CID4215


# 150b717e5b6dfba87efccf1ba6843114fc6d9ea6 30-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix crash in terminal : GetLinecolor was accessing lines with negative offsets.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39684 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d410728171b53d2644a519af90f37283a1acbb2 28-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Remove useless comment. Thanks Ingo for watching out.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39671 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 627ced128beeae81540c683861547413a7664d67 28-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Use a better way to store the attributes for end of line. This should also fix some other bugs, as there were occasionalaccess to out-of-range chars.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39669 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a753859956cf27660c5dffc55ee46be840790366 22-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* 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


# 384fe0223480bf613f2978f386ce5d4f15dc3b4c 22-Nov-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Use the attributes from the parser instead of trying to guess blindly when inserting a tab. This avoids strange things hapenning when a tab is inserted at the start of a line.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ad52ae4cc98566d054072d6a7942784d8f354d3 23-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

When inserting tabs or other whitespace, propagate the attributes of the previous characters.
This allows mc to render properly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38318 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6100b6aa33a6eaad0d5324a7da8718a8d5f5d1f7 13-Aug-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Enlarge attributes to 32 bit instead of 16. This prepares 256-color support for terminal.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38089 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c35b7b937bf499bac1b901dab522e7da5c1364c9 24-Feb-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

BasicTerminalBuffer::ResizeTo(): Introduced laxer buffer size limits than
the terminal size limits defined in TermConst.h. Fixes #3440, although the
main cause -- the incorrect computation of the window size limits -- still
exists.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35599 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74d2e1599a2dffe4be4f58d199c413947d241b89 04-Jan-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Invoke the shell using /bin/bash instead of /bin/sh.
Use convert_to/from_utf8() directly instead of the homebrewn proxy methods.
Removed CodeConv from the repository.
Remove UTF8WidthTbl.c from the repository, since it's not used anymore.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34894 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02c89a146baa1477ebe71a947697eb7ec0d0bb6e 28-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Fix some more style violations.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33344 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 630426d679a4db217ef474d72beebe495f1473f3 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:

Implement correctly handling tab stop escape sequences.

Resolves ticket #4657. Thanks!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33326 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 138343f4f82e211fad68338633970d4d6657ba20 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:

Implement DECALN escape sequence.

Resolves ticket #4658. Thanks!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33325 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c8f11fed41f2bf2a78b4494abbd5a7b9e33aa1c 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:
Fix another pair of Terminal scrolling bugs.

Resolves ticket #4655. Thanks!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33324 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ae29b1c3c2700bb410324dc8157860043c826cd9 27-Sep-2009 Rene Gollent <anevilyak@gmail.com>

Patch by Joshua R. Elsasser:

Implement origin mode.
Save origin mode and text attributes when saving the cursor.
Have RI respect the scroll region.
When erasing the screen actually erase the screen, not just the scroll region.
Implement all three variants of the EL (erase line) sequence.

Thanks! Resolves ticket #4652.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33319 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ea060d47f58bd0b2fb152f36c136cf5831fa76a 27-Sep-2009 Stephan Aßmus <superstippi@gmx.de>

patch by Joshua R. Elsasser: (ticket #4651)
* Fixed upward scrolling of a partial screen which is anchored at line 0.

Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33318 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8560c5b0f7ee17cdf6323af59670a0b8740ad235 27-Sep-2009 Stephan Aßmus <superstippi@gmx.de>

Patch by Joshua R. Elsasser: (ticket #4650)
* In _InsertGap(), be sure not to set a line's length longer than the space
allocated for it.

Nice catch, thanks a bunch!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33317 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80abc2712f495a167b07746db3b3acaaa8641253 14-Aug-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the Ctrl-L behavior: The current screen is now scrolled up completely
instead of actually clearing it, so that it is still in the history.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32398 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cd672ff5026583caf5ab445eb4b49e8620f01c7 14-Aug-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed some gcc 4 warnings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 728c7f10e10cfcdd0b423c667321eaa17b136b3c 19-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30267 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f498be9297862dda8330e3dae2b730afba2570cd 03-Feb-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied patch by h.z. (slightly modified by myself) included in bug #2715. I tested it briefly with Konatu Tohaba font and it seems to work correctly. Please review.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29129 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bb69160b48492a44b15015dbf0abcc12c2709fa4 11-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed GetStringFromRegion() to not insert '\n' for soft line breaks.
Fixes bug #2515.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26387 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b43255b9f734ffd7158599585a4bfae635bcd7e2 19-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Squashed TODO: When writing a character in the last column of a line we
wrapped to the next line and a subsequent LF would advance another line.
We behave like xterm now, i.e. visually the cursor stays on the same
line (on the last character), but the next character will be wrapped to
the next line.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26033 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 13315c5755f86b4c89a11690915354987349f09e 17-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* The old screen buffer wasn't freed in _ResizeSimple().
* Updated some debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26005 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d04aae8b80964ab6a3ab7725baf930d2320d4133 17-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Some preparations for DEC private mode settings support.
* Implemented alternate screen buffer support. Not used by any program
yet, since we still use the beterm termcap entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26003 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a177ec8cf6ae96f95e0ea57ba4ca8b2db2e4f5b3 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for \ESC[%dX (erase characters).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25988 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5d2d3a845c58cd135301bae1307faaddea7f4521 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed \ESC[0J (erase screen below). It shall not erase any character
on the line before the cursor.
* Implemented \ESC[1J (erase screen above.
* Fixed \ESC[2J (erase all). It shall not move the cursor.
* When scrolling only the top part of the screen, we do now also
invalidate the line below the scroll region. Otherwise the view
wouldn't know that they have not been scrolled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25986 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 00b997a8f827620ac2efc7d6d80db9274ce557af 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing invalidation when inserting space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25980 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c85eff199159638b815851e585a2b53b7e04e1cf 16-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Incorrect array index calculation in case of scrolling only part of the
screen (as vim does for instance). Should fix #2382 and #2386.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17b889de67dceb1f0327f5e936b0182a9655094b 14-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed TerminalLine::length from int16 to uint16.
* BasicTerminalBuffer::Init() no longer uses _ClearLines() to clear
the screen lines, since that expects the lines to be somewhat valid
at least and also needlessly updates the dirty region.
* _ClearLines() always clears lines, even if they were empty. This way
the "softBreak" flag is cleared too.
* Be a bit more careful when multiplying a potentially negative signed
number by an unsigned one. Shouldn't have caused a problem in this
case, though.

Either of the first three items should fix #2379.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25958 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c9d4b02efb56c9444a83fb99e362681aa14c7c1 14-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Change the line history to a more compact format. We reserve
lines * (width + 8) bytes which is only a little more than a sixth of
what it was before. The effect on performance is relatively small. In
my tests I measured about 2% slowdown.
* Fixed artifacts after soft-wrapped lines.
* Re-enabled cursor blinking. I changed it so that the cursor is 1s
shown and 0.5s hidden (instead of 1s each). Tell me what you think.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25957 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 90ab7ea343a42cda7da1969de489aca81d462969 10-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added a SetHistoryCapacity() method.
* Added a ResizeTo() version that allows to set the history capacity at
the same time.
* Added a SynchronizeWith() method that allows synchronizing with (a
part of) another buffer.
* Fixed TODO in _Scroll().
* Improved the dirty region update code in _Scroll(). It would in
certain (not exactly uncommon) situations needlessly invalidate the
whole screen.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25912 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 234502808a662a88165c2fed4d3dcf382f59650d 09-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Pulled base class BasicTerminalBuffer out of TerminalBuffer. It contains
pretty much all the meaty code. Left in TerminalBuffer is only stuff
that didn't quite fit, like the encoding and view notifications.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25893 a95241bf-73f2-0310-859d-f6bbb57e9c96