<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git, branch osc-5522</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=osc-5522</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=osc-5522'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2026-05-22T10:06:28Z</updated>
<entry>
<title>osc: kitty_clipboard_write_finish(): fix walias handling</title>
<updated>2026-05-22T10:06:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-22T10:06:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1067b9bf6964d3da99f663287a84e618d9686127'/>
<id>urn:sha1:1067b9bf6964d3da99f663287a84e618d9686127</id>
<content type='text'>
* 'i' was never incremented, meaning we stored the *last* walias in
  the *first alias position in the mime-type list passed to the
  clipboard handling. The remaining elements were uninitialized and
  invalid.

* We only asserted that we'd found the target mime-type of a
  walias. But we need to handle it NOT being found, as it's perfectly
  possible for a user to send an "invalid" walias, where the target
  mime-type has NOT been sent in a wdata packet.
</content>
</entry>
<entry>
<title>osc: kitty_clipboard_query(): reply with EPERM if OSC pasting has been disabled</title>
<updated>2026-05-22T09:59:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-22T09:59:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e85209e73616541a64934661540577aa090d242a'/>
<id>urn:sha1:e85209e73616541a64934661540577aa090d242a</id>
<content type='text'>
This is already being done in when reading and writing the clipboard,
but we had missed the query code path.
</content>
</entry>
<entry>
<title>changelog: OSC-5522</title>
<updated>2026-05-22T09:58:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-17T11:42:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4b64ed0a49e616b39402eec4159ef886938a0149'/>
<id>urn:sha1:4b64ed0a49e616b39402eec4159ef886938a0149</id>
<content type='text'>
</content>
</entry>
<entry>
<title>doc: foot-ctlseqs: add OSC-5522</title>
<updated>2026-05-22T09:58:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-17T11:42:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=221127982a31d1e2b603e2b84ba971d95de8c280'/>
<id>urn:sha1:221127982a31d1e2b603e2b84ba971d95de8c280</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: implement OSC-5522, kitty's extended version of OSC-52</title>
<updated>2026-05-22T09:58:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-15T16:35:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c366e322eb0813253fb08e2720927f26563a09f8'/>
<id>urn:sha1:c366e322eb0813253fb08e2720927f26563a09f8</id>
<content type='text'>
OSC-5522[^1] gives the terminal application access to all offered
mime-types when reading the clipboard, and allows setting multiple
mime-types when writing to the clipboard (with different contents, if
it so wishes).

In addition to the base protocol, we also implement the _event
extension_[^2], where a paste action (e.g. ctrl+shift+v) results in an
unsolicited mime-type listing being sent to the terminal
application (as if it had issued a mime-type query itself), instead of
the clipboard content being pasted directly. The application follows
up with an explicit read request (or chooses to ignore the event).

The protocol supports "passwords", as a way of bypassing terminal
popups asking the user for approval, after the first popup has been
approved by the user. Foot doesn't implement this kind of user
approval, but all read and write requests are denied with EPERM if the
user has disabled OSC copy/pasting with the security.osc52
configuration option. In addition, if disabled, event reporting cannot
be enabled at all (i.e. 'CSI ? 5522 h' is ignored).

[^1]: https://sw.kovidgoyal.net/kitty/clipboard/
[^2]: https://rockorager.dev/misc/bracketed-paste-mime/
</content>
</entry>
<entry>
<title>base64: add base64_encode_oneshot()</title>
<updated>2026-05-22T09:58:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-16T18:26:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4bc8a39d6c6390d4ebfee6a16e22750e52d3da6a'/>
<id>urn:sha1:4bc8a39d6c6390d4ebfee6a16e22750e52d3da6a</id>
<content type='text'>
Convenience function for base64_encode() + base64_encode_final().

Internally, we also add base64_encode_to_buffer()

This is an internal function that encodes a multiple-of-three long
input into a user allocated buffer.

base64_encode() and base64_encode_oneshot() uses the new function to
do the bulk of the encoding. This allows base64_encode_oneshot() to do
a single allocation.

This patch also adds unit tests for both base64_encode() and
base64_encode_oneshot() (but _not_ for base64_encode_final()).

