History log of /haiku/src/apps/terminal/TermParse.h
Revision Date Author Comments
# 73ad2473 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

Remove remaining unnecessary 'volatile' qualifiers


# 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.


# 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.


# 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.


# 68ea9ce5 27-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

OSC and color management improoved

* Global kTermColorTable replaced with it's private copy for every
TermView instance. This allows to modify colors table for every view
separately;
* Set of ANSI normal/bright color entries added into preferences;
* Default color table generated dynamicaly using ANSI colors
preferences. 6x6x6 color cubes and grayscale ramp are generated in
xterm colors model;
* Improoved support of Operating System Command control sequences;
* Support for X11 rgb.txt compatible color names. Corresponding entries
are stored in hashed form in application resource and loaded only on
demand.


# 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.


# f02c85ad 01-Mar-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Fix non-static, non-initialized member fProcessID CID 9946; Remove non-used fLockFlag, set un-initilized fSavedAttr member, CID 9945; fixed a few extra spaces

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


# 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


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

Patch by Joshua R. Elsasser:
Implements DA, reporting that the terminal is a VT102.
Implements DEXREQTPARM, reporting the same parameters that xterm does.
Fixes DSR 6 to actually report the position of the cursor.

Resolves ticket #4659. Thanks!



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


# 8d5e9931 26-Aug-2009 Michael Lotz <mmlr@mlotz.ch>

mmlr+anevilyak:
Unconditionally release the reader sem when the previous buffer size was 0
instead of testing for fParserWaiting as there is a race condition between
setting it to true in the parser thread and checking for it in the reader
thread so a release_sem() could be missed causing #4343. To reduce the possible
side effect of needlessly looping through acquire_sem() for too many
unconditionally released sems, we eat them in the parser thread once we're sure
we can't miss an event because of that. Also added a TODO about a memcpy()
optimization as pointed out by Rene.
+alphabranch


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


# 540e66d6 10-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed GetReaderBuf() to _NextParseChar().
* Introduced a small (64 byte) buffer for the parser thread. Instead of
directly reading single characters out of the reader buffer, we read
a full parser buffer and process the characters from the parser
buffer. Thus _NextParseChar() could be inlined, since it merely
consists of a conditional method call and an access to the parser
buffer, now.
* Improved the locking of the terminal buffer. Instead of unlocking and
relocking after every multi-byte char or escape sequence, we only
unlock while refilling the parser buffer.


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


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

Changed the way the pty reader and output parser thread communicate. The
parser was acquiring a semaphore for each character. Now it only
acquires a semaphore when the buffer is empty. This speeds up output
bound programs. In my setup "seq" is now 3 times faster. Which is still
rather slow.


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


# 3082bb7d 10-May-2008 François Revol <revol@free.fr>

added a dumpState() call to help debugging EscParse


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


# d7b25be8 30-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

cleaned up a bit thread creation and deletion


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


# abc47202 23-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved cursor blinking functionality from TermParse into TermView (and
from a BMessageRunner into Pulse()). Removed more unused stuff.
Moved around some constants and definitions. Many style changes. Sorry,
I know the two should be separated, but I had already done so many changes...


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


# ac3a8f54 21-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Made all CodeConv methods static, since there was no point for them to
be nonstatic. Moved TermParse under Shell, Removed some parameters
passing around from TermWindow/TermView/TermParse. Now TermParse threads are
started when the shell is attached to a TermView. Might still be
improved.


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


# f3d05c8b 17-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Encapsulated low level terminal stuff into a Shell class, which also
supersedes spawn_shell(). Removed window parameter from TermParse. Since
we already have a pointer to the view, we just call Window() on it (only
used in one place, no need to save a pointer). Other cleanups.


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


# 7f108511 25-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote terminal ID code to use a temporary file - this fixes bug #1174.
* Tried to fix the usual deadlock on quit, but suspending the thread (to
interrupt read()) doesn't have the expected outcome (might be a kernel
bug).
* Removed superfluous MENU_FILE_QUIT and send a B_QUIT_REQUESTED instead.
* Cleanup.


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


# 63dc9cc2 04-Mar-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Got rid of the global gPfd variable. Big time cleanup, made TermParse a
bit more robust with error checks and likes. Removed unused
TermPrint.cpp file. I hope I didn't get on your
way, Vasilis :)


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


# d3dc729f 18-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Moved the files out of the MYOB folder into the main folder.
There are some double entries (like TermApp.cpp and TerminalApp.cpp, so
it still needs a further cleanup).


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


# 73ad2473e7874b3702cf5b0fdf4c81b747812ed9 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

Remove remaining unnecessary 'volatile' qualifiers


# 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.


# 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.


# 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.


# 68ea9ce5bbed50e08bf08a151477bbb0e1ac1227 27-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

OSC and color management improoved

