<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/input.c, branch sixel-heap-buffer-overflow</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=sixel-heap-buffer-overflow</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=sixel-heap-buffer-overflow'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2026-04-06T09:10:38Z</updated>
<entry>
<title>input: no extra key processing in alternate input modes</title>
<updated>2026-04-06T09:10:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-04-06T08:45:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=89d6ff10fa816f11c1fa20368e4cc3464549955e'/>
<id>urn:sha1:89d6ff10fa816f11c1fa20368e4cc3464549955e</id>
<content type='text'>
In 3a2eb80d83d59d194a3d07da227431c634892ff5, we fixed an issue where
key *releases* triggered a selection reset, and viewport reset.

The same issue still exists in other input modes (unicode, search and
url mode); if the kitty keyboard protocol has been enabled, with
release events, any key press directed to e.g. search input handling,
will was not remembered, and the corresponding release event generated
a kitty keyboard event to the terminal application, and reset the
viewport and selection.

This means, for example, that scrollback search was unusable.

Fix by *never* doing any further (generic) key processing if an
alternate input mode is active.

Closes #2316
</content>
</entry>
<entry>
<title>input: ignore release events after a keyboard shortcut was triggered</title>
<updated>2026-01-28T08:31:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-01-10T06:36:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3a2eb80d83d59d194a3d07da227431c634892ff5'/>
<id>urn:sha1:3a2eb80d83d59d194a3d07da227431c634892ff5</id>
<content type='text'>
This fixes an issue with the kitty keyboard protocol, where 'release'
events associated with a shortcut was sent to the client application.

Example: user triggers "scroll up". We scroll up. No key event(s) are
sent to the client application. Then the user releases the keys. we
don't do any shortcut handling on release events, and so we continue
with the normal input processing. If the kitty keyboard protocol has
been enabled (and specifically, release event reporting has been
enabled), then we'll emit a 'release' escape sequence. This in itself
is wrong, since the client application never saw the corresponding
press event. But we _also_ reset the viewport. The effect (in this
example), is that it's impossible to scroll up in the scrollback
history.

Note that we don't ignore _any_ release event, only the release event
for the (final) symbol that triggered the shortcut.

This should allow e.g. modifier keys release events to be processed
normally, if released before the shortcut key.

This is somewhat important, since the client application will have
received press events for the modifier keys leading up to the
shortcut (if modifier press/release events have been enabled in the
kitty keyboard protocol - _Report all keys as escape codes_).

Closes #2257
</content>
</entry>
<entry>
<title>input: execute: add missing 'return true' to a couple of switch cases</title>
<updated>2026-01-10T06:35:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-01-10T06:35:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e2a989785ab32a39aaa8d49a45b8a94b12a12fa3'/>
<id>urn:sha1:e2a989785ab32a39aaa8d49a45b8a94b12a12fa3</id>
<content type='text'>
Without this, the input handling code won't understand the key/mouse
event was consumed (i.e. triggered a shortcut), and will continue
processing normally (e.g. sending event to the client application).
</content>
</entry>
<entry>
<title>config: add [colors-dark] and [colors-light], replacing [colors] and [colors2]</title>
<updated>2025-12-20T14:51:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-12-19T08:29:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cf2b390f6e096e7a2ca93d4dece153eb13261a2e'/>
<id>urn:sha1:cf2b390f6e096e7a2ca93d4dece153eb13261a2e</id>
<content type='text'>
The main reason for having two color sections is to be able to switch
between dark and light. Thus, it's better if the section names reflect
this, rather than the more generic 'colors' and 'colors2' (which was
the dark one and which was the light one, now again?)

When the second color section was added, we kept the original name,
colors, to make sure we didn't break existing configurations, and
third-party themes.

However, in the long run, it's probably better to be specific in the
section naming, to avoid confusion.

So, add 'colors-dark', and 'colors-light'. Keep 'colors' and 'colors2'
as aliases for now, but mark them as deprecated. They WILL be removed
in a future release.

Also rename the option values for initial-color-theme, from 1/2, to
dark/light. Keep the old ones for now, marked as deprecated.

Update all bundled themes to use the new names. In the light-only
themes (i.e. themes that define a single, light, theme), use
colors-light, and set initial-color-theme=light.

