Commit graph

79 commits

Author SHA1 Message Date
Daniel Eklöf
ed867a78bb
vt: dummy implementation of of "ESC (B" (character charset) 2019-06-29 20:49:00 +02:00
Daniel Eklöf
63fb7a9374
log: don't syslog 2019-06-29 20:48:02 +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
54403738bb
render: use alpha from cell colors 2019-06-26 20:09:02 +02:00
Daniel Eklöf
3349c28fce
render: avoid division 2019-06-26 20:08:49 +02:00
Daniel Eklöf
dbd883935b
vt: execute: implement HT - horizontal tab 2019-06-26 19:58:37 +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
97420f13d8
scroll: let the render erase the scrolled up region
The grid scroll operation no longer inserts a DAMAGE_ERASE operation,
but instead manually clears the region. The render does the
corresponding thing.
2019-06-26 19:33:39 +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
Daniel Eklöf
0f76f4190a
grid: scroll reverse: hopefully done correct now 2019-06-24 20:49:37 +02:00
Daniel Eklöf
0e078f44b6
grid: scroll: fix start/end for erase region 2019-06-24 20:45:14 +02:00
Daniel Eklöf
e7043c8a6d
csi: fix scrolling region end 2019-06-24 20:44:29 +02:00
Daniel Eklöf
5b53fda5e6
csi: add function param_get()
Returns the value of parameter #idx, if available, or the specified
default value.

If the specified parameter does exist, but is 0, the default value is
returned.
2019-06-24 20:17:02 +02:00
Daniel Eklöf
da0a65d499
csi: implement cursor horizontal absolute 2019-06-24 20:08:44 +02:00
Daniel Eklöf
637820bef5
csi: implement VPR (vertical line position relative) 2019-06-24 20:05:31 +02:00
Daniel Eklöf
d4b6bc77d5
csi: VPA: saturate row 2019-06-24 20:05:24 +02:00
Daniel Eklöf
86519f93ba
csi: implement "send device attributes" 2019-06-24 20:01:41 +02:00
Daniel Eklöf
722c2e7ed2
csi: recognize a bunch of ?h/l commands, log unimplemented 2019-06-24 20:01:12 +02:00
Daniel Eklöf
0cf1253ac0
csi: implement VPA (vertical line position absolute) 2019-06-24 19:59:54 +02:00
Daniel Eklöf
44206b49d4
csi: saturate row/col when setting cursor position 2019-06-24 19:40:00 +02:00
Daniel Eklöf
2b3f3711fc
TIOCSWINSZ: fix alignment and spelling 2019-06-24 19:39:31 +02:00
Daniel Eklöf
7fb0c4b342
csi: fix cursor request response; add 1, not 2 2019-06-24 19:03:19 +02:00
Daniel Eklöf
2fe7145aff
scrolling region: wip 2019-06-23 21:12:32 +02:00
Daniel Eklöf
7cc9be01f4
csi: recognize, but do nothing, for civis, cvvis 2019-06-23 18:17:58 +02:00
Daniel Eklöf
ec9b343550
csi: implement cursor query and respones 2019-06-23 18:17:36 +02:00
Daniel Eklöf
b0a2c54fe8
vt: wip: implement scrolling region
This is largely untested, but existing scrolling code has been
converted to using a terminal-global scrolling region that is defined
as start-end of the scrollable region.

This is compared to the old code where the scrolling region where
defined in terms of marginals, counted in lines from top and from
bottom.
2019-06-23 18:02:49 +02:00
Daniel Eklöf
7183b2f0fe
csi/vt: fix logging of intermediate characters 2019-06-23 17:17:47 +02:00
Daniel Eklöf
fbf0db621c
vt: implement reverse scrolling (terminfo 'ri')
This currently duplicates the code paths for DAMAGE_SCROLL; there are
many similarities between the two, but also major differences...
2019-06-23 17:16:52 +02:00
Daniel Eklöf
c0a9f9e6b2
resize: bug: we're not in alt screen mode at startup
When we start up, the cells pointer, *and* the alt screen pointer are
both NULL. Hence we incorrectly decided we were initially in alt
screen mode.
2019-06-23 17:14:46 +02:00
Daniel Eklöf
de7dcf1a5c
csi: save and restore cursor when switching to and from alt screen 2019-06-23 15:03:22 +02:00
Daniel Eklöf
199e4aa044
vt: initial implementation of alt screen + 256 colors 2019-06-23 15:00:27 +02:00
Daniel Eklöf
35e5fa1f76
vt: implement DECCKM (cursor key sends either SS3 or CSI escapes) 2019-06-23 14:12:20 +02:00
Daniel Eklöf
9e47c89880
csi: implement 'CSI H' (set cursor position) 2019-06-23 14:11:35 +02:00
Daniel Eklöf
1ad9d118c2
vt: dummy implementation of ESC dispatch 2019-06-23 13:36:20 +02:00
Daniel Eklöf
1414639b76
csi: include intermediates in debug logging 2019-06-23 13:36:13 +02:00
Daniel Eklöf
949847a35a
vt: add all (?) missing states, actions and transitions 2019-06-23 13:28:55 +02:00
Daniel Eklöf
15b29ecb49
vt: add missing entry action for ESCAPE 2019-06-22 22:27:20 +02:00
Daniel Eklöf
308bcb0233
vt: add missing transition from state ESCAPE -> CSI DISPATCH 2019-06-22 22:26:57 +02:00
Daniel Eklöf
6aba78a145
csi: wip: recognize the private CSIs for bracketed paste, smcup/rmxup, smkx/rmkx 2019-06-22 22:25:50 +02:00
Daniel Eklöf
7998ce9ee4
csi: remove commented out debug logging 2019-06-22 22:25:19 +02:00
Daniel Eklöf
5698d69890
render: implement 'reverse' attribute 2019-06-22 21:42:44 +02:00
Daniel Eklöf
7ec746e826
render: implement 'conceal' attribute 2019-06-22 21:39:11 +02:00
Daniel Eklöf
9c9ad48745
csi: sgr: treat CSI[m as CSI[0m (SGR reset) 2019-06-22 21:38:47 +02:00
Daniel Eklöf
4b6ea810fc
main: implement bold+italic fonts 2019-06-22 21:32:51 +02:00
Daniel Eklöf
e600e75810
csi: implement CSI Pn P (DCH - delete character) 2019-06-22 21:31:28 +02:00
Daniel Eklöf
4c7dbee221
input: reduce utf8 buffer size 2019-06-22 20:40:28 +02:00
Daniel Eklöf
faf60108f1
input: add a key mapping table, mapping key syms to escape sequences
At the same time, also add support for the shift modifier.
2019-06-22 20:31:53 +02:00
Daniel Eklöf
8ecd69c500
input: stop key repeater when input focus is lost 2019-06-21 18:40:53 +02:00
Daniel Eklöf
dba3bb820d
csi: fix \e[B - it should move the cursor *down*, not up. 2019-06-21 15:34:10 +02:00
Daniel Eklöf
a537934e4b
csi: fix line clearing; the erase range 'end' is exclusive 2019-06-21 15:33:03 +02:00