Commit graph

166 commits

Author SHA1 Message Date
Daniel Eklöf
e5fc266cdb
vt: add support for \E[?1000h - report mouse button events 2019-07-05 14:24:51 +02:00
Daniel Eklöf
a102ff09f9
input: mouse events 2019-07-05 10:44:57 +02:00
Daniel Eklöf
1a341a56cc
render: load cursor theme from XCURSOR_THEME and XCURSOR_SIZE 2019-07-05 10:44:09 +02:00
Daniel Eklöf
1947d33868
render: break out rendering functions to render.{c,h} 2019-07-05 10:16:56 +02:00
Daniel Eklöf
3ba1721c0f
osc: implement change window title and icon 2019-07-05 09:50:35 +02:00
Daniel Eklöf
998ce52b7e
render: bump number of glyphs we can render in a single call 2019-07-05 09:31:03 +02:00
Daniel Eklöf
19cef74153
main: it's not the terminal emulators job to set LINES and COLUMNS 2019-07-05 09:21:12 +02:00
Daniel Eklöf
488ad5dc77
csi: manually erase alt screen when switching to it 2019-07-05 09:09:58 +02:00
Daniel Eklöf
c5fdc13ea4
term_erase(): erased cells get the currently selected background color 2019-07-05 09:09:28 +02:00
Daniel Eklöf
28d05a5528
main: initialize colors in VT state 2019-07-05 09:08:58 +02:00
Daniel Eklöf
8091f7c781
render: force a full redraw when we cannot reuse last buffer 2019-07-05 08:55:02 +02:00
Daniel Eklöf
4a35aa9724
resize: cursor reset was off-by-one when cursor was outside new size 2019-07-04 19:56:50 +02:00
Daniel Eklöf
1c737fa7bd
resize: re-align grid offset 2019-07-04 19:56:27 +02:00
Daniel Eklöf
669ef1a07a
csi: implement CSI S and CSI T (scroll up/down) 2019-07-04 19:39:23 +02:00
Daniel Eklöf
befb437411
vt: improve logging of invalid and unimplemented sequences 2019-07-04 19:35:01 +02:00
Daniel Eklöf
cb10d10fd8
vt: implement save/restore cursor+attributes 2019-07-04 19:23:25 +02:00
Daniel Eklöf
aad4db29c2
vt: handle graphical charset mode when printing a character 2019-07-04 19:17:42 +02:00
Daniel Eklöf
ea6e06d689
vt: track charsets G0-G3 and support either ASCII or graphical mode 2019-07-04 19:17:18 +02:00
Daniel Eklöf
dd5a3b1009
main: handle EINTR in poll() 2019-07-04 19:16:32 +02:00
Daniel Eklöf
50d455bd15
csi: ignore 'blinking cursor' private mode 2019-07-04 10:04:52 +02:00
Daniel Eklöf
0457c33418
csi: fix parsing of 256-color and 24-bit color SGRs
There may be more SGR sequences after the 256-color/24-bit
sequence. Thus, check that we have *enough* parameters to parse the
256-color/24-bit SGR. It doesn't have to be *exactly* the required
number of parameters though.

Fixes issues with sequences like: \e[38;2;1;48;2;1m
2019-07-04 09:57:02 +02:00
Daniel Eklöf
ef944933e6
flash mitigation: add a small delay before rendering after receiving client data
Simply re-trying to read client data is not enough in many
cases. Re-work the flash mitigation to instead incur a small delay
before rendering.
2019-07-04 09:54:40 +02:00
Daniel Eklöf
03ca7a04ab
main: more zenburn:ish default foreground and background colors 2019-07-04 09:27:06 +02:00
Daniel Eklöf
a191d98d09
vt: bug fix: clear utf-8 state after printing a utf-8 character 2019-07-04 09:26:34 +02:00
Daniel Eklöf
9f12bca21e
Merge branch 'fast-scroll' 2019-07-03 22:30:00 +02:00
Daniel Eklöf
35d5035f61
csi: fix bug: cursor horizontal absolute (<ESC> Pn G) was off-by-one 2019-07-03 22:21:44 +02:00
Daniel Eklöf
2f3f4ac56f
csi: cleanup 2019-07-03 22:21:23 +02:00
Daniel Eklöf
3d58d24963
csi: ?r and ?s are like ?h and ?l; they save/restore things
Assuming ncmpcpp is correct, ?1001s and ?1001r saves and restores the
'highlight mouse tracking' mode.
2019-07-03 21:33:23 +02:00
Daniel Eklöf
3c67628c57
vt: implement (untested!) smam and rmam (auto margins)
Default is auto-margins enabled (scroll when cursor reaches right
margin).
2019-07-03 21:18:06 +02:00
Daniel Eklöf
90dadfcc22
vt: implement (untested!) insert mode
\E4l is not horizontal index, but disable INSERT mode
2019-07-03 21:16:41 +02:00
Daniel Eklöf
1373d18dbc
logging: disable debug logging by default 2019-07-03 20:21:03 +02:00
Daniel Eklöf
df5be1061d
vt: recognize ESC(0 - switch character set 2019-07-03 16:21:26 +02:00
Daniel Eklöf
bf78150157
vt: always log unimplemented as warnings, not errors 2019-07-03 16:21:09 +02:00
Daniel Eklöf
cfd39c0967
vt: fix logging of ESC intermediates and parameters 2019-07-03 16:20:28 +02:00
Daniel Eklöf
b5dccf2883
csi: add unknown private escapes 's' and 'r', seen with ncmpcpp 2019-07-03 16:04:16 +02:00
Daniel Eklöf
43045a98e2
csi: recognize ?1005 and ?1015 private CSIs 2019-07-03 16:00:06 +02:00
Daniel Eklöf
f4c3343382
csi: fix cursor positioning 2019-07-03 15:59:28 +02:00
Daniel Eklöf
66033b9b1a
csi: implement 'erase characters' (CSI X) 2019-07-03 15:58:49 +02:00
Daniel Eklöf
f87d4f856a
main: mitigate screen flashes on slow client
If a client writes to the PTY "too slow", we often end up flashing the
screen. This could for example be caused by a client first erasing a
line, then we render that frame, followed by the client updating the
just-erased line. When we render _that_ frame, it will be perceived as
a flash.

Mitigate this by trying to read client data again, after finishing
processing one batch, but before rendering.

To avoid hanging on client output (and never rendering anything),
limit this to at most 3 iterations. This may have to be tweaked.
2019-07-03 15:16:38 +02:00
Daniel Eklöf
a0602aedb5
csi: recognize 'smam', but log unimplemented 2019-07-03 14:47:34 +02:00
Daniel Eklöf
92f0d64279
csi: add untested implementation of "horizontal index" 2019-07-03 14:47:01 +02:00
Daniel Eklöf
2fad8138e1
csi: scroll region changes are now logged as debug again, rather than info 2019-07-03 14:24:46 +02:00
Daniel Eklöf
da305abdd8
scrolling: initial implementation of scrolling region when reverse scrolling 2019-07-03 14:16:01 +02:00
Daniel Eklöf
1f343527f0
scrolling: make sure we don't clear too much memory 2019-07-03 14:15:46 +02:00
Daniel Eklöf
70743fddf4
scrolling: hopefully fix bad damage update of items outside scrolling region 2019-07-03 14:15:23 +02:00
Daniel Eklöf
5e8c75aa38
csi: implement 'civis' (show/hide cursor) 2019-07-03 14:14:46 +02:00
Daniel Eklöf
a7a28ff581
scrolling: initial reverse scrolling support - no scroll regions 2019-07-03 10:45:49 +02:00
Daniel Eklöf
048f619b19
render: fix last-cursor comparison 2019-07-03 09:46:39 +02:00
Daniel Eklöf
2bca2a894e
main: add --font/-f command line option 2019-07-03 09:46:13 +02:00
Daniel Eklöf
e6c27645fa
term: optimize damage list after scroll
This optimizes the normal scrolling case; updates are done at the
bottom of the screen and then scrolled up.

In this case, the damage list will be a more or less sorted list of
updates, oldest first.

If we're scrolling a lot, the oldest updates will eventually scroll
off screen. In this case, there's no need to keep them in the damage
list.

So, when scrolling, loop the damage list and adjust/remove updates
that have scrolled off screen (either partially, or completely).

Stop looping as soon as we see an update that has *not* scrolled off
screen.

Note that this means there may be update items in the damage list
that *has* scrolled off screen. This is especially true for random
screen writes (i.e. typical to some synthetic benchmarks).
2019-07-03 09:23:42 +02:00