Commit graph

403 commits

Author SHA1 Message Date
Daniel Eklöf
ebf0a11fa0
render: add render_refresh() 2019-07-24 20:11:41 +02:00
Daniel Eklöf
10a7b94804
render: bug: previous cursor wasn't always redrawn correctly
The main problem is knowing:

* The correct *cell* (to be able to render the *content* when erasing
  the old cursor)
* Whether the cursor has moved (to determine whether to stop the
  rendering loop or not)
* Where on the *screen* the cursor is/was (since the terminal may be
  partly scrolled back)

This patch stores three static variables:

* last_cursor is used to compare against current cursor to see if the
  cursor has moved or not
* last_cursor_on_screen is the actual screen coordinates the cursor
  was rendered at (typically the same as last_cursor, but may be
  offset by the view)
* last_cursor_cell is a pointer to the cell to render
2019-07-24 18:15:24 +02:00
Daniel Eklöf
bf4847d3e0
conf: allow the user to configure a fixed cursor color
The default is to reverse the foreground/background colors in the cell
with the cursor.

But, if the user configures a specific set of cursor colors, those
will always be used, regardless of other cell attributes (dim, reverse
etc).

The cursor color is specified as two color values, 'text' and
'cursor'.

The block cursor uses the 'cursor' color as background, and the 'text'
color for the glyph.