Possible improvements: disable color switching if only one color
section has been explicitly configured (todo: figure out how to handle
the default color theme values...)
</content>
</entry>
<entry>
<title>input: keymap(): use a goto-label on error, to ensure we always close the keymap FD</title>
<updated>2025-10-18T06:23:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-18T06:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=558760446932f0f22c794084285cf998462dd706'/>
<id>urn:sha1:558760446932f0f22c794084285cf998462dd706</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: unit test: check pipe2() return value</title>
<updated>2025-08-30T06:18:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-08-30T06:18:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f0e36e35cb65bdb92dbe24d00a9cc6bc8d72a458'/>
<id>urn:sha1:f0e36e35cb65bdb92dbe24d00a9cc6bc8d72a458</id>
<content type='text'>
Fixes compilation failures with clang, in release mode.
</content>
</entry>
<entry>
<title>term+input: refactor: move theme switching into term_theme_* functions</title>
<updated>2025-06-10T05:11:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-06-09T05:37:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=33eefa7b45c2d20750f5788dfdcc1008cf33ca47'/>
<id>urn:sha1:33eefa7b45c2d20750f5788dfdcc1008cf33ca47</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libxkbcommon: don't require 1.8.0</title>
<updated>2025-05-18T09:36:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-18T09:35:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3e1e3ea38ce8ed43ee61ddb584298f45dd72f1d5'/>
<id>urn:sha1:3e1e3ea38ce8ed43ee61ddb584298f45dd72f1d5</id>
<content type='text'>
The version bump was done since we now use XKB_VMOD_NAME_*; macros
added in libxkbcommon 1.8.0.

Not all distros have updated libxkbcommon yet (read: Debian). Since
it's fairly easy to work around, let's do that.

Closes #2103
</content>
</entry>
<entry>
<title>csi: implement private mode 2031 (dark/light mode detection)</title>
<updated>2025-04-26T12:23:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-20T10:48:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=10e7f291498a6600cfecc3cde604ea51de5f0f5a'/>
<id>urn:sha1:10e7f291498a6600cfecc3cde604ea51de5f0f5a</id>
<content type='text'>
* Recognize 'CSI ? 996 n', and respond with
  - 'CSI ? 997 ; 1 n' if the primary theme is active
  - 'CSI ? 997 ; 2 n' if the alternative theme is actice
* Implement private mode 2031, where changing the color
  theme (currently only possible via key bindings) causes the terminal
  to send the same CSI sequences as above.

In this context, foot's primary theme is considered dark, and the
alternative theme light (since the default theme is dark).

Closes #2025
</content>
</entry>
<entry>
<title>key-bindings: add bindings to switch between color themes</title>
<updated>2025-04-26T12:20:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-20T05:58:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6bc91b5e288ef16613a4e6f9d0a9f6077cedc267'/>
<id>urn:sha1:6bc91b5e288ef16613a4e6f9d0a9f6077cedc267</id>
<content type='text'>
* color-theme-switch-1: select the primary color theme
* color-theme-switch-2: select the alternative color theme
* color-theme-toggle: toggle between the primary and alternative color themes
</content>
</entry>
<entry>
<title>input: reset modifiers in keyboard_leave()</title>
<updated>2025-04-19T11:36:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-19T06:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ef4a680ae813b23e7b9d1b6dd67413dcad377655'/>
<id>urn:sha1:ef4a680ae813b23e7b9d1b6dd67413dcad377655</id>
<content type='text'>
Closes #2034
</content>
</entry>
<entry>
<title>wayland+input: add support for toplevel edge constraints</title>
<updated>2025-04-07T11:41:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-07T11:32:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=23431e3ecfb59f71627b332852b906dc3d0bfad7'/>
<id>urn:sha1:23431e3ecfb59f71627b332852b906dc3d0bfad7</id>
<content type='text'>
Edge constraints are new (not yet available in a wayland-protocols
release) toplevel states, acting as a complement to the existing tiled
states.

Tiled tells us we shouldn't draw shadows etc *outside our window
geometry*.

Constrained tells us the window cannot be resized in the constrained
direction.

This patch does a couple of things:

* Recognize the new states when debug logging

* Change is_top_left() etc to look at the new constrained state
  instead of the tiled state. These functions are used when both
  choosing cursor shape, and when determining if/how to resize a
  window on a CSD edge click-and-drag.

* Update cursor shape selection to use the default (left_ptr) shape
  when on a constrained edge (or corner).

* Update CSD resize triggering, to not trigger a resize when attempted
  on a constrained edge (or corner).

