History log of /haiku-fatelf/src/apps/terminal/TerminalBuffer.cpp
Revision Date Author Comments
# f3782185 13-Nov-2011 Siarzhuk Zharski <zharik@gmx.li>

Refactoring of 8-bit encodings support.
* Fixed issue introduced in hrev38139: restoring from the line
drawing table was hard-coded to UTF8 Ground table. That is wrong:
the table for currently configured encoding must be set back.
Please look on using of _GuessGroundTable() for details;

* Fixed issue introduced in hrev34894: the semantic of convert_xx_utf8
functions requires the destination length to be set equal to the
target buffer size. Pre-hrev34894 usage of "homebrew" conversion
functions was a bit different - destination length was set to 0.
This made any converstions of input data useless and produce no
visual results;

* Private list of supported encodings (Encoding.cpp) was replaced by
using BPrivate::BCharacterSetRoster functionality. That allows to
use centralized info about encodings in unified with other
applications (Mail & StyledEdit for example) way. Most of currently
enumerated in UTF8.h encodings now available in Terminal.
Note that UCS-2 and UTF-16 are temporary (???) excluded from the
list of encodings supported by Terminal.

* The B_UTF16_CONVERSION was added in system-wide UTF8.h declarations.
This character set is available for enumerating by BCharacterSetRoster
but not listed in public API. Looks like it was just missed;

* Special note about "Text Encoding" entry in Preference File:
So known "shortname" of encoding was used in the preferences file.
For details look on the encodings list in previous version of
Encoding.cpp. As result of migrating to BCharacterSet-provided
resources this list was deleted and is not available anymore.
Instead of it the IANA name of the character encoding targeted
to be used for this purposes. Frankly speaking this part looks
like not working at the moment. The value of text encoding is
hardcoded to "UTF-8" now and is not affected by any operations
in Terminal menu. Note that "shortname" for default encoding
was "UTF8" but the saved value is "UTF-8" - and they are looking
not dependent at all. So this change should not introduce any
kind of backward incompatibility.


# 92d7fb19 21-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed "Coding" to "Encoding" and adjusted other files accordingly


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


# 11efbf01 24-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Applied patch by Olivier to implement more mouse reporting modes, and thus
fixing bug #2854. Thanks!


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


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

* Applied slightly changed patch by Olivier that adds basic xterm style mouse
support, thanks!
* This probably closes bug #2854, confirmation pending.


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


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

