History log of /haiku/src/apps/terminal/TermView.h
Revision Date Author Comments
# 7a772a55 08-Jan-2023 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Terminal: support bracketed paste.

Fixes #18029: Pasting into nano etc. eats newlines and indentation

Change-Id: I935696bb97f4d82b30f73cc488f6317cf847beae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5987
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


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


# 9a7f2c24 14-Jan-2022 Jérôme Duval <jerome.duval@gmail.com>

Terminal: add support for mouse press/release events in Extended/SGR 1006 mode

fixes #17532

Change-Id: Ic9f19ace5c728b6823caa5ce8ec35dc35d244220
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4867
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# f78b75b1 05-Nov-2021 Jérôme Duval <jerome.duval@gmail.com>

Terminal: handle color queries

this allows apps like vim to select a color scheme based on a dark or light background.

Change-Id: Ia9f98d2373523a8b5fa379225a1c906ae075edf7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4693
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 093e8363 13-Jan-2020 Zotyamester <szatmary.zoltan1222@gmail.com>

Terminal: match declarations and definitions

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


# e3c74f40 15-Oct-2019 Lukasz Towarek <lukasz.towarek@gmail.com>

Terminal: Add support for extended mouse coordinates

Fixes #11949

Change-Id: I779d1a9af2e3208ba3c055692de5e62b6a7b72fc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1919
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>


# 75d2b89f 07-Sep-2019 Augustin Cavalier <waddlesplash@gmail.com>

Terminal: Fix GCC2 build.


# 8840b3db 14-Aug-2019 Simon South <simon@simonsouth.net>

Terminal: Allow use of Option as Meta key

Add a configuration setting that allows the left Option key to be used as a
Meta key, and add support for the Escape sequences that control the Meta key's
behaviour.

TermWindow now maintains a copy, shared by all its component TermViews, of the
current key map, and updates this copy automatically when notified by the Input
Server a new key map has been loaded.

The Meta key was an extra modifier key present on early UNIX workstations that
provided access to the "extended" portion of the ASCII character set. Although
it has vanished from modern keyboards certain UNIX software still relies on the
key, most notably GNU Emacs and the GNU readline library, the latter of which
is used by bash and a wide variety of other software that reads input from a
terminal. (Python's interactive mode uses readline, for instance.)

With this patch applied and the new setting enabled, the left Option key can be
used to access additional editing and navigation features at the command line.
It also makes usable the port of GNU Emacs currently available from HaikuDepot.

Fixes #15294.

Change-Id: I150b640b7b18384d56ab2fb017bf16ce8bdbdd78
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1727
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# fe55edca 03-Jan-2019 JackBurton79 <stefano.ceccherini@gmail.com>

Terminal: Font width can be a fractional value, so we need to use a float.

Adapt other code accordingly. Minimum changes to fix ticket #11478
In theory also font height could be fractional, so we might need to
review other parts of the code.

Change-Id: Idbdbe38193ca5a32b3d09c7cf9accfc917760cae
Reviewed-on: https://review.haiku-os.org/821
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>


# c0bbce07 24-Aug-2018 Humdinger <humdingerb@gmail.com>

Terminal: Make blinking cursor settings live

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


# 105acc92 29-Oct-2016 Jérôme Duval <jerome.duval@gmail.com>

Terminal: always use bright for bold text.

* "Allow bold font" now enables the use of the bold font for bold text.
* so one can now see bold text in black on black.


# be3f404c 13-Feb-2014 Jonathan Schleifer <js@webkeks.org>

Terminal: Add option to use bright instead of bold text

A saturated add was chosen instead of tint_color, as the results of
tint_color were too extreme.


# 82055c26 02-Sep-2013 Siarzhuk Zharski <zharik@gmx.li>

Terminal:send resize notify on attaching window to view

During adding the second tab the view in the first one may change its
lines count in case the Terminal window was maximized. Send resize
notification to client rpogram on every reattaching view to window.

Fixes #9809


# 8a8a325a 19-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Terminal: work-around missing/out-of-order modifiers events

... more aggressively than before:
* Only use modifiers().
* Before forwarding any relevant event to the active state, first check
whether the modifiers have changed.

While the issues should really be fixed where they originate (app
server?), this hopefully fixes all situations where the hyperlink mode
gets stuck.


# 7de99f83 10-May-2013 Rene Gollent <anevilyak@gmail.com>

Fix Terminal build.


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

Terminal: Add a hyperlink mode

When holding down Command, text under the mouse is checked whether it
looks like a URL or a local path. If so, it is highlighted and can be
clicked, which will open the URL/file. Right-clicking opens a context
menu with items for opening the link/file or copying it to the
clipboard. When additionally holding down Shift, path prefixes up to
the component under the mouse will be considered (no effect for URLs).

Changes:
* Add HyperLink class. Encapsulates a type, the address, and an
optional base address. Features an Open() method to open the address.
* Move/add some string constants to TermConst.
* Move TermView::CharClassifier to top level and rename to
DefaultCharClassifier.
* Introduce TermViewHighlight and TermViewHighlighter. The former
refers to a range of text in a TermView's text buffer. It also
contains a pointer to a TermViewHighlighter object, which specifies
how the text range shall be rendered (colors and attributes).
* TermView:
- Add respective _{Add,Remove}Highlight() methods and adjust the code
to support highlights.
- Make the selection a TermViewHighlight. At least its visual aspect
is now handled like other highlights.
- Introduce an inner TextBufferSyncLocker. It is used instead of
BAutolock when locking the text buffer to synchronize the visual
buffer with it. After it unlocks it calls
_VisibleTextBufferChanged(), if the visual text buffer has changed,
which in turn calls a new callback on the active state.
- Add WindowActivated() and ModifiersChanged() callbacks to the state
interface.
- Add new states HyperLinkState and HyperLinkMenuState which
implement the new feature.

Fix modifier issues


# bda35ef5 09-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Terminal: Pull user input handling into state classes


# 19bfeaa7 24-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Support %e (cur.encoding) for Terminal titles

Optional parameter %e to indicate current tab view encoding in the
window title. It is not shown in case tab view encoding is default
UTF-8. Inspired by Sergei Reznikov. Thanks.


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

Optimize SIGWINCH Shell notification

Fixes issue with missed SIGWINCH shell notification in case the
Terminal frame was resized by using any of "Settings"->"Window size"
menu items.

Fixes #9293 - original problem was pointed out by Ziusudra. Thank you!


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


# fe256869 08-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Move colors table from TermView to TerminalBuffer

* ColorsTable moved to TerminalBuffer to let easy lookup of table
during parsing of control sequences;
* Default Palette initialized from now in TermApp and preserved
from modifying by applications;


# bbfd23ab 09-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

Use native bold style drawing (+ switchable emulation)

Use native bold font for rendering characters with corresponding
attribute set. Possibility for switching to R5-like bold characters
emulation is also implemented. This one uses uses the left-down shadow
in B_OP_BLEND drawing mode instead of the rigth-down one as previously.


# 6d30b376 05-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Support for underline and ibeam terminal cursor styles

* Add support for underline and i-beam cursor shapes. No corresponding
UI configuration in preferences view ATM because preferences are waiting
for refactoring and we need some eggs for this Easters. ;-)
* Add handling of VT520/xterm specific DECSCUSR control sequences
allowing applications to modify the style and blinking state of the
cursor. May be utilized, for example, by console version of vim;
* Implement cursor blinking/hiding on DECSET/DECRST commands.


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


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

