Commit graph

6555 commits

Author SHA1 Message Date
Daniel Eklöf
d41b28bd02
url-mode+config: wip: add url.regex option 2025-02-05 13:35:17 +01:00
Daniel Eklöf
e76d8dd7af
config: remove url.{uri-characters,protocols} 2025-02-05 13:35:17 +01:00
Daniel Eklöf
05207fcde3
url-mode: wip: regex: tweak debug log message 2025-02-05 13:35:17 +01:00
Daniel Eklöf
6d344f82ee
url-mode: wip: regex: mention changes from original regex 2025-02-05 13:35:16 +01:00
Daniel Eklöf
031382f428
url-mode: wip: regex: don't allow {}, do allow matched [] 2025-02-05 13:35:16 +01:00
Daniel Eklöf
859b4c8921
url-mode: wip: more work on regex matching
Remove the old auto-detection and instead use the regex matches.
2025-02-05 13:35:16 +01:00
Daniel Eklöf
1c15ee940d
url-mode: wip: convert to regex matching for auto-detection 2025-02-05 13:35:16 +01:00
Daniel Eklöf
32919b1049
grid: typo 2025-02-05 13:35:16 +01:00
Daniel Eklöf
aae794e9bd
xmalloc: add xreallocarray() 2025-02-05 13:35:16 +01:00
Thomas Bonnefille
9443ac7e29
box-drawings: handle architecture with soft-float
Currently, architecture using soft-floats doesn't support instructions
FE_INVALID, FE_DIVBYZERO, FE_OVERFLOW and FE_UNDERFLOW and so building
on those architectures results with a build error.
As the sqrt math function should set errno to EDOM if an error occurs,
fetestexcept shouldn't be mandatory.

This commit removes the float environment error handling.

Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
2025-02-05 13:31:46 +01:00
sewn
8de378963b
server: don't instantiate a client without a monitor 2025-02-05 14:23:17 +03:00
Daniel Eklöf
2fe72effa9
term: ptmx pause/resume: don't modify the FDM if ptmx has been closed
This fixes error message spam when resizing a terminal window executed
with --hold, and where the client application has terminated.
2025-02-05 11:39:06 +01:00
Daniel Eklöf
6f9129fa3a
Revert "forgejo: server/standalone: what happens when we set required=true?"
This reverts commit 70aa033d79.
2025-02-04 14:56:22 +01:00
Daniel Eklöf
70aa033d79
forgejo: server/standalone: what happens when we set required=true? 2025-02-04 14:55:49 +01:00
Daniel Eklöf
fcfdbeebcf
forgejo: remind user to sanitize pasted config 2025-02-04 14:55:09 +01:00
Daniel Eklöf
230d8b6f70
forgejo: server/standalone: tweak wording 2025-02-04 14:54:02 +01:00
Daniel Eklöf
9c882cfdab
forgejo: issue happens in foot --server, standalone, or both? 2025-02-04 14:52:52 +01:00
Daniel Eklöf
dc4e9fc25b
forgejo: ask user to provide distro *version*, when applicable 2025-02-04 14:48:02 +01:00
Daniel Eklöf
51128a3484
input: match unshifted key-bindings before shifted
That is, try to match e.g. Control+shift+a, before trying to match
Control+A.

In most cases, order doesn't matter. There are however a couple of
symbols where the layout consumes the shift-modifier, and the
generated symbol is the same in both the shifted and unshifted
form. One such example is backspace.

Before this patch, key-bindings with shift-backspace would be ignored,
if there were another key-binding with backspace.

So, for example, if we had one key-binding with Control+Backspace, and
another with Control+Shift+Backspace, the latter would never trigger,
as we would always match the first one.

By checking for unshifted matches first, we ensure
Control+Shift+Backspace does match.
2025-01-31 09:07:42 +01:00
Daniel Eklöf
bee17a95b8
input: ignore key-bindings without modifiers when matching untranslated/raw
When matching the unshifted symbol, or the raw key code, ignore all
key bindings that don't have any modifiers.

