Commit Graph

100 Commits

Author SHA1 Message Date
b8a102d26f Handle wcwidth() and mbtowc() failures in better style and drop
characters where we can't find the width (wcwidth() fails) on input, the
same as we drop invalid UTF-8. Suggested by schwarze@.
2016-03-02 15:36:02 +00:00
427b820426 Support for RGB colour, using the extended cell mechanism to avoid
wasting unnecessary space. The 'Tc' flag must be set in the external
TERM entry (using terminal-overrides or a custom terminfo entry), if not
tmux will map to the closest of the 256 or 16 colour palettes.

Mostly from Suraj N Kurapati, based on a diff originally by someone else.
2016-01-29 11:13:56 +00:00
995af0e2b7 I no longer use my SourceForge address so replace it. 2016-01-19 15:59:12 +00:00
68d797587e A couple of missing printflike attributes, from Andrey Starodubtsev. 2016-01-15 11:31:47 +00:00
99e9a4c786 send-keys -R should reset the input parser to ground state (so it can be
used to escape from, for example, printf '\033]2;').
2015-12-16 22:05:35 +00:00
2adf3f42ee Partly revert previous, it is harmless to keep support for UTF-8 mouse
mode inside tmux, just no longer support it for tmux itself.
2015-11-23 23:47:57 +00:00
32e510bd70 Remove support for the UTF-8 mouse extension. This was a briefly used,
poor idea that was fairly quickly replaced by SGR mouse input (which is
now widespread). It is impossible to tell the difference between UTF-8
and non-UTF-8 mouse input; since the mouse-utf8 option was removed tmux
has not handled it correctly in any case; and it is ridiculous to have
three different forms of mouse input.
2015-11-23 20:53:09 +00:00
64571368dc Sync the entire xmalloc.[ch] with the other users, but with the addition
of xrealloc, xvasprintf, xvsnprintf.
2015-11-18 13:06:54 +00:00
14d90e4901 The character is an int so use %x not %hhx. 2015-11-14 12:20:19 +00:00
205d15e82d All these return values from utf8_* are confusing, use an enum. 2015-11-14 11:45:43 +00:00
64333e3ef8 Be more strict about invalid UTF-8. 2015-11-14 10:56:31 +00:00
908e6bb68f Log more of UTF-8 input. 2015-11-14 08:25:12 +00:00
c5689a5a40 Long overdue change to the way we store cells in the grid: now, instead
of storing a full grid_cell with UTF-8 data and everything, store a new
type grid_cell_entry. This can either be the cell itself (for ASCII
cells), or an offset into an extended array (per line) for UTF-8
data.

This avoid a large (8 byte) overhead on non-UTF-8 cells (by far the
majority for most users) without the complexity of the shadow array we
had before. Grid memory without any UTF-8 is about half.

