Commit Graph

109 Commits

Author SHA1 Message Date
Tiago Cunha
a432fcd306 Sync OpenBSD patchset 1150:
xfree is not particularly helpful, remove it. From Thomas Adam.
2012-07-11 19:34:16 +00:00
Tiago Cunha
dc83ba0372 Sync OpenBSD patchset 1065:
Michael Krysiak points out that some terminals (eg mintty) have cursor
styles 5 and 6 too, so allow them to be set.
2012-03-18 02:11:27 +00:00
Tiago Cunha
391f1f08c0 Expand the Id keyword. 2011-07-09 09:42:33 +00:00
Tiago Cunha
b2f301f4e2 Sync OpenBSD patchset 916:
Support DECSCUSR sequence to set the cursor style with two new
terminfo(5) extensions, Cs and Csr. Written by Ailin Nemui.
2011-05-22 16:26:09 +00:00
Tiago Cunha
719755574d Sync OpenBSD patchset 915:
Support xterm(1) cursor colour change sequences through terminfo(5) Cc
(set) and Cr (reset) extensions. Originally by Sean Estabrooks, tweaked
by me and Ailin Nemui.
2011-05-22 16:25:02 +00:00
Tiago Cunha
b5812013ef Sync OpenBSD patchset 901:
Don't use strnvis for the title as it breaks UTF-8. set-titles is now
off by default and we have to trust the terminal can understand what we
send it anyway so there isn't any harm.
2011-05-05 10:10:57 +00:00
Nicholas Marriott
0b8ce56d73 Fix rectangle copy to behave like emacs - the cursor is not part of the
selection on the right edge but on the left it is.
2010-12-11 17:57:28 +00:00
Nicholas Marriott
11497af4dd Solaris has MAXHOSTNAMELEN in netdb.h. 2010-07-19 18:31:42 +00:00
Nicholas Marriott
3743238a86 From Bob Beck:
rather than using an empty "" as the default window title, put the hostname
of the machine we are running on in there.

makes my many green lines easier to deal with without using fiddly options to
set it.
2010-04-06 22:01:32 +00:00
Micah Cowan
2d74ce1d3a Merge output (more) and copy modes into one single mode (called copy). 2010-04-05 05:11:44 +00:00
Tiago Cunha
3c37b09272 Sync OpenBSD patchset 636:
Rectangle copy support, from Robin Lee Powell.
2010-02-08 18:13:17 +00:00
Tiago Cunha
4d8d70a846 Sync OpenBSD patchset 598:
Fix selection behaviour when the cursor is moved backwards (ie so the selection
start is after the end).
2010-01-05 23:54:53 +00:00
Tiago Cunha
cc094fdfe6 Sync OpenBSD patchset 581:
Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...
2009-12-04 22:14:47 +00:00
Tiago Cunha
37b0bcd7c1 Sync OpenBSD patchset 226:
Change the way the grid is stored, previously it was:

- a two-dimensional array of cells;
- a two-dimensional array of utf8 data;
- an array of line lengths.

Now it is a single array of a new struct grid_line each of which represents a
line and contains the length and an array of cells and an array of utf8 data.

This will make it easier to add additional per-line members, such as flags.
2009-08-09 17:28:24 +00:00
Tiago Cunha
09c6432854 Sync OpenBSD patchset 207:
Plug some memory leaks.
2009-07-30 21:14:04 +00:00
Nicholas Marriott
c30fbd1d8d When resizing a screen smaller in alternate screen mode, all the lines needed
could be consumed by deleting from the bottom, leaving none to be removed from
the top. In this case, don't call grid_view_delete_lines with ny of 0 as this
is incorrect and causes a bounds check to fatal error if built with -DDEBUG.
2009-07-18 11:06:35 +00:00
Nicholas Marriott
21cfef45d6 When resizing a screen smaller in alternate screen mode, all the lines needed
could be consumed by deleting from the bottom, leaving none to be removed from
the top. In this case, don't call grid_view_delete_lines with ny of 0 as this
is incorrect and causes a bounds check to fatal error if built with -DDEBUG.
2009-07-17 18:35:55 +00:00
Nicholas Marriott
e63567d51c Support "alternate screen" mode (terminfo smcup/rmcup) typically used by full
screen interactive programs to preserve the screen contents. When activated, it
saves a copy of the visible grid and disables scrolling into and resizing out
of the history; when deactivated the visible data is restored and the history
reenabled.
2009-07-14 06:40:33 +00:00
Nicholas Marriott
8be8016a76 When the terminal size is reduced horizontally, don't truncate lines to the new
width, so that if the same lines are later increased in size the content
reappears.
2009-07-12 17:03:11 +00:00
Nicholas Marriott
2ddcb51df3 Fix $Id$. 2009-07-08 18:03:03 +00:00
Nicholas Marriott
9875be3327 When reinitialising the screen, do not omit to clear the last line. 2009-07-08 18:02:31 +00:00
Nicholas Marriott
32312e0252 vis compat stuff. 2009-06-25 20:27:32 +00:00
Nicholas Marriott
a5830b9603 Restore $Id$ and add script to do so. 2009-06-25 16:21:32 +00:00
Nicholas Marriott
3ec8efc803 Fix a type mismatch warning in assignment. 2009-06-25 16:04:43 +00:00
Nicholas Marriott
e6e1b45fa1 Change to match xterm's resizing behaviour, including pushing lines into the
history from the top when reducing vertical size and pulling them again when
increasing size.
2009-06-25 16:02:10 +00:00
Nicholas Marriott
1b245388b5 Proper support for tab stops (\033H etc), using a bitstring(3). Makes another
vttest test happy.
2009-06-25 15:54:38 +00:00
Nicholas Marriott
7597cb6834 Pass window titles through vis(1). <0x20 is dropped anyway by the input state
machine but top-bit-set nonprintables could cause trouble, and they are neater
like this anyway.
2009-06-25 15:49:27 +00:00
Nicholas Marriott
143aa718e5 Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
Nicholas Marriott
cf7b384c43 Better UTF-8 support, including combined characters. Unicode data is now stored
as UTF-8 in a separate array, the code does a lookup into this every time it
gets to a UTF-8 cell. Zero width characters are just appended onto the UTF-8
data for the previous cell. This also means that almost no bytes extra are
wasted non-Unicode data (yay).