This fixes an issue where it was impossible to enter (some of the)
numbers on the keypad, **if** there was a key-binding for
e.g. KP_Page_Up, or KP_Page_Down.
2025-01-31 07:35:54 +01:00
Daniel Eklöf
d24f700256
key-bindings: add keypad variants to existing default key-bindings 2025-01-31 07:29:16 +01:00
Attila Fidan
5286808b6c
input: close fd on no/unrecognized keymap format 2025-01-30 10:58:19 +00:00
Daniel Eklöf
6e2bdd663a
forgejo: config: render as .ini, instead of the default markdown 2025-01-27 13:18:09 +01:00
Daniel Eklöf
c2c8d29272
forgejo: remove "e.g." from placeholder text 2025-01-27 13:16:43 +01:00
Daniel Eklöf
8b408f0039
forgejo: add optional field for terminal multiplexers 2025-01-27 13:15:59 +01:00
Daniel Eklöf
1c7c9f6c16
doc: foot.ini: describe key binding match logic 2025-01-27 12:31:50 +01:00
Daniel Eklöf
8d6f0d0583
key-bindings: try all bindings in translated mode before matching untranslated, and then finally raw
When trying to match key bindings, we do three types of matching:

* Match the _translated_ symbol (e.g. Control+C)
* Match the _untranslated_ symbol (e.g. Control+Shift+c)
* Match raw keyboard codes

This was done for *each* key binding. This meant we sometimes matched
a keybinding in raw mode, even though there was a
translated/untranslated binding that would match it too. All depending
on the internal order of the key binding list.

This patch changes it, so that we first try all bindings in translated
mode, then all bindings in untranslated mode, and finally all bindings
in raw mode.

Closes #1929
2025-01-27 12:31:40 +01:00
Daniel Eklöf
7a5353d18a
forgejo: application -> application(s) 2025-01-27 06:38:14 +01:00
Daniel Eklöf
fda9638edd
forgejo: add optional field for shell/TUI 2025-01-27 06:37:40 +01:00
Daniel Eklöf
43206e6601
config: fix memory leak on e.g. "not a valid XKB key name" errors 2025-01-27 06:34:20 +01:00
Daniel Eklöf
846271e8d3
render: resize: configure with only one dimension being zero
The protocol states:

    If the width or height arguments are zero, it means the client
    should decide its own window dimension. This may happen when the
    compositor needs to configure the state of the surface but doesn't
    have any information about any previous or expected dimension.

The wording is a bit ambiguous; does it mean we should set *both*
width and height to values we choose, even if only one dimension is
zero in the configure event? Or does it mean that we should choose the
value for the dimension that is zero in the configure event?

Regardless, it's pretty clear that it does *not* mean we should *only*
choose width and height if *both* dimensions are zero in the configure
event. This is foot's behavior before this patch, meaning if only one
of them is zero, foot assumed the compositor wanted us to set the
width (or height) to zero...

Change this, so that we now choose value for the "missing" dimension,
but do use the compositor provided value for the other dimension.

Closes #1925

Relevant issues:

* https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/155
* https://github.com/YaLTeR/niri/issues/1050
2025-01-26 09:28:54 +01:00
Daniel Eklöf
97385b007f
grid: reflow: regression: remove (truncate) SPACER cells at the end of line
When printing a double-width glyph at the end of the line, it will get
pushed to the next line if there's only one cell left on the current
line.

That last cell on the current line is filled with a SPACER value.

When reflowing the text, the SPACER cell should be "removed", so that
the double-width glyph continues directly after the text on the
previous line.

9567694bab fixed an issue where
reflowing e.g. neofetch output incorrectly removed spaces between the
logo, and the system info. But also introduced a regression where
SPACER values no longer are removed.

This patch tries to fix it, by adding back empty cells, but NOT SPACER
cells.
2025-01-25 08:46:21 +01:00
Daniel Eklöf
f39b75f296
changelog: cwd > 1024 chars 2025-01-24 06:52:52 +01:00
Daniel Eklöf
787e886ff0
client: port bfabc5450b to footclient 2025-01-24 06:51:13 +01:00
camel-cdr
bfabc5450b
fix infinite loop/oom when cwd longer then 1024
The code reads cwd into a buffer, which is expanded while errno is ERANGE, with the intent of growing the buffer until the path fits.
While getcwd will set errno on error, it will not reset it once the path fits into the buffer.
So to not get an infinite loop once errno is ERANGE, we need to make sure to reset errno, such that the loop behaves as expected.
2025-01-24 06:46:58 +01:00
Daniel Eklöf
736328ab6b
config: check for FcNameUnparse() failure 2025-01-24 06:38:02 +01:00
Daniel Eklöf
ba7ecc4669
input: kitty: refactor, try to simplify and be less confusing
Use better named variables while juggling the shifted vs. unshifted
key codes.

