Commit graph

6211 commits

Author SHA1 Message Date
Daniel Eklöf
18b702b249
unicode-mode: move state from seat to term
This fixes an issue where entering unicode-mode in one foot client,
also enabled unicode-mode on other foot clients. Both
visually (although glitchy), and in effect.

The reason the state was originally in the seat objects, was to fully
support multi-seat. That is, one seat/keyboard entering unicode-mode
should not affect other seats/keyboards.

The issue with this is that seat objects are Wayland global. Thus, in
server mode, all seat objects are shared between the foot clients.

There is a similarity with IME, which also keeps state in the
seat. There's one big difference, however, and that is IME has Wayland
native enter/leave events, that the compositor emits when windows are
focused/unfocused. These events allow us to reset IME state. For our
own Unicode mode, there is nothing similar.

This patch moves the Unicode state from seats, to the terminal
struct. This does mean that if one seat/keyboard enters Unicode mode,
then *all* seats/keyboards will affect the unicode state. This
potential downside is outweighed by the fact that different foot
clients no longer affect each other.

Closes #1717
2024-05-21 08:36:56 +02:00
Daniel Eklöf
cf65ad49e8
issue-template: feature: use yaml instead 2024-05-21 08:31:08 +02:00
Daniel Eklöf
7982433c71
issue-template: try to add another template, for feature requests. 2024-05-21 08:27:24 +02:00
Daniel Eklöf
ad7e0f7f32
issue-template: it's validation*s* 2024-05-21 08:18:28 +02:00
Daniel Eklöf
dffe2e0b7c
issue-template: try to fix link to INSTALL.md, attempt 3 2024-05-21 08:14:58 +02:00
Daniel Eklöf
5b0eb7b42d
issue-template: try to fix link to INSTALL.md, attempt 2 2024-05-21 08:14:15 +02:00
Daniel Eklöf
14b84dd7c5
issue-template: try to fix link to INSTALL.md 2024-05-21 08:13:11 +02:00
Daniel Eklöf
26e22b74b1
forgejo: issue report templates 2024-05-21 08:11:39 +02:00
Daniel Eklöf
7b983be3d8
foot.ini: add commented out 'blink-rate' 2024-05-20 11:00:02 +02:00
Daniel Eklöf
c4f1380943
config: add cursor.blink-rate option
The default is 500ms, which corresponds to the old, hardcoded default.

Closes #1707
2024-05-20 09:17:42 +02:00
Mariusz Bialonczyk
bc193c7be5 themes: add onehalf-dark 2024-05-17 10:56:20 +02:00
Artturin
3a7ea1f44b scripts: generate-builtin-terminfo: fix syntax error 2024-05-01 21:18:41 +03:00
Daniel Eklöf
3c4669061b
scripts: generate-builtin-terminfo: use \xNN for control characters
Instead of emitting raw control characters (for e.g. bel, cub1 and
kbs), use \xNN C string escapes.
2024-04-30 10:50:31 +02:00
Daniel Eklöf
a3debf7741
dcs: xtgettcap: always reply with tigetstr(3) formatted "strings"
That is, instead of sometimes replying with a "source" encoded
string (where e.g. '\E' are returned just like that, and not as an
actual ESC), always unescape all string values.

This also includes \n \r \t \b \f \s, \^ \\ \ \:, as well as ^x-styled
escapes.

Closes #1701
2024-04-27 09:38:55 +02:00
Daniel Eklöf
4d4ef5eed5
dcs: XTGETTCAP: handle empty request
If the XTGETTCAP request is empty (no capabilities in it), reply with
an empty error reply.

Closes #1694
2024-04-20 08:27:25 +02:00
Daniel Eklöf
128c5c3efa
term: default to DPI 96, if the monitor's DPI is 0
This can happen in virtualized environments, or when running a nested
Wayland session.
2024-04-20 08:26:44 +02:00
Daniel Eklöf
acbb3cbb70
char32: mbsntoc32() returns a size_t, not a char32_t 2024-04-20 08:26:15 +02:00
Daniel Eklöf
edb28479cc
doc: foot: simplify example where we run a non-default command
To reduce the risk of people mistakenly believing you have to/should
use "sh -c".
2024-04-20 08:17:02 +02:00
Daniel Eklöf
a1ac37e771
changelog: add new 'unreleased' section 2024-04-17 11:28:22 +02:00
Daniel Eklöf
ec0e6d1744
Merge branch 'releases/1.17' 2024-04-17 11:28:06 +02:00
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