See
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/86750c99ed062c306e837f11bb9492df572ad677:

    An edge constraint is an complementery state to the tiled state,
    meaning that it's not only tiled, but constrained in a way that it
    can't resize in that direction.

    This typically means that the constrained edge is tiled against a
    monitor edge. An example configuration is two windows tiled next
    to each other on a single monitor. Together they cover the whole
    work area.

    The left window would have the following tiled and edge constraint
    state:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_left ]

    while the right window would have the following:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_right ]

    This aims to replace and deprecate the
    `gtk_surface1.configure_edges` event and the
    `gtk_surface1.edge_constraint` enum.
</content>
</entry>
<entry>
<title>input: xkb: ignore virtual modifiers</title>
<updated>2025-03-31T06:08:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-29T09:34:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=58910856c8a86095883625009a089cef464edc44'/>
<id>urn:sha1:58910856c8a86095883625009a089cef464edc44</id>
<content type='text'>
Some compositors (mutter/GNOME is one) adds _virtual_ modifiers to the
set of active modifiers when e.g. Alt, Meta, Super or Hyper is
pressed. For example, pressing Alt+b would result in *both* the Alt
*and* the Mod1 modifier being set.

Since foot makes close to zero assumptions on how the modifiers should
be interpreted, this causes various breakages.

For example, a foot shortcut defined as Mod1+b will not match, since
the Alt modifiers is also set. This has forced users to
redefine/override some of the default key bindings to include the
additional modifiers.

It also causes issues with the kitty keyboard protocol, for some key
combinations. Mainly whether or not to use unshifted key or not,
resulting in incorrect escape sequences.

Since all the "real" modifiers are always set as well, we can safely
ignore the virtual modifiers.

Closes #2009
</content>
</entry>
<entry>
<title>input: kitty: unittest: don't fail if system has no compose tables</title>
<updated>2025-03-11T07:42:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-11T07:42:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cfa178ab259528a106a2855bdd2e07c34a822224'/>
<id>urn:sha1:cfa178ab259528a106a2855bdd2e07c34a822224</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: send release events for composed keys</title>
<updated>2025-03-11T07:36:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-11T07:36:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7976975a8a6382a1e81a5d6c2749bc5beb23ff41'/>
<id>urn:sha1:7976975a8a6382a1e81a5d6c2749bc5beb23ff41</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: regression test for #1987</title>
<updated>2025-03-11T07:23:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-11T07:23:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=04fcc5f5b5d0a3f45d752e987a0c87baa4e50779'/>
<id>urn:sha1:04fcc5f5b5d0a3f45d752e987a0c87baa4e50779</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: always use shifted key when it's the result of a compose</title>
<updated>2025-03-10T14:47:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-10T14:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8d2627b1ef8fd7f8313e4441de3c76b873575a8e'/>
<id>urn:sha1:8d2627b1ef8fd7f8313e4441de3c76b873575a8e</id>
<content type='text'>
Closes #1987
</content>
</entry>
<entry>
<title>config+url: add support for user-defined regex patterns</title>
<updated>2025-02-05T12:35:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-03T07:55:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=051cd6ecfc8b98e1d80b399ebea40207fe040750'/>
<id>urn:sha1:051cd6ecfc8b98e1d80b399ebea40207fe040750</id>
<content type='text'>
Users can now define their own regex patterns, and use them via key
bindings:

    [regex:foo]
    regex=foo(bar)?
    launch=path-to-script-or-application {match}

    [key-bindings]
    regex-launch=[foo] Control+Shift+q
    regex-copy=[foo] Control+Mod1+Shift+q

That is, add a section called 'regex:', followed by an
identifier. Define a regex and a launcher command line.

Add a key-binding, regex-launch and/or regex-copy (similar to
show-urls-launch and show-urls-copy), and connect them to the regex
with the "[regex-name]" syntax (similar to how the pipe-* bindings
work).
</content>
</entry>
<entry>
<title>input: match unshifted key-bindings before shifted</title>
<updated>2025-01-31T08:07:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-31T08:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=51128a3484049e5f9b9b74276222977d12554d76'/>
<id>urn:sha1:51128a3484049e5f9b9b74276222977d12554d76</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>input: ignore key-bindings without modifiers when matching untranslated/raw</title>
<updated>2025-01-31T06:35:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-31T06:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bee17a95b86a640522c25e650e13aebc82c7353d'/>
<id>urn:sha1:bee17a95b86a640522c25e650e13aebc82c7353d</id>
<content type='text'>
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.
</content>
</entry>
</feed>
