Commit graph

6191 commits

Author SHA1 Message Date
Daniel Eklöf
b88f0d672f
meson: bump version to 1.17.2 2024-04-17 11:26:45 +02:00
Daniel Eklöf
f2fbef1f82
changelog: prepare for 1.17.2 2024-04-17 11:26:25 +02:00
Daniel Eklöf
883fc6be27
Merge branch 'master' into releases/1.17 2024-04-17 11:25:50 +02:00
Daniel Eklöf
7c20fb247c
term: stash last known DPI, and use after a unmapped/mapped sequence
A compositor may unmap, and then remap the window, for example when
the window is minimized, or if the user switches workspace.

With DPI aware rendering, we *need* to know on which output we're
mapped, in order to use the correct DPI. This means the first frame we
render, before being mapped, always guesses the DPI.

In an unmap/map sequence, guessing the wrong DPI means the window will
flicker.

Fix by stashing the last used DPI value, and use that instead of
guessing.

This means the *only* time we _actually_ guess the DPI, is the very
first frame, when starting up foot.
2024-04-17 09:14:52 +02:00
Daniel Eklöf
a5b369ede4
ci: set explicit 'event' filters an all 'when'-statements
This should fix the CI warnings we've started to see lately:

    [bad_habit] Please set an event filter on all when branches
2024-04-17 09:13:13 +02:00
Daniel Eklöf
3507c72492
ci: explicitly install openssl
Let's see if this fixes the missing SSL module in Python...
2024-04-17 08:52:31 +02:00
Daniel Eklöf
3d2588edf8
sixel: don't allow pan/pad changes after sixel data has been emitted
Changing pan/pad changes the sixel's aspect ratio. While I don't know
for certain what a real VT340 would do, I suspect it would change the
aspect ratio of all subsequent sixels, but not those already emitted.

The way we implement sixels in foot, makes this behavior hard to
implement. We currently don't resize the image properly if the aspect
ratio is changed, but not the RA area. We have code that assumes all
sixel lines have the same aspect ratio, etc.

Since no "normal" applications change the aspect ratio in the middle
of a sixel, simply disallow it, and print a warning.

This also fixes a crash, when writing sixels after having modified the
aspect ratio.
2024-04-15 16:07:47 +02:00
Daniel Eklöf
0ab05f4807
sixel: also set 'alloc_height', when short-cutting a resize operation
In some cases, a sixel may be resized vertically, while still having a
zero-width. In this case, the resize operations are short-cutted, and
no actual allocations are done.

However, we forgot to set 'alloc_height' when doing so. As a result,
the trimming code (when the sixel is "done"), trimmed away the entire
sixel.
2024-04-15 16:05:56 +02:00
Daniel Eklöf
71ce17d977
term: don't print outside grid when printing multi-column characters
When auto-wrap is disabled, a multi-column character may be printed on
a line that doesn't fit the entire character. That is, the "spacers"
we print, as place holders in the columns after the first one, may
reach outside the grid.

We did (try to) check for this, but the check was off by one. Meaning,
we could, in some cases, print outside the grid.
2024-04-15 16:03:30 +02:00
Daniel Eklöf
23ada09d14
osc: reject notifications with invalid UTF-8 strings 2024-04-15 16:02:54 +02:00
Daniel Eklöf
e753bb953b
wayland: remove has_wl_compositor_v6
We deviate slightly from the specification, in that we don't assume a
preferred buffer scale of 1. Instead, we "guess" the scale *until we
receive a surface_preferred_buffer_scale event.

Because of this, we don't need the has_wl_compositor_v6 member, as
it's enough to check if we have a non-zero 'preferred buffer scale'.
2024-04-12 15:35:25 +02:00
Daniel Eklöf
4fd26c251c
changelog: add a new 'unreleased' section 2024-04-11 15:32:15 +02:00
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