* Global kTermColorTable replaced with it's private copy for every
TermView instance. This allows to modify colors table for every view
separately;
* Set of ANSI normal/bright color entries added into preferences;
* Default color table generated dynamicaly using ANSI colors
preferences. 6x6x6 color cubes and grayscale ramp are generated in
xterm colors model;
* Improoved support of Operating System Command control sequences;
* Support for X11 rgb.txt compatible color names. Corresponding entries
are stored in hashed form in application resource and loaded only on
demand.


# 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.


# f02c85adbab949acfbac1b260db2f7f3caa05d8e 01-Mar-2011 Alexander von Gluck IV <kallisti5@unixzen.com>

Fix non-static, non-initialized member fProcessID CID 9946; Remove non-used fLockFlag, set un-initilized fSavedAttr member, CID 9945; fixed a few extra spaces

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


# 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


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

Patch by Joshua R. Elsasser:
Implements DA, reporting that the terminal is a VT102.
Implements DEXREQTPARM, reporting the same parameters that xterm does.
Fixes DSR 6 to actually report the position of the cursor.

Resolves ticket #4659. Thanks!



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


# 8d5e993169256ed80cc208d010179e9ff3f55708 26-Aug-2009 Michael Lotz <mmlr@mlotz.ch>

mmlr+anevilyak:
Unconditionally release the reader sem when the previous buffer size was 0
instead of testing for fParserWaiting as there is a race condition between
setting it to true in the parser thread and checking for it in the reader
thread so a release_sem() could be missed causing #4343. To reduce the possible
side effect of needlessly looping through acquire_sem() for too many
unconditionally released sems, we eat them in the parser thread once we're sure
we can't miss an event because of that. Also added a TODO about a memcpy()
optimization as pointed out by Rene.
+alphabranch


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


# 540e66d6a6ba2faca672fffb89be44787df2c219 10-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed GetReaderBuf() to _NextParseChar().
* Introduced a small (64 byte) buffer for the parser thread. Instead of
directly reading single characters out of the reader buffer, we read
a full parser buffer and process the characters from the parser
buffer. Thus _NextParseChar() could be inlined, since it merely
consists of a conditional method call and an access to the parser
buffer, now.
* Improved the locking of the terminal buffer. Instead of unlocking and
relocking after every multi-byte char or escape sequence, we only
unlock while refilling the parser buffer.


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


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

Changed the way the pty reader and output parser thread communicate. The
parser was acquiring a semaphore for each character. Now it only
acquires a semaphore when the buffer is empty. This speeds up output
bound programs. In my setup "seq" is now 3 times faster. Which is still
rather slow.


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


# 3082bb7d0c14b5b5604384251806a9a8216473f1 10-May-2008 François Revol <revol@free.fr>

added a dumpState() call to help debugging EscParse


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


# d7b25be846c4a69b128cf286b470b27f859cded5 30-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

cleaned up a bit thread creation and deletion


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


# abc4720231b10f87fa94d5d1e47d18650cf457de 23-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved cursor blinking functionality from TermParse into TermView (and
from a BMessageRunner into Pulse()). Removed more unused stuff.
Moved around some constants and definitions. Many style changes. Sorry,
I know the two should be separated, but I had already done so many changes...


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


# ac3a8f54460005262afcdc310481d6ba91ef6ff9 21-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Made all CodeConv methods static, since there was no point for them to
be nonstatic. Moved TermParse under Shell, Removed some parameters
passing around from TermWindow/TermView/TermParse. Now TermParse threads are
started when the shell is attached to a TermView. Might still be
improved.


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


# f3d05c8b3ae5de10c8402ed38793fd38605ed13f 17-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Encapsulated low level terminal stuff into a Shell class, which also
supersedes spawn_shell(). Removed window parameter from TermParse. Since
we already have a pointer to the view, we just call Window() on it (only
used in one place, no need to save a pointer). Other cleanups.


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


# 7f1085115e560e38a524331ecda040502a2a81cd 25-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote terminal ID code to use a temporary file - this fixes bug #1174.
* Tried to fix the usual deadlock on quit, but suspending the thread (to
interrupt read()) doesn't have the expected outcome (might be a kernel
bug).
* Removed superfluous MENU_FILE_QUIT and send a B_QUIT_REQUESTED instead.
* Cleanup.


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


# 63dc9cc262a181e2da2a6ec5701b82a403f30d9a 04-Mar-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Got rid of the global gPfd variable. Big time cleanup, made TermParse a
bit more robust with error checks and likes. Removed unused
TermPrint.cpp file. I hope I didn't get on your
way, Vasilis :)


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


# d3dc729f9fbe302c5c45c3ec2518650a260605d7 18-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Moved the files out of the MYOB folder into the main folder.
There are some double entries (like TermApp.cpp and TerminalApp.cpp, so
it still needs a further cleanup).


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