Revert hrev38316 fore-/background colors customization

This reverts hrev38316 in parts of foreground and background colors
handling. Mentioned revision has hardcoded colors to system ANSI color
entries 7 and 0 correspondently. It is very uncomfortable for the
console programs like Midnight Commander because they become
colors that were defined in the current Terminal scheme and doesn't
correspond to real ANSI color names. For example "ANSI black" can be
black, white, blue, gray or something else in dependency of the current
color scheme configuration. The same side-effect was obviously observed
for "ANSI white" and produced funny color combinations in software.


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


# 12290528 05-Nov-2012 Jonathan Schleifer <js@webkeks.org>

Terminal: Make the cursor color configurable.

Signed-off-by: Adrien Destugues - PulkoMandy <pulkomandy@pulkomandy.tk>


# fdd2b7eb 27-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Removal of the About window.

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


# e9e3be37 23-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Coding style cleanup.


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


# ca598670 22-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed the shell process ID from ActiveProcessInfo and moved it to new class
ShellInfo, which also contains a flag whether the shell is the default shell.
* If the Terminal has been started with a custom shell, also replace "%p" in
the title by its name, when active.
* Also show the on-close alert for the custom shell.

Fixes #6844.


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


# 38d5ce62 18-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed "move" parameter from the
TermView::Listener::{Previous,Next}TermView() methods. All B_COMMAND_KEY
combos are intercepted by the window, so we never get them in the view.
* Added window shortcut Command-Shift-Left/Right to move the tabs.


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


# 92b0038e 18-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a listener interface to TermView. This allowed to get rid of
CustomTermView and of the messaging from view to window. It also simplified
things in TermWindow.


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


# 37322c4b 16-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added new class ShellParameters that bundles all parameters passed to the
shell.
* Also added a parameter for the current working directory and. If supplied,
it is applied in Shell::_Spawn().
* Pass the current working directory of the active tab when opening a new
tab. Implements part of #6712.


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


# b27862d2 16-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Reverted r39451. Instead introduced new class ActiveProcessInfo and added
method GetActiveProcessInfo() to Shell and TermView to get such an info for
the current foreground process group leader. Currently the info only contains
the ID, name, and current directory of the process.


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


# 5a76a2c1 16-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ActiveProcessGroup() getter to Shell and TermView.


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


# ffad8506 28-Oct-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Remove the setting for a fixed cursor color. Instead, the cursor now inverts the colors of the char below it.
* This allows getting a cursor well visible both on black and white backgrouds.


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


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

Change the way fore and back-color are handled by terminal. They are now color 0 and 7 in the color table, instead of entirely separate colors. This makes more sense and allows the colors to stay even in apps using other colors.
Also make the color attribute propagate to the end of a line. This fixes part of #6143 and allows to use vim with a multicolor syntax highlighting without too much trouble.


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


# d9fdb4f6 20-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added Shell::HasActiveProcesses() and TermView::IsShellBusy() (which calls
the former) to tell if some process launched from the terminal is still
running. Some style fix in Shell.h, made a parameter const.
Added basic TermWindow::QuitRequested()


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