Finally, the type of the 'data' parameter is changed to 'void*'.
</content>
</entry>
<entry>
<title>selection: do not copy empty text</title>
<updated>2026-05-22T09:49:46Z</updated>
<author>
<name>CismonX</name>
<email>admin@cismon.net</email>
</author>
<published>2026-05-20T18:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4bf60d0fbcad533c5131288617caae67342c1065'/>
<id>urn:sha1:4bf60d0fbcad533c5131288617caae67342c1065</id>
<content type='text'>
Copy-on-select (configured with 'selection-target') may accidentally
clear the clipboard, if the user drags the mouse a little bit when
clicking inside a terminal window.

Now we only copy if there is actual text being selected.

Closes #2327
</content>
</entry>
<entry>
<title>csi: DECCRA: clamp and verify destination rectangle coordinates</title>
<updated>2026-05-22T09:39:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-22T09:39:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b18d8aa2f165a3b07c28f43de6812e057ba3233e'/>
<id>urn:sha1:b18d8aa2f165a3b07c28f43de6812e057ba3233e</id>
<content type='text'>
dst_right was already being clamped, but not dst_left.

In addition to that, reject the sequence if dst_left &gt; dst_right, or
dst_bottom &gt; dst_top.

This is already being done for the source rectangle, in
params_to_rectangular_area().

Closes #2352
</content>
</entry>
<entry>
<title>uri-parse: fix out-of-bounds read with malformed %-encoded content</title>
<updated>2026-05-22T09:00:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-22T08:59:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2eaa7beba1f35b31019a992de35be8a54b9ac028'/>
<id>urn:sha1:2eaa7beba1f35b31019a992de35be8a54b9ac028</id>
<content type='text'>
If the input URI ends with a trailing '%' (or a trailing '%N'), we
read outside the provided buffer.

On NULL terminated input, this happened to work out since we'd
correctly detect an invalid %-sequence as soon as we read the NULL
terminator.

On input that is not NULL terminated, we're out of luck.

This patch fixes this by also checking we have enough input left to
even _try_ to read the %-digits.

Also add unit tests for this particular case.

Closes #2353
</content>
</entry>
<entry>
<title>uri-parse: add a bunch of unit tests</title>
<updated>2026-05-22T08:49:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-22T08:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5335cec3228dab421b2abba4f178125d88ad2fbe'/>
<id>urn:sha1:5335cec3228dab421b2abba4f178125d88ad2fbe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>project: add .clangd, where we set -Wno-c2y-extensions</title>
<updated>2026-05-17T13:03:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-17T13:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f35e60577fde44a7360415448a380702d2ac0ae4'/>
<id>urn:sha1:f35e60577fde44a7360415448a380702d2ac0ae4</id>
<content type='text'>
We make use of __COUNTER__, which recent versions of clang emit a
warning for (unless you compile with -std=c2y).

