Commit graph

84 commits

Author SHA1 Message Date
Daniel Eklöf
454133033c
vt/csi: use vt_param_get() 2019-07-10 16:04:16 +02:00
Daniel Eklöf
96bd55f7c4
terminal: only support a single intermediate/private character 2019-07-10 15:03:16 +02:00
Daniel Eklöf
43e57e3546
csi: fix logging; 'CSI' was printed twice 2019-07-10 14:57:59 +02:00
Daniel Eklöf
9b5c044b29
terminal: rename and redefine cursor keys mode and keypad keys mode 2019-07-09 11:07:06 +02:00
Daniel Eklöf
1e2a7e77f0
rgba: drop alpha channel support 2019-07-08 15:56:15 +02:00
Daniel Eklöf
4e25019ba6
wip: grid is now represented as a grid, not a linear array
The grid is now represented with an array of row *pointers*. Each row
contains an array of cells (the row's columns).

The main point of having row pointers is we can now move rows around
almost for free.

This is useful when scrolling with scroll margins for example, where
we previously had to copy the lines in the margins. Now it's just a
matter of swapping two pointers.
2019-07-08 13:57:31 +02:00
Daniel Eklöf
48528419c4
grid: grid_memset() -> grid_memclear() 2019-07-07 17:10:15 +02:00
Daniel Eklöf
abff0e205e
csi: scroll region is not allowed past available rows 2019-07-07 17:03:22 +02:00
Daniel Eklöf
d63629b370
performance improvements
* action() returns void - this gets rid of checks in vt_from_slave()
* split up ACTION_PRINT into ACTION_PRINT (ASCII) and ACTION_UTF8_PRINT
  ACTION_PRINT is on the hot path, and we want it streamlined.
* Remove run-time checkout for unimplemented state transitions, as we
  shouldn't have any of those left.
* Don't re-load current VT state on each iteration in vt_from_slave()
2019-07-07 16:32:18 +02:00
Daniel Eklöf
b26e03fced
csi: implement reverse video 2019-07-05 20:12:40 +02:00
Daniel Eklöf
c76e620d71
csi: implement URXVT style mouse event reporting 2019-07-05 19:40:52 +02:00
Daniel Eklöf
b9bd637021
csi: SGR mouse tracking *is* implemented 2019-07-05 15:58:02 +02:00
Daniel Eklöf
1610828b8c
vt: add support for mouse motion reports 2019-07-05 15:13:06 +02:00
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
3ba1721c0f
osc: implement change window title and icon 2019-07-05 09:50:35 +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
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
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
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
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
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
5e8c75aa38
csi: implement 'civis' (show/hide cursor) 2019-07-03 14:14:46 +02:00
Daniel Eklöf
0fef48c1fd
csi: up to application to restore scroll region on alt switch? 2019-07-03 08:37:16 +02:00
Daniel Eklöf
8ed7239458
csi: re-set cursor when switching between alt and normal screen
This forces a refresh of the "current line" pointer.
2019-07-02 22:23:54 +02:00
Daniel Eklöf
cc2931007c
csi: repair DCH (delete character)
The logic was simply broken. This fixes it, and also converts it to
use the new "current line" pointer.
2019-07-02 22:19:43 +02:00
Daniel Eklöf
7e4dd2de9a
csi: clear all existing alt damage when switch alt <--> normal 2019-07-01 19:25:04 +02:00
Daniel Eklöf
ee476a7e5a
csi: erase alt screen when enabling it 2019-07-01 19:23:31 +02:00
Daniel Eklöf
b45b492f41
csi: DECSTBM: move cursor to top left corner of scrolling region 2019-07-01 19:13:45 +02:00
Daniel Eklöf
d70956da08
wip: use a sliding window instead of memmove() to scroll
Instead of memmoving a large amount of data on every scroll, use a
sliding window. That is, each time we scroll, we offset origin.
2019-07-01 12:23:38 +02:00
Daniel Eklöf
9e3b8ab3ff
vt: only prep logging of CSI/ESC parameters when debug logging is enabled 2019-07-01 12:21:25 +02:00
Daniel Eklöf
0f48b4f8f7
terminal: prepare for floating grids 2019-06-29 21:30:54 +02:00
Daniel Eklöf
a8f4cb55af
terminal: move cursor from grid to terminal 2019-06-29 21:15:32 +02:00
Daniel Eklöf
8723098cda
terminal: move fore/background colors from grid to terminal 2019-06-29 21:09:58 +02:00
Daniel Eklöf
3d2ab03f62
terminal: move col/row count, cell width/height and scroll region to terminal 2019-06-29 21:08:08 +02:00
Daniel Eklöf
1ecd4a6ae1
Rename grid_* functions to term_* 2019-06-29 21:03:28 +02:00
Daniel Eklöf
1dbddd7155
colors: store as doubles, rather than uint32_t
Since cairo uses doubles, we don't want to have to convert a uin32_t
to double values every time we render a cell.
2019-06-26 20:33:32 +02:00
Daniel Eklöf
3a97fce6d0
grid: attributes now track whether we've set a foreground/background color
This means we don't have to explicitly set the foreground/background
to the grid's default colors whenever we reset/clear a cell, and we
can instead simply memset() the entire cell to 0.

This also means the renderer has to get the default color when
rendering a cell without a foreground/background color set.
2019-06-26 19:44:31 +02:00
Daniel Eklöf
a35738d96f
scroll-region: don't clear damage queue when changing scroll region
Vim, for example, changes the scroll region every time you scroll a
single line. Thus, resetting the damage queue is slow.

This reworks the damage handling of scroll updates:

* Split damage queue into two: one for scroll operations and one for
  update/erase operations.
* Don't separate update/erase operations inside/outside the scroll
  region
* Store the current scroll region in the scroll damage operation. This
  allows us to stack multiple scroll operations with different scroll
  regions.
* When updating update/erase operations after a scroll operation,
  split the update/erase operations if necessary (the current scroll
  operation may have a scroll region different from before, thus
  forcing us to split existing update/erase operations.
* The renderer no longer erases after a scroll. The scroll operation
  also adds an erase operation. This also means that erase operation
  are subject to adjustments by later scroll operations.
2019-06-25 20:11:08 +02:00