# 8c6aa65e 19-Dec-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented input method handling. Unfortunately, due to bug #4926, it's
completely unusable (it's disabled currently anyway).
Shell::AttachBuffer() returns a status_t now (instead of void), so the caller
can do something in case it fails.
Simplified some methods, removed unused stuff.


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


# bc78ca93 30-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed unused input method variables. Input method handling will
be implemented someday, but probably differently anyway.


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


# b79c4995 27-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted the preference saving part of r34165 (at least for now).
Moved the AboutRequested code to a static TermView method, called from
everywhere (now TermApp knows about TermView, but no one is perfect).
Reordered and removed includes.


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


# b5504a51 24-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved includes from the header to the implementation


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


# abc3e030 22-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

TermView can also work as a child of a BScrollView


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


# 07da5d7c 21-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed TermView when used with the constructor which accepts a BRect:
In that case TermView computes rows and columns based on the frame size.
This also made simpler to attach a TermView to a given BWindow, like done
in the RepliTerminal test app. Changed Repliterminal accordingly.
Removed the bool parameter from SetTermSize(), and added a SetTermSize which
accept a BRect, as well.


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


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

Removed dependency to the global gMouseClipboard from TermView. Now there's
a SetMouseClipboard() method to set one (defaults to be_clipboard, maybe
it's not a good idea and should default to NULL instead).


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


# 17ecdb5b 20-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

TermView doesn't know about PrefHandler anymore (again), so that, in case
it's used as replicant (but I think it won't work anymore, yet),
it doesn't influence the global settings.
TermWindow saves the preferences on quit, if the PrefWindow was never
instantiated. This allows the window size to be saved also when it's
resized manually (not via menu).


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


# 61646809 15-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

The cursor didn't start blinking, unless the window was activated (by clicking outside and then inside the window).
Copied the BTextView mechanism: Activate and Deactivate the view on MakeFocus
and WindowActivated.


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


# 3b5c4663 05-Apr-2009 Jonas Sundström <jonas@kirilla.com>

Suppress ResizeView (the grey rows & columns view) when entering/leaving fullscreen mode, and when zooming. Its useful only when manually resizing the window. In the other cases it simply flickers by.

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


# 7aed1511 14-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* The window size is no longer directly saved when you change it in the menu.
* "Save as Default" now also saves the current Terminal size.
* Exchanged the strange default Termina sizes with some others, added a
separator between the full screen setting.
* Removed the "Term" prefix from TermView::fTerm{Columns|Rows}.
* Whitespace cleanup.


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


# cee9364a 25-Jan-2009 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Clemens Zeidler which gives the Terminal a nice context
menu with additional options when dropping files from Tracker into the
Terminal. Thanks a lot, Clemens!


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


# 08a6ab44 15-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a _MouseDistanceSinceLastClick() that returns the square of the pixel
distance of the last click and the point passed in.
* Use this one to delay starting of character wide selections.
* Also, treat double/triple clicks as single clicks if the mouse moved too far.


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


# 302809b4 14-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Moved duplicated initializers to the _InitObject() method.
* Cleanup.


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


# c2f7e34f 15-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* When resizing the Terminal, we now show a small BStringView that displays the
current size of the Terminal in characters.
* Minor cleanup.


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


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

Use the preferred history size. It's not settable via GUI yet, but one
can edit the settings file. The default are 10000 lines BTW.


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


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

Fixed mouse copy'n'paste support. We use a separate clipboard for mouse
selection which we update whenever the first mouse button is released.
This also enables copy'n'paste between Terminals.


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


# 0ee6c1ea 10-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* TermView does now maintain an additional visible area sized
BasicTerminalBuffer. It synchronizes this buffer with the actual
terminal buffer and uses it for drawing. This does significantly
decrease the time the terminal buffer is locked by the window thread,
and avoids the necessity to do invalidations in Draw() when the
terminal buffer changed in the meantime.
* When the view detects heavy scrolling of the terminal buffer due to
lots of continued output, it throttles redraws to one every 0.1s. The
detection condition might need some fine-tuning -- it's probably a bit
too strict for most situations.

I guess I'm done now with optimizations. After testing on real iron for
the first time, I'm a little impressed. In the "time seq ..." speed
competition Haiku's Terminal easily beats Konsole by 10 to 20% for 80x25
and by factor 3+ for full screen. And if I interpret the results
correctly 90% of the time is actually used by "seq" itself which seems
to be about 5 times slower than under Linux.


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


# 66b7ce85 11-May-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

We shoulnd't mess with the pulse rate of the window, since if we are a
replicant, the window is not ours. Blinking the cursor is now done with
a BMessageRunner.
Removed the dragger for the time being, since Terminal as a replicant
has some issues.


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


# 1d759616 07-Feb-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Call BScrollBar::SetSteps() with the correct values also on font change,
and when a scrollbar is attached. Fixes bug #1759


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


# 58cf7360 29-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added shortcuts to increase and decrease the font size. Since
these key combinations (ALT + +/-) can't be used on many keymaps, we
might want to change. Moved view resizing to a private window method.
Seems to work, more or less (ticket #1334)


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


# a08f19d5 22-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Limit the number of tabs to 6 per window (at least for now). More tabs
are not that useful, and the terminal doesn't like it anyway.


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


# 2fa152e4 18-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed more methods, fixed a warning


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


# e97cd7f1 18-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed some methods so that it's clearer what they do.


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


# 7014c8a3 17-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed support for "Full font", which wasn't used anyway. Since
our Terminal only works correctly with fixed width fonts, now the font
menu filters out variable width ones. For some reason, though, Konatu
Tohaba isn't recognized as fixed. Various other changes.


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


# ee3f1027 04-Dec-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Selecting text from right to left didn't work. I disabled the use of
ResizeSelection() because it didn't support this. Selecting text flicker
a lot now, it will be fixed later. Selection should be changed to work a
bit more like BTextView. This fixes bug #1638


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


# e7b04029 18-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Finally got rid of the mouse tracking thread. Put the code inside
MouseMoved(). Everything _seems_ to work like it did before, but there
might be some regressions...


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


# b86754c3 13-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Simplified a bit some code


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


# dbc03773 28-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a SIGCHLD handler, so that the terminal will notice when one of
its shells has been terminated. Usually the thread reading from the tty
master would notice when all slaves have been closed, but they won't be
closed when the shell started a background job that's still living.

Unfortunately there are race conditions in the terminal that can lead to
deadlock when a session is closed. The service threads usually happily
lock the window, while the (locked) window would wait for the service
threads to quit.



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


# 40056ffa 22-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed CURON/CUROFF constants. Use a boolean instead.


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


# bb4632f1 16-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Stolen Ingo's Arguments class from Miniterminal and used it in place of
GPL'd code in TermApp (slightly modified, and bugfixed, even :P).
TermView now accepts an argument vector instead of a commandline. Same
thing for Shell.
Temporarily(?) removed some commandline options.
This also fixes bug #1396 (tested)


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


# 18f004cc 03-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Made some TermView functions (Paste, Copy, etc) public. Made
SetTitle and NotifyQuit virtual. TermWindow now uses a TermView
subclass which closes the tab on NotifyQuit. Enabled tabbed
terminal. There are still some small glitches, most probably related
to BTabView bugs ?



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


# 2b87a97a 03-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Attach/DetachShell are now private. Added a new TermView constructor
which only specifies the rows and columns, view size is automatically
calculated, and used it in TermWindow. Added a TermView::SetTitle()
method, thus TermParse doesn't call Window() anymore. Some cleanups,
scrollbar was off by one.


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


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

Implemented B_ABOUT_REQUESTED in TermView, for the replicant version.


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


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

Added a TermView::NotifyQuit() method, used in TermParse, so it doesn't
mess with be_app anymore. Renamed TermView private methods to have an
underscore prefix.


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


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

Don't use exceptions in TermView constructor, as it would cause problems
with instantiation. Note that if an error occurs in the constructor,
we're pretty much screwed. Made some TermView functions private. Some
small cleanup, and some WIP code.


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


# 69adf535 28-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

TermView and the classes used by it now don't know about PrefHandler
anymore, but have methods to set the needed options. Various cleanups.


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


# cd2b8867 27-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed weird code in TermWindow::WindowActivated. Added basic
Archive(), Instantiate(), and unarchiving constructor.


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


# 258e9494 27-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

More work towards a tabbed terminal. Actually it already somewhat works
(code not enabled, though). Moved scripting from TermWindow to
TermView. Added a SmartTabView which (for now) only resizes the
child views to fit their size. Usual cleanups.


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


# feaebcb5 26-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Encoding is now a property of TermView. Changed a lot of code to fix the
problems caused by this change. MakeEncodingMenu doesn't mark the
current encoding anymore, it was already done in TermWindow::MenusBeginning().
Removed custom enums for encodings, just use the ones provided in UTF8.h.
I'm more and more convinced we should drop the custom conversion routines
and use the system ones.


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


# f14a8c58 25-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed more unused stuff. Cleanups.



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


# d75fc058 25-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Had switched rows and columns in SetTermSize() call inside TermView's
constructor. Made UpdateSIGWINCH() private and renamed it to
_UpdateSIGWINCH().


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


# 702e4be8 25-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved all TermView initializing code into TermView itself. Before you
couldn't just rely on its constructor to fully initialize the object,
since the code was scattered around, mostly into TermWindow. Added a
commented out TermWindow constructor which only creates and adds a
TermView object to the view hierarchy, which now works.
Removed weird TermWindowActivate method, use WindowActivated
instead. TermApp can now keep a pointer to a BWindow instead of
TermWindow, since it doesn't do anything special with it.
TermView::SetTermFont() now can filter the font attributes (it uses
B_FIXED_SPACING, I'm not sure it's needed but it doesn't hurt). Usual
cleanups.


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


# 6fbf283f 22-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed a bug where Terminal couldn't set itself to fullscreen the first
time. Some minor cleanups.


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


# e0ba8e50 29-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Got rid of the drawing thread, drawing is faster using the "correct"
approach. There are still some leftovers, will be taken care in the next
commits (not today though)


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


# 645b01f2 27-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Got rid of fSelected, no need to maintain a separate variable to check
if we have a selection. Now there's a "HasSelection()" method which just
checks if fSelStart and fSelEnd are different.


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


# 5240f115 26-Apr-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed unused methods and variables, small style cleanups


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


# ef502a7e 20-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Removed useless context menu.
* Removed useless mouse button preferences.
* The secondary and tertiary buttons now both paste the selection (or clipboard data)
into the Terminal, this fixes bug #1159.


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


# f2b50593 11-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

renamed pfd to gPfd as it's a global variable, fixed indentation in
TermView.cpp, other style changes


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


# b1904124 07-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

got rid of the tty_name global


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


# f95dbf89 22-Aug-2006 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Implement Find in Terminal. This is almost identical to R5's Terminal, except that it doesn't look for regexps. Code tested by me. Thanks to jburton for helping me out and reviewing the patch.

This resolves bug #199.


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


# 289ca930 22-May-2006 François Revol <revol@free.fr>

Added a Fullscreen shortcut (ALT-ENTER).


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


# 3e3c4ddc 06-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fFontHeight and fFontWidth weren't initialized in the TermView constructor, could cause some problems. Might fix bug 201, although I could never reproduce it consistently

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


# 31c5d829 14-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Don't mark inline what is defined in the source file, but used from
other compilation units too. gcc 4 is quite consequent and doesn't
generate non-inlined code for such a function.


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


# be3f404ca1068e9d0ae262ed4ab4fab2fa91b103 13-Feb-2014 Jonathan Schleifer <js@webkeks.org>

Terminal: Add option to use bright instead of bold text

A saturated add was chosen instead of tint_color, as the results of
tint_color were too extreme.


# 82055c267baf1d5e592f833d04755c4e896b3940 02-Sep-2013 Siarzhuk Zharski <zharik@gmx.li>

Terminal:send resize notify on attaching window to view

During adding the second tab the view in the first one may change its
lines count in case the Terminal window was maximized. Send resize
notification to client rpogram on every reattaching view to window.

Fixes #9809


# 8a8a325a1e68b83f1eb4960cc9842778554c83bd 19-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Terminal: work-around missing/out-of-order modifiers events

... more aggressively than before:
* Only use modifiers().
* Before forwarding any relevant event to the active state, first check
whether the modifiers have changed.

While the issues should really be fixed where they originate (app
server?), this hopefully fixes all situations where the hyperlink mode
gets stuck.


# 7de99f83417fa30af420669e56f8cdb5342c3e61 10-May-2013 Rene Gollent <anevilyak@gmail.com>

Fix Terminal build.


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

Terminal: Add a hyperlink mode

When holding down Command, text under the mouse is checked whether it
looks like a URL or a local path. If so, it is highlighted and can be
clicked, which will open the URL/file. Right-clicking opens a context
menu with items for opening the link/file or copying it to the
clipboard. When additionally holding down Shift, path prefixes up to
the component under the mouse will be considered (no effect for URLs).

Changes:
* Add HyperLink class. Encapsulates a type, the address, and an
optional base address. Features an Open() method to open the address.
* Move/add some string constants to TermConst.
* Move TermView::CharClassifier to top level and rename to
DefaultCharClassifier.
* Introduce TermViewHighlight and TermViewHighlighter. The former
refers to a range of text in a TermView's text buffer. It also
contains a pointer to a TermViewHighlighter object, which specifies
how the text range shall be rendered (colors and attributes).
* TermView:
- Add respective _{Add,Remove}Highlight() methods and adjust the code
to support highlights.
- Make the selection a TermViewHighlight. At least its visual aspect
is now handled like other highlights.
- Introduce an inner TextBufferSyncLocker. It is used instead of
BAutolock when locking the text buffer to synchronize the visual
buffer with it. After it unlocks it calls
_VisibleTextBufferChanged(), if the visual text buffer has changed,
which in turn calls a new callback on the active state.
- Add WindowActivated() and ModifiersChanged() callbacks to the state
interface.
- Add new states HyperLinkState and HyperLinkMenuState which
implement the new feature.

Fix modifier issues


# bda35ef5dc71c1c4a4e831233f937bcb130bd284 09-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Terminal: Pull user input handling into state classes


# 19bfeaa78642fedb092eeaea7bab826753f39bd5 24-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Support %e (cur.encoding) for Terminal titles

Optional parameter %e to indicate current tab view encoding in the
window title. It is not shown in case tab view encoding is default
UTF-8. Inspired by Sergei Reznikov. Thanks.


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

Optimize SIGWINCH Shell notification

Fixes issue with missed SIGWINCH shell notification in case the
Terminal frame was resized by using any of "Settings"->"Window size"
menu items.

Fixes #9293 - original problem was pointed out by Ziusudra. Thank you!


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


# fe256869783dc1598ee2d7d0c0b582e70724dc96 08-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Move colors table from TermView to TerminalBuffer

* ColorsTable moved to TerminalBuffer to let easy lookup of table
during parsing of control sequences;
* Default Palette initialized from now in TermApp and preserved
from modifying by applications;


# bbfd23abd5e9cddd8498376d21ac53a96d5c4cb7 09-Jan-2013 Siarzhuk Zharski <zharik@gmx.li>

Use native bold style drawing (+ switchable emulation)

Use native bold font for rendering characters with corresponding
attribute set. Possibility for switching to R5-like bold characters
emulation is also implemented. This one uses uses the left-down shadow
in B_OP_BLEND drawing mode instead of the rigth-down one as previously.


# 6d30b376e908fe678fc35c79d58314367f3d44fe 05-Mar-2013 Siarzhuk Zharski <zharik@gmx.li>

Support for underline and ibeam terminal cursor styles

* Add support for underline and i-beam cursor shapes. No corresponding
UI configuration in preferences view ATM because preferences are waiting
for refactoring and we need some eggs for this Easters. ;-)
* Add handling of VT520/xterm specific DECSCUSR control sequences
allowing applications to modify the style and blinking state of the
cursor. May be utilized, for example, by console version of vim;
* Implement cursor blinking/hiding on DECSET/DECRST commands.


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


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

Revert hrev38316 fore-/background colors customization

This reverts hrev38316 in parts of foreground and background colors
handling. Mentioned revision has hardcoded colors to system ANSI color
entries 7 and 0 correspondently. It is very uncomfortable for the
console programs like Midnight Commander because they become
colors that were defined in the current Terminal scheme and doesn't
correspond to real ANSI color names. For example "ANSI black" can be
black, white, blue, gray or something else in dependency of the current
color scheme configuration. The same side-effect was obviously observed
for "ANSI white" and produced funny color combinations in software.


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


# 122905281dd29a0ee9ef35dd280a33aab21e6c3d 05-Nov-2012 Jonathan Schleifer <js@webkeks.org>

Terminal: Make the cursor color configurable.

Signed-off-by: Adrien Destugues - PulkoMandy <pulkomandy@pulkomandy.tk>


# fdd2b7ebb1697c86a1adaac3ac9eecc661d0509b 27-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Removal of the About window.

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


# e9e3be37f972cdfeee69a51016c3a4ed4fa79e95 23-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Coding style cleanup.


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


# ca598670fb927e196eb2a5ab90fa03bfb5dac0a2 22-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed the shell process ID from ActiveProcessInfo and moved it to new class
ShellInfo, which also contains a flag whether the shell is the default shell.
* If the Terminal has been started with a custom shell, also replace "%p" in
the title by its name, when active.
* Also show the on-close alert for the custom shell.

Fixes #6844.


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


# 38d5ce6271ca1648326ffa64cf38bb461e76242e 18-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed "move" parameter from the
TermView::Listener::{Previous,Next}TermView() methods. All B_COMMAND_KEY
combos are intercepted by the window, so we never get them in the view.
* Added window shortcut Command-Shift-Left/Right to move the tabs.


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


# 92b0038ec03c6184daa8588f01c7684aef0b002b 18-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a listener interface to TermView. This allowed to get rid of
CustomTermView and of the messaging from view to window. It also simplified
things in TermWindow.


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


# 37322c4b52e4d9922fb1c7289a3f0d129ab1841b 16-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added new class ShellParameters that bundles all parameters passed to the
shell.
* Also added a parameter for the current working directory and. If supplied,
it is applied in Shell::_Spawn().
* Pass the current working directory of the active tab when opening a new
tab. Implements part of #6712.


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


# b27862d236b20483e88aa24aa8e2d8fed2e00907 16-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Reverted r39451. Instead introduced new class ActiveProcessInfo and added
method GetActiveProcessInfo() to Shell and TermView to get such an info for
the current foreground process group leader. Currently the info only contains
the ID, name, and current directory of the process.


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


# 5a76a2c142ef0d79e2fb944a76a213921992a035 16-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ActiveProcessGroup() getter to Shell and TermView.


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


# ffad85060af9d695c5eb0468c91b8a438d42d638 28-Oct-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Remove the setting for a fixed cursor color. Instead, the cursor now inverts the colors of the char below it.
* This allows getting a cursor well visible both on black and white backgrouds.


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


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

Change the way fore and back-color are handled by terminal. They are now color 0 and 7 in the color table, instead of entirely separate colors. This makes more sense and allows the colors to stay even in apps using other colors.
Also make the color attribute propagate to the end of a line. This fixes part of #6143 and allows to use vim with a multicolor syntax highlighting without too much trouble.


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


# d9fdb4f6cdba4e444b19404e3d4dfe1c86b2f575 20-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added Shell::HasActiveProcesses() and TermView::IsShellBusy() (which calls
the former) to tell if some process launched from the terminal is still
running. Some style fix in Shell.h, made a parameter const.
Added basic TermWindow::QuitRequested()


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


# 8c6aa65eb6a967af6ade9abeee7c961ff84005c7 19-Dec-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented input method handling. Unfortunately, due to bug #4926, it's
completely unusable (it's disabled currently anyway).
Shell::AttachBuffer() returns a status_t now (instead of void), so the caller
can do something in case it fails.
Simplified some methods, removed unused stuff.


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


# bc78ca9385aeee697bd87575f8af64372482dd64 30-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed unused input method variables. Input method handling will
be implemented someday, but probably differently anyway.


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


# b79c499571a5116074f1ee887d2b685eb7e11e20 27-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted the preference saving part of r34165 (at least for now).
Moved the AboutRequested code to a static TermView method, called from
everywhere (now TermApp knows about TermView, but no one is perfect).
Reordered and removed includes.


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


# b5504a512c93771a1f666fc6d0d190943c5f97c8 24-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved includes from the header to the implementation


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


# abc3e030074c6de83000c10d2d4c02f359873006 22-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

TermView can also work as a child of a BScrollView


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


# 07da5d7cce4cf0717d7530b3b8d23dbb5daa69fe 21-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed TermView when used with the constructor which accepts a BRect:
In that case TermView computes rows and columns based on the frame size.
This also made simpler to attach a TermView to a given BWindow, like done
in the RepliTerminal test app. Changed Repliterminal accordingly.
Removed the bool parameter from SetTermSize(), and added a SetTermSize which
accept a BRect, as well.


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


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

Removed dependency to the global gMouseClipboard from TermView. Now there's
a SetMouseClipboard() method to set one (defaults to be_clipboard, maybe
it's not a good idea and should default to NULL instead).


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


# 17ecdb5b2f88c22bb3271cdd77dc5c42a462c483 20-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

TermView doesn't know about PrefHandler anymore (again), so that, in case
it's used as replicant (but I think it won't work anymore, yet),
it doesn't influence the global settings.
TermWindow saves the preferences on quit, if the PrefWindow was never
instantiated. This allows the window size to be saved also when it's
resized manually (not via menu).


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


# 61646809a3b5f7119937aedaba55b8c3f77fdfd9 15-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

The cursor didn't start blinking, unless the window was activated (by clicking outside and then inside the window).
Copied the BTextView mechanism: Activate and Deactivate the view on MakeFocus
and WindowActivated.


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


# 3b5c46634dd9d7ce056bfaf358ecbf736effad36 05-Apr-2009 Jonas Sundström <jonas@kirilla.com>

Suppress ResizeView (the grey rows & columns view) when entering/leaving fullscreen mode, and when zooming. Its useful only when manually resizing the window. In the other cases it simply flickers by.

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


# 7aed1511f61ffb1e3c418dbbf797d6b2cf490910 14-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* The window size is no longer directly saved when you change it in the menu.
* "Save as Default" now also saves the current Terminal size.
* Exchanged the strange default Termina sizes with some others, added a
separator between the full screen setting.
* Removed the "Term" prefix from TermView::fTerm{Columns|Rows}.
* Whitespace cleanup.


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


# cee9364ac546bf48aa160a7afe3752da92483b02 25-Jan-2009 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Clemens Zeidler which gives the Terminal a nice context
menu with additional options when dropping files from Tracker into the
Terminal. Thanks a lot, Clemens!


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


# 08a6ab444bfb2c09e42517f899158f57a64b3200 15-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a _MouseDistanceSinceLastClick() that returns the square of the pixel
distance of the last click and the point passed in.
* Use this one to delay starting of character wide selections.
* Also, treat double/triple clicks as single clicks if the mouse moved too far.


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


# 302809b46f27b3ab856a0472683cf764fca29ca9 14-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Moved duplicated initializers to the _InitObject() method.
* Cleanup.


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


# c2f7e34f8d7fd26dae5fdf60ebf6a62e8048c028 15-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* When resizing the Terminal, we now show a small BStringView that displays the
current size of the Terminal in characters.
* Minor cleanup.


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


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

Use the preferred history size. It's not settable via GUI yet, but one
can edit the settings file. The default are 10000 lines BTW.


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


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

Fixed mouse copy'n'paste support. We use a separate clipboard for mouse
selection which we update whenever the first mouse button is released.
This also enables copy'n'paste between Terminals.


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


# 0ee6c1ea216f2b06283adc82c7d0c4ec821a8199 10-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* TermView does now maintain an additional visible area sized
BasicTerminalBuffer. It synchronizes this buffer with the actual
terminal buffer and uses it for drawing. This does significantly
decrease the time the terminal buffer is locked by the window thread,
and avoids the necessity to do invalidations in Draw() when the
terminal buffer changed in the meantime.
* When the view detects heavy scrolling of the terminal buffer due to
lots of continued output, it throttles redraws to one every 0.1s. The
detection condition might need some fine-tuning -- it's probably a bit
too strict for most situations.

I guess I'm done now with optimizations. After testing on real iron for
the first time, I'm a little impressed. In the "time seq ..." speed
competition Haiku's Terminal easily beats Konsole by 10 to 20% for 80x25
and by factor 3+ for full screen. And if I interpret the results
correctly 90% of the time is actually used by "seq" itself which seems
to be about 5 times slower than under Linux.


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


# 66b7ce851c82e95702dce45babdf21a21eb29106 11-May-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

We shoulnd't mess with the pulse rate of the window, since if we are a
replicant, the window is not ours. Blinking the cursor is now done with
a BMessageRunner.
Removed the dragger for the time being, since Terminal as a replicant
has some issues.


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


# 1d7596167d9d16fabbaf75e526219d145f539a27 07-Feb-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Call BScrollBar::SetSteps() with the correct values also on font change,
and when a scrollbar is attached. Fixes bug #1759


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


# 58cf7360ca244204ce36f51f6dca8b0e93afccf5 29-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added shortcuts to increase and decrease the font size. Since
these key combinations (ALT + +/-) can't be used on many keymaps, we
might want to change. Moved view resizing to a private window method.
Seems to work, more or less (ticket #1334)


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


# a08f19d598eb82d5f31881b0059d0d6d29facf6f 22-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Limit the number of tabs to 6 per window (at least for now). More tabs
are not that useful, and the terminal doesn't like it anyway.


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


# 2fa152e4f08d89b487f16ac6fb4e3a14aceac028 18-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed more methods, fixed a warning


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


# e97cd7f18bd05effc5cd2d7e2c3e022ae5fe7136 18-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed some methods so that it's clearer what they do.


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


# 7014c8a3790cfbd79887ef7092b6c89ad9e548bd 17-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed support for "Full font", which wasn't used anyway. Since
our Terminal only works correctly with fixed width fonts, now the font
menu filters out variable width ones. For some reason, though, Konatu
Tohaba isn't recognized as fixed. Various other changes.


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


# ee3f1027befc09eaf6f2674fc3a8920b62c0af11 04-Dec-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Selecting text from right to left didn't work. I disabled the use of
ResizeSelection() because it didn't support this. Selecting text flicker
a lot now, it will be fixed later. Selection should be changed to work a
bit more like BTextView. This fixes bug #1638


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


# e7b0402927d91cd7eaa43fb1fa36df8f469b9983 18-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Finally got rid of the mouse tracking thread. Put the code inside
MouseMoved(). Everything _seems_ to work like it did before, but there
might be some regressions...


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


# b86754c363df9102a470838aa0cfba3550f7d74f 13-Sep-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Simplified a bit some code


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


# dbc03773ef3b00c0daf4f4cdd8871f0a4072d094 28-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a SIGCHLD handler, so that the terminal will notice when one of
its shells has been terminated. Usually the thread reading from the tty
master would notice when all slaves have been closed, but they won't be
closed when the shell started a background job that's still living.

Unfortunately there are race conditions in the terminal that can lead to
deadlock when a session is closed. The service threads usually happily
lock the window, while the (locked) window would wait for the service
threads to quit.



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


# 40056ffaaf9a13fc5cbc8087c059bb974ad39c9c 22-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed CURON/CUROFF constants. Use a boolean instead.


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


# bb4632f1ecfa5b77c87683e446ff7db70c636baf 16-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Stolen Ingo's Arguments class from Miniterminal and used it in place of
GPL'd code in TermApp (slightly modified, and bugfixed, even :P).
TermView now accepts an argument vector instead of a commandline. Same
thing for Shell.
Temporarily(?) removed some commandline options.
This also fixes bug #1396 (tested)


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


# 18f004cc71de4c9a75ca5892aa493e2bc289e171 03-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Made some TermView functions (Paste, Copy, etc) public. Made
SetTitle and NotifyQuit virtual. TermWindow now uses a TermView
subclass which closes the tab on NotifyQuit. Enabled tabbed
terminal. There are still some small glitches, most probably related
to BTabView bugs ?



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


# 2b87a97ac6932e3421e0a8a071a7d31f00ec9c73 03-Aug-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Attach/DetachShell are now private. Added a new TermView constructor
which only specifies the rows and columns, view size is automatically
calculated, and used it in TermWindow. Added a TermView::SetTitle()
method, thus TermParse doesn't call Window() anymore. Some cleanups,
scrollbar was off by one.


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


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

Implemented B_ABOUT_REQUESTED in TermView, for the replicant version.


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


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

Added a TermView::NotifyQuit() method, used in TermParse, so it doesn't
mess with be_app anymore. Renamed TermView private methods to have an
underscore prefix.


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


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

Don't use exceptions in TermView constructor, as it would cause problems
with instantiation. Note that if an error occurs in the constructor,
we're pretty much screwed. Made some TermView functions private. Some
small cleanup, and some WIP code.


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


# 69adf535c1b4469dc0991c4c9c07f2dea81f18a4 28-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

TermView and the classes used by it now don't know about PrefHandler
anymore, but have methods to set the needed options. Various cleanups.


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


# cd2b8867e1d331be8bfb4f0db30f659c82e30907 27-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed weird code in TermWindow::WindowActivated. Added basic
Archive(), Instantiate(), and unarchiving constructor.


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


# 258e949475ef1971cc5560dd0715f7199123e7a4 27-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

More work towards a tabbed terminal. Actually it already somewhat works
(code not enabled, though). Moved scripting from TermWindow to
TermView. Added a SmartTabView which (for now) only resizes the
child views to fit their size. Usual cleanups.


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


# feaebcb571a64ea882404db119de225ad703c6eb 26-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Encoding is now a property of TermView. Changed a lot of code to fix the
problems caused by this change. MakeEncodingMenu doesn't mark the
current encoding anymore, it was already done in TermWindow::MenusBeginning().
Removed custom enums for encodings, just use the ones provided in UTF8.h.
I'm more and more convinced we should drop the custom conversion routines
and use the system ones.


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


# f14a8c580104cc3dcdefefb04661ef93a369da8d 25-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed more unused stuff. Cleanups.



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


# d75fc058290fb66f2b4098665aa714077ac83b33 25-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Had switched rows and columns in SetTermSize() call inside TermView's
constructor. Made UpdateSIGWINCH() private and renamed it to
_UpdateSIGWINCH().


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


# 702e4be807966ff71d1c6d71b46f93d3e83314c9 25-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved all TermView initializing code into TermView itself. Before you
couldn't just rely on its constructor to fully initialize the object,
since the code was scattered around, mostly into TermWindow. Added a
commented out TermWindow constructor which only creates and adds a
TermView object to the view hierarchy, which now works.
Removed weird TermWindowActivate method, use WindowActivated
instead. TermApp can now keep a pointer to a BWindow instead of
TermWindow, since it doesn't do anything special with it.
TermView::SetTermFont() now can filter the font attributes (it uses
B_FIXED_SPACING, I'm not sure it's needed but it doesn't hurt). Usual
cleanups.


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


# 6fbf283fb59bc5c78f2939d9009a33e662ad3129 22-Jul-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed a bug where Terminal couldn't set itself to fullscreen the first
time. Some minor cleanups.


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


# e0ba8e50cc2673c6d4a1733f368ec7c248551b28 29-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Got rid of the drawing thread, drawing is faster using the "correct"
approach. There are still some leftovers, will be taken care in the next
commits (not today though)


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


# 645b01f225aafb51645570d0add2dc3904a7d433 27-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Got rid of fSelected, no need to maintain a separate variable to check
if we have a selection. Now there's a "HasSelection()" method which just
checks if fSelStart and fSelEnd are different.


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


# 5240f11543de98674493a3256764bcaf86b20dda 26-Apr-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed unused methods and variables, small style cleanups


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


# ef502a7eb33440462ad3219c94d2bb46d1c5183b 20-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Removed useless context menu.
* Removed useless mouse button preferences.
* The secondary and tertiary buttons now both paste the selection (or clipboard data)
into the Terminal, this fixes bug #1159.


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


# f2b50593a83669a4e181d492db3c771dfc38fadb 11-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

renamed pfd to gPfd as it's a global variable, fixed indentation in
TermView.cpp, other style changes


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


# b19041249debf4198f24c60bb78a86e4ad35f47e 07-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

got rid of the tty_name global


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


# f95dbf89065f63a1ed5c4588d7c263a3b9489806 22-Aug-2006 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Implement Find in Terminal. This is almost identical to R5's Terminal, except that it doesn't look for regexps. Code tested by me. Thanks to jburton for helping me out and reviewing the patch.

This resolves bug #199.


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


# 289ca930ab86dfbe6bcee18b7feb0604bdf169b8 22-May-2006 François Revol <revol@free.fr>

Added a Fullscreen shortcut (ALT-ENTER).


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


# 3e3c4ddcceb6851b287fe5862810ad5ce98df826 06-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fFontHeight and fFontWidth weren't initialized in the TermView constructor, could cause some problems. Might fix bug 201, although I could never reproduce it consistently

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


# 31c5d829c9f7bf06785e064284425fd23b3292c5 14-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Don't mark inline what is defined in the source file, but used from
other compilation units too. gcc 4 is quite consequent and doesn't
generate non-inlined code for such a function.


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