Our meson.build already handles this for the actual build, but if your
build is using gcc, -Wno-c2y-extensions isn't added to the build
rules (since gcc doesn't support the flag).
</content>
</entry>
<entry>
<title>changelog: add new 'unreleased' section</title>
<updated>2026-05-15T06:29:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-15T06:29:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2d11b36a24d7bdd056fac48fb8d5e8f274a1dcf0'/>
<id>urn:sha1:2d11b36a24d7bdd056fac48fb8d5e8f274a1dcf0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'releases/1.27'</title>
<updated>2026-05-15T06:27:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-15T06:27:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ab1660ef62d7e00edfd97029dfa54fe44675f247'/>
<id>urn:sha1:ab1660ef62d7e00edfd97029dfa54fe44675f247</id>
<content type='text'>
</content>
</entry>
<entry>
<title>meson: bump version to 1.27.0</title>
<updated>2026-05-15T06:26:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-15T06:26:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=de998602dbc00c8862a6823d553cbb1df91c676d'/>
<id>urn:sha1:de998602dbc00c8862a6823d553cbb1df91c676d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>changelog: prepare for 1.27.0</title>
<updated>2026-05-15T06:25:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-15T06:25:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a94e1dda2186f6cdbe2b4fd9d615c8327c588cec'/>
<id>urn:sha1:a94e1dda2186f6cdbe2b4fd9d615c8327c588cec</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: kitty notifications: increase query reply buffer size</title>
<updated>2026-05-14T14:03:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-14T10:41:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ab6ffd1344d1d19f4c7275fcb3c1429a11881381'/>
<id>urn:sha1:ab6ffd1344d1d19f4c7275fcb3c1429a11881381</id>
<content type='text'>
When we initially implemented the kitty notification protocol, 128
bytes was enough.

Since then, the protocol has grown, and 128 bytes is no longer enough,
resulting in a crash when you try to query the protocol:

    printf "\e]99;i=123:p=?;\e\\"

Results in

    #0 0x7fe4fad3dcde in __sanitizer_print_stack_trace (/usr/lib/libasan.so.8+0x13dcde) (BuildId: 38f5643355445a477f07ffa9b6a83a55c87415a0)
    #1 0x561ec61454e8 in print_stack_trace ../../debug.c:20
    #2 0x561ec6145550 in fatal_error ../../debug.c:28
    #3 0x561ec61462d0 in xvsnprintf ../../xsnprintf.c:42
    #4 0x561ec614640a in xsnprintf ../../xsnprintf.c:52
    #5 0x561ec6131fe6 in kitty_notification ../../osc.c:765
    #6 0x561ec6139fec in osc_dispatch ../../osc.c:1511
    #7 0x561ec60fcac8 in action_osc_end ../../vt.c:614
    #8 0x561ec60fe6bb in state_osc_string_switch ../../vt.c:924
    #9 0x561ec60ff437 in vt_from_slave ../../vt.c:1115
    #10 0x561ec6078748 in fdm_ptmx ../../terminal.c:297
    #11 0x561ec5ee6ed0 in fdm_poll ../../fdm.c:483
    #12 0x561ec5f344d3 in main ../../main.c:676
    #13 0x7fe4f9e2777d  (/usr/lib/libc.so.6+0x2777d) (BuildId: 674f3ebbcb651fbc7d1189cb300acfd7d007849a)
    #14 0x7fe4f9e278bb in __libc_start_main (/usr/lib/libc.so.6+0x278bb) (BuildId: 674f3ebbcb651fbc7d1189cb300acfd7d007849a)
    #15 0x561ec5e77a14 in _start (/home/daniel/src/foot/bld/debug/foot+0x4b8a14) (BuildId: 9fca511350f3745edd3546ff800a763c1957e673)

Closes #2335
</content>
</entry>
<entry>
<title>render: cursor: improve handling of fg == bg</title>
<updated>2026-05-12T14:40:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-11T12:14:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cc6b29fe3a98a1575af4eb6644504a2fff619b5c'/>
<id>urn:sha1:cc6b29fe3a98a1575af4eb6644504a2fff619b5c</id>
<content type='text'>
We already detect if the final cursor colors (foreground/background)
are identical.

If they were, we replaced them with the default fg/bg.

Unfortunately, this can still result in an invisible cursor. For
example, if the current cell's default bg matches the current cell's
fg.

Instead, update the colors in two steps:

1. First, use the provided (cell's) fg/bg
2. If they too match, invert the cursor color

This should ensure the cursor is always visible

Closes #2323
</content>
</entry>
<entry>
<title>search/url/unicode-mode: set last-shortcut-sym</title>
<updated>2026-05-12T14:39:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-11T07:16:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a2476536f9d28d8f02d8477822a1425df16ac28d'/>
<id>urn:sha1:a2476536f9d28d8f02d8477822a1425df16ac28d</id>
<content type='text'>
When processing shortcuts, set seat-&gt;kbd.last_shortcut_sym. This
ensures the corresponding release event is ignored in the main mode,
if the shortcut triggered a mode exit.

For example, pressing Return in search mode would exit search mode,
and then immediately reset the search match, if the kitty keyboard
protocol mode with release events were enabled.
</content>
</entry>
<entry>
<title>uri: check 'scheme' is non-null before de-referencing it</title>
<updated>2026-05-11T11:37:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-11T11:37:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=43566b655fee76947e0166d74a9dda4c03be26e6'/>
<id>urn:sha1:43566b655fee76947e0166d74a9dda4c03be26e6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>meson: add -Dfanalyzer=false|true</title>
<updated>2026-05-11T11:04:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-05-11T11:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=98c84e632676f3e8515789bacee81d3ed0888f3a'/>
<id>urn:sha1:98c84e632676f3e8515789bacee81d3ed0888f3a</id>
<content type='text'>
When enabled, compile with -fanalyzer
</content>
</entry>
</feed>