Switch to variable names appropriate for the kitty keyboard protocol
once we have all the unshifted, shifted and base key codes done. It's
not until then we can decide which key code to use as the main key,
and whether or not to report the alternate key code.
2025-01-22 12:37:36 +01:00
Daniel Eklöf
f301f6eccc
input: kitty: add more test cases 2025-01-22 12:24:06 +01:00
Daniel Eklöf
6ca1a2c2dc
input: kitty: only set 'alternate' if the "unshifted" code is printable
Fixes a regression where alt+backspace was reported as ^[[8:127;3u
instead of ^[[127;3u.
2025-01-22 10:26:44 +01:00
Daniel Eklöf
f62a5ed1ff
input: codespell: indiciates -> indicates 2025-01-22 08:04:17 +01:00
Daniel Eklöf
5e65f3f07e
shm: codespell: re-using -> reusing 2025-01-22 08:04:17 +01:00
Daniel Eklöf
09f718878f
input: kitty: add initial unit test
Test a couple of key combos from the se and de(neo) layouts.

This unit test isn't intended to test _all_ key combinations, for all
kitty flag combinations, but to be more of a regression test -
whenever we discover a buggy, weird combo, add it here.
2025-01-22 08:04:17 +01:00
Daniel Eklöf
786037791c
input: kitty: improve handling of alternate+base keys even more
* Always do a base key lookup. Before this, we didn't do that if we
  matched the XKB sym to a lookup table entry (i.e. keypads, cursor keys
  etc.)
* Try to retrieve the unshifted symbol also when we matched the symbol
  to a lookup table entry. When successful, we now report an alternate
  key for keypad and cursor keys; before this patch, we only did that
  for keys that didn't have an entry in the lookup table (i.e. ASCII
  chars etc).

This improves compatibility with kitty (and the kitty keyboard
protocol) in more corner cases. One particular example is the neo
keyboard layout, where part of the regular keys act as keypad keys
when num-lock is active.
2025-01-20 10:34:45 +01:00
Daniel Eklöf
2ff38e86a7
input: kitty: fix alternate codepoint sometimes not being reported
When alternate key reporting is enabled (i.e. when we're supposed to
report the shifted key along with the unshifted key), we try to figure
out whether the key really is shifted or not (and thus which xkb
keysym to use for the unshifted and shifted keys in the escape).

This was done by getting the layout's *all* modifier combinations that
produce the shifted keysym, and if any of of them contained a modifier
that isn't supported by the kitty protocol, the shifted and unshifted
keys are derived from the same keysym. This is to ensure we handle
things like AltGr-combos correctly.

The issue is, since there may be more than one modifier combination
generating the shifted keysym, we may end up using the wrong keysym
just because _another_ combination set contains modifiers not
supported by the kitty protocol. What we're interrested in is whether
the *pressed* set of modifiers contains such modifiers.

Closes #1918
2025-01-20 09:08:47 +01:00
Daniel Eklöf
22e1b1610f
vt: combining chars: ensure 'key' is within range
When there's a key collision, we increment the key and check
again. When doing this, we need to ensure the key is withing range,
and wrap around to 0 if the key value is too large.
2025-01-18 10:22:24 +01:00
Daniel Eklöf
10c4e94e1b
Merge branch 'releases/1.20' 2025-01-18 09:43:57 +01:00
Daniel Eklöf
bb60618941
changelog: move utf8proc entry to correct release 2025-01-18 09:31:05 +01:00
Daniel Eklöf
e1d9b57f83
changelog: add back entry to 1.20.1, removed in de3becef96 2025-01-18 09:31:05 +01:00
Daniel Eklöf
771af699f0
meson: bump version to 1.20.2 2025-01-18 09:25:36 +01:00
Daniel Eklöf
15d9b08307
changelog: prepare for 1.20.2 2025-01-18 09:25:19 +01:00