Still some oddities, such as copy mode skips over wide characters in a strange
way, and the code could do with some tidying.
2009-03-28 20:17:29 +00:00
Nicholas Marriott
6c0728fe07 Step 2 of the Grand Plan To Make UTF-8 Better.
Split grid into two arrays, one containing grid attributes/flags/colours (keeps
the name grid_cell for now) and a separate with the character data (called
text). The text is stored as a u_short but is treated as a uint64_t elsewhere;
eventually the grid will have two arrays.

I'm not happy with the naming so that might change.

Still need to decide where to go from here. I'm not sure whether to combine
the peek/set functions together, and also whether to continue to treat the
text as a uint64_t (and convert to/from Unicode) or make it a char array
(of size one when UTF-8 disabled, eight when enabled) and keep everything
as UTF-8.

Also since UTF-8 will eventually become an attribute of the grid itself it
might be nice to move all the padding crap into grid.c.
2009-03-28 16:30:05 +00:00
Nicholas Marriott
989d67ccd7 struct grid_data -> struct grid. Stage 1 of the Grand Plan To Make UTF-8 Better. 2009-03-28 15:43:41 +00:00
Nicholas Marriott
a1b43faa43 Trim spaces. 2009-01-10 01:51:22 +00:00
Nicholas Marriott
7a82e86827 Make window options work the same was as session options, add mode-fg/mode-bg options, force -g for global on set/show/setw/showw/ 2008-12-08 16:19:51 +00:00
Nicholas Marriott
23e7da1ccb Clear correct range. 2008-10-09 05:31:04 +00:00
Nicholas Marriott
c2a5ffa6a4 Shut gcc up. 2008-09-29 16:59:47 +00:00
Nicholas Marriott
9d6827ebb2 UINT_MAX. 2008-09-29 16:58:02 +00:00
Nicholas Marriott
62457bce0b Trim. 2008-09-26 06:45:28 +00:00
Nicholas Marriott
efe557313a Internal screen data rewrite for better 256 colour/UTF-8 support. 2008-09-25 20:08:57 +00:00
Nicholas Marriott
f07cedf048 Rename some functions. 2008-09-10 19:15:06 +00:00
Nicholas Marriott
ded348064a Split colour functions from screen. 2008-09-10 18:59:29 +00:00
Nicholas Marriott
19a2c87f04 Initial UTF-8 support. 2008-09-09 22:16:37 +00:00
Nicholas Marriott
6674197e85 Fix bold/non-bold mismatch in 256 colour mode by adding an extra 8 bits (ick) onto the attributes and using two of them to mark the fg and bg as 256 colours when necessary. If only it was 255 colours we would have one value for default and wouln't need this :-/. 2008-09-08 22:03:56 +00:00
Nicholas Marriott
4235ddb4e8 Initial 256 colour support, lightly tested. 2008-09-08 17:40:51 +00:00
Nicholas Marriott
3337dfcae5 Support keypad mode, and get rid of SCREEN_DEF*. Meant to commit these separately but forgot :-/. 2008-07-24 21:42:40 +00:00
Nicholas Marriott
815b217482 These flags are off by default. 2008-07-24 07:01:57 +00:00
Nicholas Marriott
ee8a9d2458 Handle kcursor+kkeypad (switch to OA from [A). 2008-07-24 00:03:15 +00:00
Nicholas Marriott
d90d646ca8 Zombie windows, requested by Will Maier. 2008-06-29 07:04:31 +00:00
Nicholas Marriott
99df48d70f Trimify. 2008-06-18 22:21:51 +00:00
Nicholas Marriott
62d7ad2690 Clear blank area properly on redraw, and add a marker line below it. 2008-06-14 12:05:06 +00:00
Nicholas Marriott
9e6090a7a2 Per-session configuration options. 2008-06-03 21:42:37 +00:00