Commit Graph

419 Commits

Author SHA1 Message Date
474fdebb7a Handle empty or unset TERM correctly; also fix a fatal() message while here. 2009-07-07 17:24:32 +00:00
9f0653386b $Id$. 2009-07-01 23:06:32 +00:00
eed4f7600d Fix $Id$. 2009-06-29 22:04:51 +00:00
edc2e7da98 Copy the 256-colour flag into the tty saved cell as well as the actual colour,
otherwise colour 8 isn't reset.
2009-06-29 22:03:09 +00:00
2660692fb1 Copy the 256-colour flag into the tty saved cell as well as the actual colour,
otherwise colour 8 isn't reset properly.
2009-06-27 12:57:14 +00:00
bb459beb03 Whitespace and more syncing. 2009-06-25 16:34:50 +00:00
a5830b9603 Restore $Id$ and add script to do so. 2009-06-25 16:21:32 +00:00
582660bdf3 Miscellaneous unused functions, including one which was basically a
duplicate. Found by lint.
2009-06-25 16:09:11 +00:00
947fabc751 Unused variables. Found by lint, no binary change. 2009-06-25 16:05:39 +00:00
942ea4267d Trying to predict the cursor position for UTF-8 output in the same way as for
normal eight-bit output is wrong, separate it into a different function. Fixes
spacing when mixing UTF-8 with some escape sequences, notably the way w3m does
it.
2009-06-25 16:01:26 +00:00
93631b3ca7 Implement the DEC alignment test. With the last change this is enough for the
first cursor test in vttest (in ports) to pass; it still shops a few more
problems though.
2009-06-25 15:51:54 +00:00
49477de55c Fix some miscalculations when clearing to start of screen: the number of lines
to the cursor is cy not cy - 1, and the current cursor cell should be included.
2009-06-25 15:50:48 +00:00
1675ddb4d1 Miscellaneous unused functions, including one which was basically a
duplicate. Found by lint.
2009-06-25 06:15:04 +00:00
83078bdcbc Unused variables. Found by lint, no binary change. 2009-06-25 05:56:44 +00:00
0fdd47660a UTF-8 detection is broken on sparc64; disable until I get time to test it further. 2009-06-24 17:31:03 +00:00
2de599ac0e Trying to predict the cursor position for UTF-8 output in the same way as for
normal eight-bit output is wrong, separate it into a different function. Fixes
spacing when mixing UTF-8 with some escape sequences, notably the way w3m does
it.
2009-06-24 16:01:02 +00:00
52ec9b9ec4 Implement the DEC alignment test. With the last change this is enough for the
first cursor test in vttest (in ports) to pass; it still shops a few more
problems though.
2009-06-03 23:30:40 +00:00
ebe07c2726 Fix some miscalculations when clearing to start of screen: the number of lines
to the cursor is cy not cy - 1, and the current cursor cell should be included.
2009-06-03 23:26:56 +00:00
3f76a973ee Recent code to try and detect if a terminal supports UTF-8 by printing to it
fails spectacularly on (at least) sparc64, so disable it for now. Thanks to
naddy and Josh Elsasser for help and testing.
2009-06-02 23:39:32 +00:00
35876eaab9 Import tmux, a terminal multiplexor allowing (among other things) a single
terminal to be switched between several different windows and programs
displayed on one terminal be detached from one terminal and moved to another.

ok deraadt pirofti
2009-06-01 22:58:49 +00:00
6db7bd6791 Try to guess if the window is UTF-8 by outputting a three-byte UTF-8 wide character and seeing how much the cursor moves. Currently tries to figure out if this works by some stupid checks on the terminal, these need to be rethought. Also might be better using a width 1 character rather than width 2. 2009-05-19 16:08:35 +00:00
dd2f8d7d74 Don't force wrapping with \n when asked, let the cursor code figure it out. Should fix terminals which use this to detect line breaks. 2009-05-14 16:21:55 +00:00
143aa718e5 Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
54a5f82588 Region can reset cursor to 0,0 - bad if there is an offset. So sort out region before cursor. 2009-05-04 17:52:14 +00:00
fb543c7707 Use ACS for line drawing characters. 2009-05-04 13:20:02 +00:00
f0a716f484 Use a u_char so top-bit-set update the cursor as well. 2009-04-29 17:50:52 +00:00
7c5f1af26f Ignore del too. 2009-04-29 17:06:45 +00:00
dbf52facd2 Change scroll/pane redraws to only redraw the single pane affected rather than
the entire window.
2009-04-02 21:08:15 +00:00
84cde92c8f If redrawing the region would mean redrawing > half the pane, just schedule to
redraw the entire window. Also add a flag to skip updating the window any
further if it is scheduled to be redrawn. This has the effect of batching
multiple redraws together.
2009-04-02 20:30:23 +00:00
b6450b167b Basic horizontal splitting and layout management. Still some redraw and other
issues - particularly, don't mix with manual pane resizing and be careful when
viewing from multiple clients; generally cycling the layout a few times will
fix most problems. Getting this in for testing while I think about how to deal
with manual mode.

Split window as normal and cycle the layouts with C-b space. Some of the
layouts will work better when swap-pane comes along.
2009-04-01 18:21:42 +00:00
907bec675a FD_CLOEXEC more fds. Still one I can't find... 2009-03-31 22:20:42 +00:00
6c27f1c335 Draw vertical line on the right when window size is limited. 2009-03-31 18:39:45 +00:00
8a160f2d58 - Unbreak selection colouring.
- Get UTF-8 check the right way round...
2009-03-30 20:14:50 +00:00
23fef99009 8 -> UTF8_SIZE. 2009-03-29 11:18:28 +00:00
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
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
587badecdb Clear using ED when redrawing the screen. I foolishly assumed using spaces
would be equivalent and terminals would pick up on this, but apparently
not. This fixes copy and paste in xterm/rxvt.
2009-03-28 10:15:01 +00:00
f6001f9ffc Whoops. Didn't mean to commit this yet. 2009-03-27 16:44:51 +00:00
b97264bb70 Update TODO. 2009-03-27 16:44:00 +00:00
e6d35b6aa4 Support for 88 colour terminals. 2009-03-07 10:29:06 +00:00
546a9d5257 Don't die on any error from fd. 2009-02-17 18:53:10 +00:00
b03783efad strdup() not necessary here. 2009-02-16 19:01:16 +00:00
b2282f243b Use the right row when calling RI. 2009-02-13 19:45:16 +00:00
fdafe63004 Reset region before using CUD etc. 2009-02-13 17:09:55 +00:00
eb7d229bac Code tidying on my way to find tmux-in-tmux bug. 2009-02-13 16:53:14 +00:00
9d2697f78b Whoops. Build testing is a good idea... 2009-02-12 00:19:31 +00:00
e6ed1cc44f Never draw last character: stops stray scrolling sometimes should status line be disabled. 2009-02-12 00:18:05 +00:00
5a04f74d81 Only use RI at the top of the screen. 2009-02-12 00:03:58 +00:00
959eeef505 FreeBSD's console wraps lines at $COLUMNS - 1 rather than $COLUMNS (the cursor can never be beyond $COLUMNS - 1) and does not appear to support changing this behaviour, or any of the obvious possibilities (turning off right margin wrapping, insert mode). This is irritating, most notably because it impossible to write to the very bottom-right of the screen without scrolling. To work around this, if built on FreeBSD and run with a "cons" $TERM, the bottom-right cell on the screen is omitted. 2009-02-11 23:16:45 +00:00
d5eaf3a9f6 Emulate CSR with existing screen data on old/stupid terminals which don't support it. 2009-02-11 19:06:58 +00:00