Implemented \ESC[?47h and \ESC[?47l (use alternative/normal screen
buffer). These are the sequences our /etc/termcap uses (local less and
vim use the alternative screen buffer now). The ones already implemented
are used e.g. by the termcap of my Linux installation. A bit weird all
those different termcap files, some even with the same version
number.


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


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

* Forgot to clear the lines of the alternate screen buffer on
initialization. This would lead to crashes when resizing.
* Shuffled code in ResizeTo() a bit to make it more robust in case of
error (out of memory).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26004 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


# ecd79a2c 15-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Allow unsetting the listener. With multiple tabs there's only one
terminal view that is attached to the window and can receive messages at
all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25964 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


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

Some renaming and inlining of TerminalBuffer methods.


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


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

Propagate the encoding to TerminalBuffer. It doesn't really belong
there, but that's the easiest solution for the time being.


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


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

GCC 4 fixes.


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


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

Terminal changes. This is still work in progress, some features
are disabled, lots of commented debug code is still in there,
and quite a bit of cleanup is needed, but basically things work
at least as well as before with several improvements:
* Changed TerminalBuffer from an interface to a complete
implementation. Removed all related code from TermView. Removed
the now obsolete TermBuffer. TermParse uses TerminalBuffer instead
of TermView, and TerminalBuffer asynchronously notifies TermView.
This avoids potential deadlocks, fixing #1918. It also speeds
up tty-output-bound programs. E.g. a "seq 10000" is about twice
at fast with the default terminal size in my setup, now. It's
still horribly slow compared to e.g. Konsole, though.
* Replaced CurPos by a more compact and fully inline class TermPos.
* Removed the offset feature (that insets the used text area) from
TermView, thus simplifying the code. Instead put the view into a
new parent view which provides the insets. This also fixes
artifacts that could sometimes be observed in the insets area.
* Scrolling related changes:
- When scrolling fully down, the (80x25 or whatever) terminal
screen is seen. It is not possible to scroll below the screen as
in Be's Terminal. Scrolling in Haiku's Terminal was weirdly
broken in this respect. As a side effect this fixes #2070.
- When not scrolled fully down, further output won't cause any
scrolling. It is thus possible to read earlier output while
something is still going on. Fixes #1772.
- Particularly to avoid unnecessary scrolling in the not scrolled
fully down case, TermView no longer actually scrolls. It only
sets an internal offset and manually uses CopyBits() as needed.
Introduced a (hacky) BScrollView subclass using a BScrollBar
subclass to make that possible.
* Selection related changes:
- Double/triple click plus dragging allows for selecting multiple
words/lines.
- Word selection no longer selects ranges of non-space characters.
Instead it knows that words are made of alpha numerical chars and
a certain set of other chars, and selects a range of commonly
classified characters (word chars, non-word non-whitespace chars,
whitespace chars). The non-alpha-num word characters should be
made user-settable. Due to missing multi-byte character
classification multi-byte whitespace is not recognized.
- Beyond the end of the line there no longer are invisible spaces.
Trying to select the region selects the end of the line (i.e.
line break). This is similar to how Konsole and xterm work.
- Added auto-scrolling when selecting with the mouse. Formerly the
Terminal scrolled only while moving the mouse. The scroll speed
might need some fine-tuning.
- Don't know what change exactly did that (likely the switch to
non-end-inclusive text ranges used internally), but the
occasional selection artifacts are gone.
* Resizing the terminal window re-wraps soft-wrapped lines.
* The find functionality seemed to be completely broken. At least it
never found anything for me. Should work now, though multi-byte
characters are not matched correctly in case-insensitive mode.

Regressions:
* Printing is disabled.
* Cursor blinking is disabled. Do we want it anyway?
* In several cases full-width characters are not handled correctly
(in more cases than before).
* Shrinking the terminal width doesn't work very well with "less"
(and probably other full-screen terminal apps), due to line
re-wrapping. "less" expects them to be truncated only. When
supporting an alternate screen buffer re-wrapping should be
disabled for it, which should solve the problem.



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


# 4386ce02 03-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Pulled the TermView interface used by TermParse into a new interface
class TerminalBuffer, which will evolve into a TermBuffer replacement
and decouple the parse thread from the window.


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


# f37821851ef7dc4da35cd040329f11ca8cdd9826 13-Nov-2011 Siarzhuk Zharski <zharik@gmx.li>

Refactoring of 8-bit encodings support.
* Fixed issue introduced in hrev38139: restoring from the line
drawing table was hard-coded to UTF8 Ground table. That is wrong:
the table for currently configured encoding must be set back.
Please look on using of _GuessGroundTable() for details;

* Fixed issue introduced in hrev34894: the semantic of convert_xx_utf8
functions requires the destination length to be set equal to the
target buffer size. Pre-hrev34894 usage of "homebrew" conversion
functions was a bit different - destination length was set to 0.
This made any converstions of input data useless and produce no
visual results;

* Private list of supported encodings (Encoding.cpp) was replaced by
using BPrivate::BCharacterSetRoster functionality. That allows to
use centralized info about encodings in unified with other
applications (Mail & StyledEdit for example) way. Most of currently
enumerated in UTF8.h encodings now available in Terminal.
Note that UCS-2 and UTF-16 are temporary (???) excluded from the
list of encodings supported by Terminal.

* The B_UTF16_CONVERSION was added in system-wide UTF8.h declarations.
This character set is available for enumerating by BCharacterSetRoster
but not listed in public API. Looks like it was just missed;

* Special note about "Text Encoding" entry in Preference File:
So known "shortname" of encoding was used in the preferences file.
For details look on the encodings list in previous version of
Encoding.cpp. As result of migrating to BCharacterSet-provided
resources this list was deleted and is not available anymore.
Instead of it the IANA name of the character encoding targeted
to be used for this purposes. Frankly speaking this part looks
like not working at the moment. The value of text encoding is
hardcoded to "UTF-8" now and is not affected by any operations
in Terminal menu. Note that "shortname" for default encoding
was "UTF8" but the saved value is "UTF-8" - and they are looking
not dependent at all. So this change should not introduce any
kind of backward incompatibility.


# 92d7fb19f14435b56cf3722c2bcf6c8bc5ac1a13 21-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed "Coding" to "Encoding" and adjusted other files accordingly


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


# 11efbf01602654bfa8fb29b0681e90c2bb21f8c2 24-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Applied patch by Olivier to implement more mouse reporting modes, and thus
fixing bug #2854. Thanks!


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


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

* Applied slightly changed patch by Olivier that adds basic xterm style mouse
support, thanks!
* This probably closes bug #2854, confirmation pending.


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


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

Implemented \ESC[?47h and \ESC[?47l (use alternative/normal screen
buffer). These are the sequences our /etc/termcap uses (local less and
vim use the alternative screen buffer now). The ones already implemented
are used e.g. by the termcap of my Linux installation. A bit weird all
those different termcap files, some even with the same version
number.


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


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

* Forgot to clear the lines of the alternate screen buffer on
initialization. This would lead to crashes when resizing.
* Shuffled code in ResizeTo() a bit to make it more robust in case of
error (out of memory).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26004 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


# ecd79a2cc15697b7e1349f9963a6ab4b19564305 15-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Allow unsetting the listener. With multiple tabs there's only one
terminal view that is attached to the window and can receive messages at
all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25964 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


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

Some renaming and inlining of TerminalBuffer methods.


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


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

Propagate the encoding to TerminalBuffer. It doesn't really belong
there, but that's the easiest solution for the time being.


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


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

GCC 4 fixes.


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


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

Terminal changes. This is still work in progress, some features
are disabled, lots of commented debug code is still in there,
and quite a bit of cleanup is needed, but basically things work
at least as well as before with several improvements:
* Changed TerminalBuffer from an interface to a complete
implementation. Removed all related code from TermView. Removed
the now obsolete TermBuffer. TermParse uses TerminalBuffer instead
of TermView, and TerminalBuffer asynchronously notifies TermView.
This avoids potential deadlocks, fixing #1918. It also speeds
up tty-output-bound programs. E.g. a "seq 10000" is about twice
at fast with the default terminal size in my setup, now. It's
still horribly slow compared to e.g. Konsole, though.
* Replaced CurPos by a more compact and fully inline class TermPos.
* Removed the offset feature (that insets the used text area) from
TermView, thus simplifying the code. Instead put the view into a
new parent view which provides the insets. This also fixes
artifacts that could sometimes be observed in the insets area.
* Scrolling related changes:
- When scrolling fully down, the (80x25 or whatever) terminal
screen is seen. It is not possible to scroll below the screen as
in Be's Terminal. Scrolling in Haiku's Terminal was weirdly
broken in this respect. As a side effect this fixes #2070.
- When not scrolled fully down, further output won't cause any
scrolling. It is thus possible to read earlier output while
something is still going on. Fixes #1772.
- Particularly to avoid unnecessary scrolling in the not scrolled
fully down case, TermView no longer actually scrolls. It only
sets an internal offset and manually uses CopyBits() as needed.
Introduced a (hacky) BScrollView subclass using a BScrollBar
subclass to make that possible.
* Selection related changes:
- Double/triple click plus dragging allows for selecting multiple
words/lines.
- Word selection no longer selects ranges of non-space characters.
Instead it knows that words are made of alpha numerical chars and
a certain set of other chars, and selects a range of commonly
classified characters (word chars, non-word non-whitespace chars,
whitespace chars). The non-alpha-num word characters should be
made user-settable. Due to missing multi-byte character
classification multi-byte whitespace is not recognized.
- Beyond the end of the line there no longer are invisible spaces.
Trying to select the region selects the end of the line (i.e.
line break). This is similar to how Konsole and xterm work.
- Added auto-scrolling when selecting with the mouse. Formerly the
Terminal scrolled only while moving the mouse. The scroll speed
might need some fine-tuning.
- Don't know what change exactly did that (likely the switch to
non-end-inclusive text ranges used internally), but the
occasional selection artifacts are gone.
* Resizing the terminal window re-wraps soft-wrapped lines.
* The find functionality seemed to be completely broken. At least it
never found anything for me. Should work now, though multi-byte
characters are not matched correctly in case-insensitive mode.

Regressions:
* Printing is disabled.
* Cursor blinking is disabled. Do we want it anyway?
* In several cases full-width characters are not handled correctly
(in more cases than before).
* Shrinking the terminal width doesn't work very well with "less"
(and probably other full-screen terminal apps), due to line
re-wrapping. "less" expects them to be truncated only. When
supporting an alternate screen buffer re-wrapping should be
disabled for it, which should solve the problem.



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


# 4386ce0206df74a06409dc1d5ebb0db3596c1e5c 03-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Pulled the TermView interface used by TermParse into a new interface
class TerminalBuffer, which will evolve into a TermBuffer replacement
and decouple the parse thread from the window.


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