Commit graph

6179 commits

Author SHA1 Message Date
Daniel Eklöf
40a0dfedea
Merge branch 'releases/1.17' 2024-04-11 15:31:50 +02:00
Daniel Eklöf
04ebd02874
meson: bump version to 1.17.1 2024-04-11 15:28:17 +02:00
Daniel Eklöf
accefc3ae1
changelog: prepare for 1.17.1 2024-04-11 15:28:08 +02:00
Daniel Eklöf
385fc0078f
Merge branch 'master' into releases/1.17 2024-04-11 15:26:50 +02:00
Daniel Eklöf
b400903e25
config: add new key-binding 'quit', unbound by default
Closes #1475
2024-04-11 15:12:45 +02:00
izmyname
fa07c1ec67 Typo fix 2024-04-11 00:22:07 +00:00
izmyname
94f749a40d
Add noirblaze theme 2024-04-10 16:27:08 +02:00
Daniel Eklöf
a4046e0c3d
code of conduct: initial code-of-conduct
Based on [River's](https://codeberg.org/river/river) code of conduct,
which is adapted from the
[Contributor Covenant](https://www.contributor-covenant.org/),
version 2.1, available at
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
2024-04-10 16:26:03 +02:00
Daniel Eklöf
e5a2ac4b57
config: add cursor.unfocused-style
This option controls how we render the cursor when the terminal window
is unfocused.

Possible values are:

* hollow: the default, and how we rendered the cursor before this
  patch.
* unchanged: render the cursor exactly the same way as when the window
  is focused.
* none: do not render any cursor at all

Closes #1582
2024-04-10 16:24:10 +02:00
Daniel Eklöf
9287946b36
dcs: DECRQSS: fix off-by-one when checking for space in the DCS buffer 2024-04-10 05:44:33 +02:00
Marcin Puc
09e45794bc themes: add dracula-iterm 2024-04-07 09:47:19 +02:00
Holger Weiß
ed5717c4cd
themes: add xterm theme
Include a theme for using xterm’s default palette (based on the
XTerm-col.ad file included with the xterm source code, version 390).
2024-04-06 15:24:02 +02:00
Daniel Eklöf
7f4328e0b1
term: send SIGHUP before SIGTERM when shutting down
If we're the ones initiating shutdown, start by sending SIGHUP. Only
if the client application does not terminate, send SIGTERM (and if it
still refuses to terminate, send SIGKILL).

Also reduce the timeout between the signals from 60s to 30s.
2024-04-05 19:34:17 +02:00
Daniel Eklöf
c7848c4e75
term: don't shutdown terminal when PTY is closed, unless --pty was used
Unless --pty has been used, we do *not* want to shutdown the terminal
when the PTY is closed by the client application; we want to wait for
the client application to actually terminate.

This was the behavior before the --pty patch.

This was changed in the --pty patch, since then, we don't *have* a
client application. That is, foot has not forked+exec:ed anything. The
only way to trigger a shutdown (from the client side) is to close the
PTY.

This patch restores the old behavior, when --pty is *not* used.

Closes #1666
2024-04-05 18:45:31 +02:00
Daniel Eklöf
88a3b54ca3
wayland: only use the surface preferred scale if set by the compositor
Before this patch, we would, in some cases, fallback to the surface
preferred (not fractional) scaling, even though the compositor hadn't
actually published a preferred buffer scale; the presence of a v6
compositor interface doesn't mean we've actually received a preferred
scale yet.
2024-04-05 16:19:47 +02:00
Daniel Eklöf
4f1aaccf81
log: fix syslog not respecting the configured log level 2024-04-05 16:19:24 +02:00
tunjan
3cc94ab4e8 fix typo in README 2024-04-05 11:11:21 +00:00
Daniel Eklöf
51e8b4f533
changelog: add new 'unreleased' section 2024-04-02 16:34:08 +02:00
Daniel Eklöf
61c8d6ec8c
Merge branch 'releases/1.17' 2024-04-02 16:33:42 +02:00
Daniel Eklöf
21951feb2b
meson: bump version to 1.17.0 2024-04-02 16:27:54 +02:00
Daniel Eklöf
d5dc0b2f49
changelog: prepare for 1.17.0 2024-04-02 16:27:25 +02:00
Daniel Eklöf
82c1a28e6f
changelog: move DECRQM for private mode 67 from "added" to "changed" 2024-04-01 08:49:27 +02:00
Matheus Afonso Martins Moreira
2138273c16 themes: add neon theme
Add a neon theme file for foot, originally from xcolors.net/neon
and also available at terminal.love.
2024-03-31 20:36:55 -03: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
a99434929c
sixel: abuse wmemset() when initializing a freshly allocated image buffer
wmemset() is heavily optimized, and in some cases, *much* faster than
manually initializing the new image pixels.

Furthermore, assume calloc() is better at initializing memory to zero,
and use that when initializing new pixels in a transparent image.
2024-03-25 16:33:15 +01:00
Daniel Eklöf
dcd4ab4ab8
scripts: generate-alt-random: generate both opaque and transparent sixels 2024-03-25 16:33:00 +01:00
Daniel Eklöf
9fcf5977c0
sixel: fix cursor positioning when image is split up into several 2024-03-18 17:12:11 +01:00
Daniel Eklöf
bce1d7313d
sixel: hopefully handle image height correctly when trimming
When trimming trailing empty rows from the final image, handle the RA
region correctly:

* If image is transparent, trim down to the last non-empty pixel row,
  regardless of whether it is inside or outside the RA region.

* If image is opaque, trim down to either the last non-empty pixel
  row, or the RA region, whatever is the largest height.
2024-03-18 17:11:27 +01:00
Daniel Eklöf
cb820a498b
sixel: RA region does not affect the text cursor position
The raster attributes is, really, just a way to erase an area. And, if
the sixel is transparent, it's a nop.

The final text cursor position depends, not on our image size (which
is based on RA), but on the final graphical cursor position.

However, we do want to continue using it as a hint of the final image
size, to be able to pre-allocate the backing buffer.

So, here's what we do:

* When trimming trailing transparent rows, only trim the *image*, if
  the graphical cursor is positioned on the last sixel row, *and* the
  sixel is transparent.
* Opaque sixels aren't trimmed at all, since RA in this acts as an
  erase that fills the RA region with the background color.
* The graphical cursor position is always adjusted (i.e. trimmed),
  since it affects the text cursor position.
* The text cursor position is now calculated from the graphical cursor
  position, instead of the image height.
2024-03-18 17:11:26 +01:00
Daniel Eklöf
cc660bc7c1
sixel: trim trailing, fully transparent sixel rows
See https://github.com/hpjansson/chafa/issues/192
2024-03-18 17:09:20 +01:00
Daniel Eklöf
282c55aa4a
sixel: place cursor on the last character row touched by the sixel
After emitting a sixel, place the cursor on the character row touched
by the last sixel. The last sixel _may_ not be a multiple of 6
pixels, *if* the sixel had an explicit width/height set via raster
attributes.

This is an intended deviation from the DEC cursor placement algorithm,
where the cursor is placed on the character row touched by the last
sixel's *upper* pixel.

The adjusted algorithm implemented here makes it much easier for
applications to handle text-after-sixels, since they can now simply
assume a single text newline is required to move the cursor to a
character row not touched by the sixel.
2024-03-18 16:58:54 +01:00
Craig Barnes
5f41eb798b base64: simplify lookup table initializer 2024-03-17 15:27:22 +00:00
Craig Barnes
e8b04e0e2c
xmalloc: add xmemdup() and use to replace some uses of xmalloc+memcpy 2024-03-17 12:31:02 +01:00
Craig Barnes
853be450bb main/config: replace some uses of xasprintf() with xstrjoin() 2024-03-16 20:17:53 +00:00
Daniel Eklöf
578765ad83
wayland: skip loading cursor theme when using server side cursors
We don't need the client side cursor theme when using server side
cursors.
2024-03-16 15:36:44 +01:00
Craig Barnes
27330a5dd6
csi: indicate "permanently reset" for DECRQM queries of mode 67 (DECBKM)
This allows dynamic querying for the equivalent of terminfo's "kbs"
capability.
2024-03-16 15:36:00 +01:00
Daniel Eklöf
f17b989650
sixel: disable debug logging 2024-03-16 08:57:15 +01:00
Daniel Eklöf
60fd4a262c
sixel: initialize the color table to colors used by the VT340 2024-03-15 15:19:43 +01:00
Daniel Eklöf
dd3bb13d97
completions: fish: fix path completion for --pty 2024-03-14 07:37:57 +01:00
Alyssa Ross
86894a1cd2
Add support for opening an existing PTY
Virtual machine monitor programs (e.g. QEMU, Cloud Hypervisor) expose
guest consoles as PTYs.  With this patch, foot can access these guest
consoles.

Usually, the program used for accessing these PTYs is screen, but
screen is barely developed, doesn't support resizing, and has a bunch
of other unrelated stuff going on.  It would be nice to have a
terminal emulator that properly supported opening an existing PTY.
The VMM controls the master end of the PTY, so to the other end (in
this case foot), it just behaves like any application running in a
directly-opened PTY, and all that's needed is to change foot's code to
support opening an existing PTY rather than creating one.

Co-authored-by: tanto <tanto@ccc.ac>
2024-03-14 07:31:03 +01:00
Daniel Eklöf
712bc95db3
csi: the CSI-t family of queries now report unscaled pixel values
Before this patch, we reported scaled pixel values. This was rather
useless, since applications have no way of getting the scaling factor,
to "scale up" e.g. images.

Furthermore, the most common use of these queries are probably to
calculate the dimensions to use when emitting sixels.

Closes #1643
2024-03-14 07:26:37 +01:00
Daniel Eklöf
f72555f29a
Merge branch 'rectangular-edit'
Closes #1633
2024-03-14 07:25:49 +01:00
Daniel Eklöf
e2b3eb91dd
csi: params_to_rectangular_area(): ensure left/right is within bounds 2024-03-10 17:37:11 +01:00
Daniel Eklöf
4ea4e5da4e
changelog: rectangular functions: add bug ref 2024-03-07 16:29:39 +01:00
Daniel Eklöf
cbf55ccacf
changeloge: move DECERA to the 'unreleased' section 2024-03-07 16:28:59 +01:00
Daniel Eklöf
6ff307b3b5
doc: ctlseq: DECCARA, DECRARA, DECCRA, DECFRA and DECERA 2024-03-07 16:26:11 +01:00
Daniel Eklöf
8d7ab86182
term_fill(): no need to set attrs.clean = 0
The VT state’s attribute is always 0
2024-03-07 16:25:04 +01:00
Daniel Eklöf
6a01642a6f
csi: DECCARA+DECRARA: dirty cells 2024-03-07 16:25:04 +01:00