Commit graph

63 commits

Author SHA1 Message Date
Daniel Eklöf
87aac8708d
foot.info: add setal (colored underlines)
This is an alias to Setulc. Upstream (ncurses) terminfo uses setal
instead of Setulc :/
2024-07-18 09:04:39 +02:00
Daniel Eklöf
8e4ca90680
foot.info: add 'Setulc' (set underline color) capability 2024-06-26 18:39:24 +02:00
Daniel Eklöf
1297b13cd2
foot.info: add 'Su' (Styled Underlines) boolean capability 2024-06-26 18:39:24 +02:00
Daniel Eklöf
05f9774416
foot.info: add smulx (styled underlines) 2024-06-26 18:39:23 +02:00
Daniel Eklöf
3d0d9036fd
terminfo: tighten up the rv/xr regular expressions 2024-03-29 11:40:47 +01:00
Daniel Eklöf
8e79ceba9e
terminfo: add 'nel' capability 2024-03-29 11:40:35 +01:00
Daniel Eklöf
a34ae5d527
terminfo: add fe/fd (focus enable/disable)
These are new capabilities, recently added to ncurses. Applications
are supposed to use these, instead of XM (to enable focus events). So,
remove "CSI ? 1004h" from XM.
2024-03-29 11:40:15 +01:00
Daniel Eklöf
aac24bfa1b
foot.info: add non-standard capability ‘Rect’ (used by tmux)
This tells tmux it can use DECFRA to erase rectangular regions.
2024-03-07 16:25:02 +01:00
Daniel Eklöf
9f4eb13e9e
terminfo: smm: enable 8-bit Meta mode
To enable 8-bit meta mode, we need to:

* disable "send ESC when meta modifies a key" (private mode 1036)
* enable "8-bit meta mode" (private mode 1034)

rmm reverses the above.

Closes #1584
2024-02-06 12:38:19 +01:00
Gregory Anders
8b2b65bbbc terminfo: add terminator to conditional in Sync
I'm not sure if this is _strictly_ necessary, but according to the
terminfo specification [1] a conditional string should be terminated
with `%;`.

[1]: https://man7.org/linux/man-pages/man5/terminfo.5.html
2023-11-13 19:10:15 -06:00
Daniel Eklöf
b91bde8a65
terminfo: add TS capability
This is a new ‘extended’ capability. ‘TS’ has been around for a while,
but was originally not part of foot’s terminfo. Not sure when it was
added to ncurses’ foot terminfo.

In any case, ncurses has this to say about TS:

  These building-blocks allow access to the X titlebar and icon name as a
  status line.  There are a few problems in using them in entries:

   a) tsl should have a parameter to denote the column on which to transfer to
      the status line.

   ...

  But that issue regarding the parameter for tsl means that applications may
  not rely on it.  The SVr4 documentation says tsl will "move to status line,
  column #1".  At the point in time when ESR added DJM's "pseudo-color" entry
  with the split-up escape sequence for tsl/fsl, there were 65 entries using
  tsl:
     32 used a parameter, matching the documentation (including x10term).
     21 used a parameterless control, exiting from the status line on ^M.
      6 used parameterless controls for tsl and fsl
      6 used a split-up escape sequence, e.g., the same approach.

  The extension "TS" is preferable, because it does not accept a parameter.
  However, if you are using a non-extended terminfo, "TS" is not visible.
2023-06-15 14:31:23 +02:00
Daniel Eklöf
93b6883896
terminfo: XM: add private mode 1004
This was added to ncurses (to the xterm+sm+1006 fragment) in
2023-05-08.
2023-06-15 14:31:15 +02:00
Daniel Eklöf
ae81f5af4c
terminfo: remove DECRST of DECCOLM+DECSCLM
We’ve never supported neither 132-column mode, nor smooth
scrolling. But we _did_ recognize the escape sequences.

We don’t, anymore. Thus it makes very little sense to include these
escapes in any of our terminfo capabilities. So, remove them.
2023-04-02 18:00:38 +02:00
Daniel Eklöf
d1220aebfd
terminfo: sync with ncurses 2023-01-14
* RV/rv: report DA2
* XR/xr: report version (XTVERSION)
* XF: boolean, focus in/out events available
2023-01-15 14:09:08 +01:00
Daniel Eklöf
88641005fe
terminfo: PD/PE -> PE/PS
Ncurses 2022-12-24 had the names wrong. It was corrected on
2022-12-29.
2023-01-01 15:21:05 +01:00
Daniel Eklöf
e7c1a93d29
terminfo: add entries for bracketed paste
Ncurses added these in 2022-12-24, but they have been used/supported
by vim since 2017.

* BE - Bracketed paste Enable
* BD - Bracketed paste Disable
* PE - Paste Enable (i.e. "begin")
* PD - Paste Disable (i.e. "end")
2023-01-01 15:07:02 +01:00
Daniel Eklöf
bb02b319d0
terminfo: add kxIN + kxOUT (focus in/out events)
These capabilities are not included in the standard ‘xterm’ or
‘xterm-256color’ terminfos. They’re used in

‘xterm+focus’ ->
‘xterm+sm+1002’ ->
‘xterm-1002|xterm+sm+1003’ ->
‘xterm-1003’

(https://invisible-island.net/ncurses/terminfo.ti.html#tic-xterm_focus)

However, as far as I can tell, ncurses doesn’t use these capabilities
at all.
2022-09-26 18:54:03 +02:00
Craig Barnes
b6ea9d2dbc terminfo: use DECSET 2026 instead of DCS sequences for Sync capability
Even though it makes little difference to foot which is used in the
terminfo entry, DECSET 2026 has some advantages[1] over the DCS
sequences and we should probably promote the better of the 2 where
possible.

Note: the terminfo string was taken from Nicholas Marriott's
suggestion[2] in the terminal-wg discussion.

[1]: https://codeberg.org/dnkl/foot/issues/459
[2]: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/2#note_973680
2022-02-16 14:08:22 +00:00
Daniel Eklöf
9434066546
meson: terminfo install location now defaults to $datadir/terminfo
The meson command line option -Dcustom-terminfo-install-location has
been changed in the following ways:

* If unset, $datadir/terminfo is used, and TERMINFO is *not* exported
* If set, that value (relative to $prefix) is used, and TERMINFO *is*
exported.
* The special value ‘no’ is removed.

-Ddefault-terminfo now also changes the terminfo names generated when
-Dterminfo=enabled.

Furthermore, the documentation for the TERMINFO environment variable
has been removed from the foot.1 and footclient.1 man pages (but as
mentioned above, foot *will* still set it if
-Dcustom-terminfo-install-location has been used).

INSTALL.md has been updated to now recommend using ncurses’ terminfo
definitions, if available. But also to document the other
alternatives; installing the terminfo definitions in a custom
location, or installing them with a diferent name. It also describes
the general problem, and the disadvantages of each alternative (but
without going into too much depth).
2021-08-30 19:09:13 +02:00
Daniel Eklöf
2ff8f59525
terminfo: remove keypad key caps (for keypad application mode)
The keypad application mode gated by private mode 1035. I.e. by
default, there _is_ no keypad application mode in foot.
2021-08-14 21:05:17 +02:00
Daniel Eklöf
572b7d0f96
terminfo: remove km/smm/rmm
By default, foot prefixes Alt-<key> combos with ESC, instead of
setting the 8:th “meta” bit. In this mode, smm/rmm has no effect.

This mode _can_ be disabled, by resetting private mode 1036. However,
the terminfo should reflect the terminal’s *default* behavior.
2021-08-14 21:05:06 +02:00
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