Commit graph

42 commits

Author SHA1 Message Date
Daniel Eklöf
7a372a8c23
Revert "terminfo: add ich1=\E[@"
This reverts commit 76fab8cf69.

See https://codeberg.org/dnkl/foot/issues/668#issuecomment-246149
2021-08-07 12:25:42 +02:00
Daniel Eklöf
159ae6cb95
terminfo: change kmous to \E[<, add XM+xm capabilities
ncurses has had a bug where mouse support is completely disabled if the terminfo
didn’t have kmous=\E[M, *or*, the terminfo *name* contained ‘xterm’.

This appears to have been fixed.

Thus, change kmous to \E[<, and set xm/XM accordingly. With this, ncurses
application will use the SGR mouse reporting mode, instead of the legacy
reporting mode.
2021-08-06 22:34:47 +02:00
Daniel Eklöf
76fab8cf69
terminfo: add ich1=\E[@ 2021-08-06 22:33:56 +02:00
Craig Barnes
3e74482d6c terminfo: add Tc, setrgbf and setrgbb capabilities
These extensions are used by tmux and neovim, in order to make use
of 24-bit colors without facing the problems that plague the `RGB`
capability.

This should allow 24-bit colors to work "out of the box" in tmux,
without the usual workaround of adding:

    set-option -ga terminal-overrides ",foot*:Tc"

...to ~/.tmux.conf.

See also:

* 18fe2e8dfa (commitcomment-31373962)
* f83c25942d/runtime/doc/term.txt (L123-L139)
* b1a8c0fe02/CHANGES (L988-L989)

Closes #615
2021-06-29 08:55:53 +01:00
Daniel Eklöf
fa93a97a08
terminfo: add status line capabilities: hs, dsl, fsl and tsl
* hs  - boolean, signals status line availability
* tsl - to_status_line: begin an OSC 2 sequence (set window title)
* fsl - from_status_line: OSC terminator
* dsl - disable status line: \E]2;\E\\ - clears the window title

Closes #242
2020-12-18 13:46:57 +01:00
Daniel Eklöf
9f321e6030
csi: fix sub-parameter versions of 38/48 SGR escapes
Well this is embarrassing; the sub-parameter versions of the 38/48 SGR
escapes all required an extra ‘:2’ that wasn’t supposed to be there,
causing all the other sub-parameters to be shifted one step to the
right.

That is, foot expected e.g. 38:2:2:r:g:b, or 38:2:5:idx when the
correct sequences are 38:2:cs:r:g:b and 38:5:idx.

I.e. I mixed up the color-space ID (cs) of 38:2 with *type* of color:
RGB or indexed.

In addition to fixing this, this patch also adds support for a
“bastard” version of the sub-parameter based RGB escapes, where the
color-space identifier has been left out: e.g. 38:2:r:g:b. This
sequence is invalid, but applications tend to “forget” the color-space
ID...
2020-12-12 20:55:31 +01:00
Daniel Eklöf
207b24538d
term: enable reverse wrap-around by default
Since we’re now doing reverse auto-wrapping by default, we add
‘bw’ (‘auto_left_margin’)to terminfo.
2020-10-06 18:42:26 +02:00
Daniel Eklöf
7f65bd1c20
csi: '\E[0 q' resets the cursor style to the default, not '\E[2 q'
Also update 'Se' capability in the terminfo, to reflect this.
2020-06-30 17:44:43 +02:00
Daniel Eklöf
ad8f293d96
terminfo: add remaining keypad keys 2020-06-27 20:05:50 +02:00
Daniel Eklöf
9f31cfa764
terminfo: add ka1, ka3, kc1 and kc3 (upper/lower left/right keypad keys) 2020-06-27 19:39:27 +02:00
Daniel Eklöf
851e99f9a5
terminfo: kb2 (center keypad key) should be \EOu, not \EOE 2020-06-27 19:38:53 +02:00
Daniel Eklöf
1a53589913
terminfo: put 'cvvis' on a separate line 2020-05-25 19:35:37 +02:00
Daniel Eklöf
6deae0b07a
terminfo: add tmux extension 'Sync' - indicates 'Synchronized Updates' support 2020-05-16 14:13:45 +02:00
Daniel Eklöf
5ee55a7077
terminfo: foot: setaf/b: use colon-separated variant 2020-04-08 17:26:23 +02:00
Daniel Eklöf
4ba42ee7ab
terminfo: foot-direct: setaf/b: set color space to '2' (RGB) 2020-04-08 17:25:52 +02:00
Daniel Eklöf
11f35434cb
terminfo: use ST, not BEL as OSC terminator 2020-01-23 17:40:30 +01:00
Daniel Eklöf
b40b1ba62c
terminfo: sort 2020-01-20 18:45:14 +01:00
Daniel Eklöf
4d2d3b2d95
terminfo: add 'oc' (orig colors)
We already had the functionality, we just didn't expose it in the
terminfo.
2020-01-20 18:45:14 +01:00
Daniel Eklöf
a3d919a90d
input: implement metaSendsEscape and eightBitMeta 2020-01-20 18:45:14 +01:00
Daniel Eklöf
4e87426712
csi: implement REP - CSI Ps b 2020-01-20 18:45:14 +01:00
Daniel Eklöf
5d702e6fbf
osc: implement OSC 12 and OSC 112 (set/reset text cursor color) 2020-01-20 18:36:19 +01:00
Daniel Eklöf
222b7c91e4
terminfo: set RGB flag in foot-direct 2019-12-26 17:57:45 +01:00
Daniel Eklöf
443e568ddd
terminfo: add tab stop related entries, hts and tbc
hts - Horizontal Tab Set (?)
tbc - Tab Clear
2019-11-18 13:03:35 +01:00
Daniel Eklöf
52ece3592c
osc: implement "change color" commands
This implements OSC 4, 10, 11 - change <color>/foreground/background,
and their corresponding 'query' variant (which was already implemented
for OSC 10/11).

It also implements OSC 104, 110, 111 - reset
<color>/foreground/background.

Set corresponding terminfo entries to signal this support to clients.
2019-08-21 17:57:02 +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
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
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
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
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
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
36f30e8b1b
terminfo: change kmous to \E[M. This fixes mouse not working in e.g. htop 2019-07-18 14:39:27 +02:00
Daniel Eklöf
0c565d1558
terminfo: intitial terminfo specification 2019-07-18 14:00:33 +02:00