All other cursor styles uses the 'cursor' color for the cursor, but
uses the cell's foreground color for the glyph (meaning,
dim/reverse/etc applies).
2019-07-23 18:54:58 +02:00
Daniel Eklöf
a397c64efe
csi: ignore CSI ?1036h/l (metaSendsEscape) 2019-07-23 17:57:41 +02:00
Daniel Eklöf
f5a6304850
term: make sure to update 'current row' when restoring saved cursor 2019-07-23 17:57:07 +02:00
Daniel Eklöf
f7519b5725
grid: swap rows doesn't mark rows as dirty 2019-07-23 17:56:07 +02:00
Daniel Eklöf
812178673e
osc: ignore OSC 30 (konsole's "set tab title") 2019-07-23 17:55:25 +02:00
Daniel Eklöf
ba322c4eff
csi: implement \E[Z - back tab 2019-07-22 20:33:50 +02:00
Daniel Eklöf
751ac55f64
csi: *sigh* looks like e.g. neovim doesn't respect Se
I.e. it issues a \E[2 q regardless of what we've configured the
terminfo Se entry to.

So, make \E[2 q mean "the user configured cursor style" (which
defaults to 'block').
2019-07-22 20:23:29 +02:00
Daniel Eklöf
49034bb759
csi: let CSI 0 q mean "switch to user configured cursor style"
According to the specs, \E[0 q means a blinking block cursor. However,
since it also states that \E[1 q *also* is a blinking block cursor,
and that it is the default, *and* given that fact that parameter-less
CSIs typically means "reset", let's make it mean "reset to the user
configured cursor style".
2019-07-22 20:19:27 +02:00
Daniel Eklöf
3ccdef3498
conf: make cursor's default style configurable 2019-07-22 20:15:14 +02:00
Daniel Eklöf
ed5df194b8
render: implement cursor styles 'bar' and 'underline' 2019-07-22 20:07:34 +02:00
Daniel Eklöf
10be7c37ba
csi: prepare for alternative cursor styles 2019-07-22 19:44:21 +02:00
Daniel Eklöf
428b31f071
term: group 'blink' state together in a struct 2019-07-22 19:17:57 +02:00
Daniel Eklöf
196f9d67c2
term: group 'flash' state together in a struct 2019-07-22 19:15:56 +02:00
Daniel Eklöf
61409d40e2
flash: convert our own 'flash' from a CSI to an OSC 2019-07-22 19:10:15 +02:00
Daniel Eklöf
aa4cf1873b
csi: implement CSI 3J - erase scroll back 2019-07-22 19:05:22 +02:00
Daniel Eklöf
18fb70bb3f
keymap: fix sequences for PageDown 2019-07-22 18:45:14 +02:00
Daniel Eklöf
42b46df6f1
terminfo: add key sequences for keys with modifiers 2019-07-22 18:44:53 +02:00
Daniel Eklöf
34e11a711f
terminfo: add Se/Ss - describes how to change cursor style 2019-07-22 18:37:29 +02:00
Daniel Eklöf
602f22858b
terminfo: add Ms - modify selection/clipboard 2019-07-22 18:36:15 +02:00
Daniel Eklöf
802c113db3
terminfo: add smxx/rmxx - describes strikeout/crossed-out 2019-07-22 18:34:06 +02:00
Daniel Eklöf
3316a3ea4c
terminfo: set XT (screen) - we understand OSC and mouse tracking 2019-07-22 18:33:29 +02:00
Daniel Eklöf
283ffc79be
terminfo: set AX (screen) - we understand CSI 39/49m 2019-07-22 18:32:49 +02:00
Daniel Eklöf
b494f24552
conf: don't fail to start when there's no configuration file 2019-07-22 18:21:25 +02:00
Daniel Eklöf
df91698ff3
terminfo: revert kmous to \E[M
ncurses disables mouse support completely if kmous != \E[M. Now, since
kmous *has* to match XM, this means we must also disable XM.
2019-07-21 21:41:19 +02:00
Daniel Eklöf
ef06576aaf
terminfo: since we now expose our SGR cap, set kmous=\E< 2019-07-21 20:49:42 +02:00
Daniel Eklöf
838738a04a
terminfo: add XM (mouse initialization) 2019-07-21 20:46:17 +02:00
Daniel Eklöf
3a50c54e7c
csi: bug: reset mouse *reporting* on CSI 1005/1006/1015l 2019-07-21 20:27:26 +02:00
Daniel Eklöf
6f282a2903
csi: remove debug logging 2019-07-21 20:27:09 +02:00
Daniel Eklöf
c1381fbb54
main: no need to damage the _entire_ view on blink timer 2019-07-21 20:15:18 +02:00
Daniel Eklöf
e21ab8cf33
blink: implement 'blink' 2019-07-21 20:11:20 +02:00
Daniel Eklöf
07aad4a534
csi: change flash log message from warning to debug 2019-07-21 19:17:10 +02:00
Daniel Eklöf
0dd8951cb3
flash: implement 'flash'
Use our own escape sequence for the 'flash' terminfo entry.

Implemented by arming a timer FD and setting a boolean that indicates
we're currently "flashing".

The renderer draws a semi-transparent yellowish layer over the entire
window when "flashing" is active.
2019-07-21 19:14:19 +02:00
Daniel Eklöf
1ff04c5e36
csi: remove erronous final 2019-07-21 18:41:22 +02:00
Daniel Eklöf
2096753b52
dcs: we have no parent terminal to pass through to 2019-07-21 18:22:26 +02:00
Daniel Eklöf
2c1c49e499
conf: remove debug logging 2019-07-21 17:51:02 +02:00
Daniel Eklöf
64135ae365
csi: implement CSI 22t and CSI 23t
22;0|1|2t pushes the current window title/icon to the stack, while 23
pops it.

The second parameter, 0|1|2 has the following meaning:

0 - push/pop icon+title
1 - push/pop icon
2 - push/pop title
2019-07-21 17:48:06 +02:00
Daniel Eklöf
97350f6488
term: track current window title in terminal struct 2019-07-21 17:35:53 +02:00
Daniel Eklöf
326808f94d
csi: remove TODO; we have our own terminfo 2019-07-21 15:38:54 +02:00
Daniel Eklöf
86faed473d
render: make "new buffer" a debug log message, not warning 2019-07-21 15:36:32 +02:00
Daniel Eklöf
9150aa5d43
footrc: example configuration 2019-07-21 15:35:01 +02:00
Daniel Eklöf
a3b4a53102
conf: misc valgrind fixes 2019-07-21 11:46:46 +02:00
Daniel Eklöf
07b3e76062
Merge branch 'config-color' 2019-07-21 11:34:45 +02:00
Daniel Eklöf
16979927ba
csi: pick 16 first 256-colors directly from the term struct
The 16 first entries in the 256-color array are the regular and bright
colors. However, since they can be changed (eventually) at runtime, we
can't statically initialize the 256-color array.

Instead, pick the regular+bright colors directly from the terminal
struct. I.e. the first 16 entries of the 256-color array are now
unused.
2019-07-21 11:32:35 +02:00
Daniel Eklöf
7eb6ac1aec
csi: use colors from terminal struct 2019-07-21 11:31:59 +02:00
Daniel Eklöf
c7e76e2ac2
conf: fg/bg and all regular + bright colors are now configurable 2019-07-21 11:31:16 +02:00
Daniel Eklöf
4109d97263
conf: config now provides the colors (though still only hardcoded colors) 2019-07-21 11:06:28 +02:00
Daniel Eklöf
29d855d7c6
term: prepare for configurable colors; add color variables to terminal 2019-07-21 10:58:09 +02:00
Daniel Eklöf
b18478f9b6
osc: add TODO 2019-07-19 15:15:59 +02:00