The disadvantage that cells can no longer be modified in place and need
to be copied out of the grid and back but it turned out to be lot less
complicated than I expected.
2015-11-13 08:09:28 +00:00
1b86f520ea Nuke the utf8 and status-utf8 options and make tmux only a UTF-8
terminal. We still support non-UTF-8 terminals outside tmux, but inside
it is always UTF-8 (as when the utf8 and status-utf8 options were on).
2015-11-12 11:09:11 +00:00
44657bf932 Move struct options into options.c. 2015-10-27 15:58:42 +00:00
6c10fc659a Log pane which received input data. 2015-09-02 17:52:57 +00:00
93b946ee50 Tweak some error messages/comments. 2015-09-01 19:50:09 +00:00
66a2720c56 Log the whole new input buffer once rather than each byte. 2015-09-01 19:16:00 +00:00
b5aaefc727 Move alerts onto events rather than checking every loop. 2015-08-29 08:30:54 +00:00
fc58e44f89 Only do the automatic-rename dance if the pane has changed (seen output,
or new active pane).
2015-08-28 07:49:24 +00:00
2ffbd5b5f0 When searching for tabs, start from screen width, fixes out-of-bounds
read found by Kuang-che Wu.
2015-08-25 15:00:05 +00:00
8dcea2cc14 Reset G0/G1 state when resetting everything else with send-keys -R. 2015-07-13 18:45:18 +00:00
d96ab34019 Add window_activity format, from Thomas Adam based on a diff originally
from propos6 at gmail dot com.
2015-06-15 10:58:01 +00:00
55b96a5bd5 Handle the RGB colour escape sequence (\033[38;2;<r>;<g>;<b>m and 48;2)
like xterm(1) does, by mapping to the nearest in the 256 colour palette.
2015-06-05 22:33:39 +00:00
a3edfd9e84 teminal -> terminal, from Corey Farwell. 2015-06-04 09:42:29 +00:00
a3c6172495 Missing t at end of response, from Vincent Bernat. 2015-06-01 13:59:57 +00:00
44364d7112 Remove the c0-* options which never really worked satisfactorily. Going
to try something else...
2015-05-11 10:10:16 +00:00
c4a4bd6ac5 Move input parser structs into input.c (removing fairly useless
saved_cursor_[xy] formats as a side-effect).
2015-05-08 16:18:04 +00:00
02df86079b Fix some format specifier nits, from Ben Boeckel. 2015-03-31 17:45:10 +00:00
16bdd970dc Support blinking cursor mode, both the xterm CSI ?12 h/l and (the
backwards) screen CSI 34 h/l. From Guanpeng Xu.
2015-01-20 08:18:04 +00:00
a27ba6e380 Add xreallocarray and remove nmemb argument from xrealloc. 2014-10-08 17:35:58 +00:00
1ac96200a7 Remove support for the continuous reporting "any" mouse mode which never
really worked properly and is rarely used.
2014-08-09 07:33:37 +00:00
21ade85f24 Properly track switching G0 and G1 modes between US-ASCII and VT100 line
drawing rather than just treating them as SO and SI.
2014-06-06 13:21:41 +00:00
ada75af199 Don't limit the DCS buffer to 256 bytes, expand it as needed. Requested
by Suraj Kurapati.
2014-04-17 12:43:38 +00:00
04f469a324 Change secondary device attributes response to \033[>84;0;0c which is
unique for tmux.
2014-03-31 21:32:00 +00:00
1935eb5c1e Add \033[18t window operations from J Raynor. 2014-01-31 11:17:20 +00:00
81a548bcc4 Accept multiple parameters to SM/RM/DECSET/DECRST, based on a diff from
Hayaki Saito.
2013-10-10 11:57:14 +00:00
a41cd8d75b Always push a focus event when the application turns it on, prompted by
discussion with Hayaki Saito a while ago.
2013-06-23 12:51:28 +00:00
1ec4354998 Add support for focus notifications when tmux pane changes, based on
work by Aaron Jensen.
2013-03-24 09:18:16 +00:00
ad5df9bc2f Implement DECAWM (SM/RM 7) using existing MODE_WRAP flag. 2013-03-22 10:36:53 +00:00
67b4d5b609 Support the latest theory for mouse input, this is enabled/disabled with
SM/RM 1006 and is similar in style to SGR input: \033[<b;x;yM or
\033[b;x;ym. From Egmont Koblinger.
2013-03-22 10:33:50 +00:00
10682b9e7e Instead of loads of little screen_write_*_on and off functions which
just change mode flags, just have screen_write_mode_set and
screen_write_mode_clear.
2013-03-21 18:47:56 +00:00
fdbfc7e349 Rather than having two grids for each pane, one for ASCII and one for
UTF-8, collapse the two together. Simplifies the code at the expense of
more memory (which can probably be reduced again later).
2013-01-18 02:16:21 +00:00
3a09e01a8e Do not allow cursor colours to be set beginning with ? as that will
report the colour, from Hayaki Saito.
2013-01-17 20:30:43 +00:00
44f8e1caff Implement ECH (erase character, CSI X). Reported by Christian Neukirchen. 2013-01-15 23:18:55 +00:00
24d7d073ff Support the 47 and 1047 SM and RM sequences (alternate screen without
cursor), requested by I forget who ages ago.
2012-11-27 20:08:42 +00:00
17bbf90393 Add notification for input from a pane, from George Nachman. 2012-09-25 07:41:22 +00:00
df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +00:00
ff5155f719 Add a buffer with all input from last ground state, will be used for
control mode. From George Nachman.
2012-04-25 21:12:49 +00:00
f59971276a Add a simple form of output rate limiting by counting the number of
certain C0 sequences (linefeeds, backspaces, carriage returns) and if it
exceeds a threshold (current default 50/millisecond), start to redraw
the pane every 100 milliseconds instead of making each change as it
comes. Two configuration options - c0-change-trigger and
c0-change-interval.

This makes tmux much more responsive under very fast output (for example
yes(1) or accidentally cat'ing a large file) but may not be perfect on
all terminals and connections - feedback very welcome, particularly
where this change has a negative rather than positive effect (making it
off by default is a possibility).

After much experimentation based originally on a request Robin Lee
Powell (which ended with a completely different solution), this idea
from discussion with Ailin Nemui.
2012-03-20 11:01:00 +00:00