<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, 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-22T09:58:54Z</updated>
<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>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>config: add url.style=none|single|double|curly|dotted|dashed</title>
<updated>2026-04-06T13:47:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-04-06T13:47:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2c454a71f14da912f5623336b93ec8f48f2d1cf9'/>
<id>urn:sha1:2c454a71f14da912f5623336b93ec8f48f2d1cf9</id>
<content type='text'>
This option allows you to configure which underline style to use with
URLs.

The default is dotted. Since before this patch, URL underlines were
always plain underlines, this means the default URL underline style
has changed, from single to dotted.

Closes #2302
</content>
</entry>
<entry>
<title>Add support for background blur</title>
<updated>2026-03-02T08:39:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-16T11:43:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dea10e2e48162c6ab48ca564ceeca88dea886a04'/>
<id>urn:sha1:dea10e2e48162c6ab48ca564ceeca88dea886a04</id>
<content type='text'>
This patch adds a new config option: colors{,2}.blur=no|yes. When
enabled, transparent background are also blurred.

Note that this requires the brand new ext-background-effect-v1
protocol, and specifically, that the compositor implements the blur
effect.
</content>
</entry>
<entry>
<title>support four-sided padding (left/top/right/bottom)</title>
<updated>2026-03-02T08:13:01Z</updated>
<author>
<name>pi66</name>
<email>pixel2176@proton.me</email>
</author>
<published>2025-12-19T11:17:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=21485fa66d9b7026bfd1dd2764431805cdb17cf1'/>
<id>urn:sha1:21485fa66d9b7026bfd1dd2764431805cdb17cf1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: wait for pre-apply damage thread before destroying a terminal instance</title>
<updated>2026-02-02T11:40:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-01-28T08:44:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c291194a4e593bbbb91420e81fa0111508084448'/>
<id>urn:sha1:c291194a4e593bbbb91420e81fa0111508084448</id>
<content type='text'>
It's possible, but unlikely, that we've pushed a "pre-apply damage"
job to the renderer thread queue (or that we've pushed it, and the
a thread is now working on it) when we shutdown a terminal instance.

This is sometimes caught in an assertion in term_destroy(), where we
check the queue length is 0. Other times, or in release builds, we
might crash in the thread, or in the shutdown logic when freeing the
buffer chains associated with the terminal instance.

Fix by ensuring there's no pre-apply damage operation queued, or
running, before shutting down a terminal instance.

Closes #2263
</content>
</entry>
<entry>
<title>shm: don't bother with xrgb surfaces, always use argb</title>
<updated>2026-01-04T17:59:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-01-04T06:57:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b78cc92322dd2ae431dbbb70bc681b4d603d844d'/>
<id>urn:sha1:b78cc92322dd2ae431dbbb70bc681b4d603d844d</id>
<content type='text'>
Before this patch, foot used xrgb surfaces for all fully opaque
surfaces, and only used argb surfaces for the main window when the
user enabled translucency.

However, several compositors have damage-like issues when we switch
between opaque and non-opaque surfaces (for example, when switching
color theme, or when toggling fullscreen).

Since the performance benefit of using non-alpha aware surfaces are
likely minor (if there's any measurable performance difference at
all!), lets workaround these compositor issues by always using argb
surfaces.
</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>render: don't warn about immediate buffer release if pre-apply-damage has been activated</title>
<updated>2025-10-16T06:45:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-16T06:45:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=612adda3842fcdbbc9b7e1e2f46be02a224da1eb'/>
<id>urn:sha1:612adda3842fcdbbc9b7e1e2f46be02a224da1eb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: add colors.dim-blend-towards=black|white</title>
<updated>2025-10-10T09:10:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-10T09:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7ed36c10334c0b2480fa026238f8f1791d2f9439'/>
<id>urn:sha1:7ed36c10334c0b2480fa026238f8f1791d2f9439</id>
<content type='text'>
Before this patch, we always blended towards black when dimming
text. However, with light color themes, it usually looks better if we
dim towards white instead.

This option allows you to choose which color to blend towards.

The default is 'black' in '[colors]', and 'white' in '[colors2]'.

Closes #2187
</content>
</entry>
<entry>
<title>render: when double-buffering, pre-apply previous frame's damage early</title>
<updated>2025-10-10T08:23:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-05T08:48:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=299186a6547f6e038ee6f3822caf9a0fdfabceef'/>
<id>urn:sha1:299186a6547f6e038ee6f3822caf9a0fdfabceef</id>
<content type='text'>
Foot likes it when compositor releases buffer immediately, as that
means we only have to re-render the cells that have changed since the
last frame.

For various reasons, not all compositors do this. In this case, foot
is typically forced to switch between two buffers, i.e. double-buffer.

In this case, each frame starts with copying over the damage from the
previous frame, to the new frame. Then we start rendering the updated
cells.

Bringing over the previous frame's damage can be slow, if the changed
area was large (e.g. when scrolling one or a few lines, or on full
screen updates). It's also done single-threaded. Thus it not only
slows down frame rendering, but pauses everything else (i.e. input
processing). All in all, it reduces performance and increases input
latency.

But we don't have to wait until it's time to render a frame to copy
over the previous frame's damage. We can do that as soon as the
compositor has released the buffer (for the frame _before_ the
previous frame). And we can do this in a thread.

This frees up foot to continue processing input, and reduces frame
rendering time since we can now start rendering the modified cells
immediately, without first doing a large memcpy(3).

In worst case scenarios (or perhaps we should consider them best case
scenarios...), I've seen up to a 10x performance increase in frame
rendering times (this obviously does *not* include the time it takes
to copy over the previous frame's damage, since that doesn't affect
neither input processing nor frame rendering).

Implemented by adding a callback mechanism to the shm abstraction
layer. Use it for the grid buffers, and kick off a thread that copies
the previous frame's damage, and resets the buffers age to 0 (so that
foot understands it can start render to it immediately when it later
needs to render a frame).

Since we have certain way of knowing if a compositor releases buffers
immediately or not, use a bit of heuristics; if we see 10 consecutive
non-immediate releases (that is, we reset the counter as soon as we do
see an immediate release), this new "pre-apply damage" logic is
enabled. It can be force-disabled with tweak.pre-apply-damage=no.

We also need to take care to wait for the thread before resetting the
render's "last_buf" pointer (or we'll SEGFAULT in the thread...).

We must also ensure we wait for the thread to finish before we start
rendering a new frame. Under normal circumstances, the wait time is
always 0, the thread has almost always finished long before we need to
render the next frame. But it _can_ happen.

Closes #2188
</content>
</entry>
<entry>
<title>quirks: remove subsurface unmap quirk for Sway</title>
<updated>2025-06-09T05:08:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-06-09T05:08:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7347f4beb1314df12e834a260f18feae8b775a5a'/>
<id>urn:sha1:7347f4beb1314df12e834a260f18feae8b775a5a</id>
<content type='text'>
Sway used to have an issue where unmapping a subsurface did not damage
the surface below (https://github.com/swaywm/sway/issues/6960).

This has been fixed for quite some time now, so let's remove the
quirk.
</content>
</entry>
<entry>
<title>conf: pad: add center-when-fullscreen and center-when-maximized-and-fullscreen</title>
<updated>2025-05-24T07:56:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-23T06:38:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5a84f8d841d09e9aa91befbbb8e8b634b7f8959a'/>
<id>urn:sha1:5a84f8d841d09e9aa91befbbb8e8b634b7f8959a</id>
<content type='text'>
Before this patch, the grid content was *always* centered when the
window was maximized or fullscreened, regardless of how the user had
configured padding.

Now, the behavior is controlled by the 'pad' option. Before this
patch, the syntax was

    pad MxN [center]

Now it is

    pad MxN [center|center-when-fullscreen|center-when-maximized-and-fullscreen]

The default is "pad 0x0 center-when-maximized-and-fullscreen", to
match current behavior.

Closes #2111
</content>
</entry>
<entry>
<title>cursor-shape: add 'dnd-ask' and 'all-resize'</title>
<updated>2025-05-22T04:59:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-21T13:25:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=664cdcc65cf42ab269ea4a2c4962c3ee65d7e92f'/>
<id>urn:sha1:664cdcc65cf42ab269ea4a2c4962c3ee65d7e92f</id>
<content type='text'>
These (non-css) cursor shapes were added to the cursor-shape-v1
protocol in wayland-protocols 1.42.

We don't need (or use them at all) internally, but add them to the
list we use to translate from shape names to shape enums. This allows
users to set a custom shape (via OSC-22), while still using server
side cursors (i.e. no need to fallback to client-side cursors).

If we try to set a shape not implemented by the server, we get a
protocol error and foot exits. This is bad.

So, make sure we don't do that:

1. First, we need to explicitly bind v2 if implemented by the server
2. Track the bound version number in the wayland struct
3. When matching shape enum, skip shapes not supported in the
   currently bound version of the cursor-shape protocol
</content>
</entry>
<entry>
<title>render: improve CSD button positioning</title>
<updated>2025-05-21T05:39:35Z</updated>
<author>
<name>Kirill Primak</name>
<email>vyivel@eclair.cafe</email>
</author>
<published>2025-05-20T12:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=456ac5d79f46a670479fcdaa75df0942a1571c78'/>
<id>urn:sha1:456ac5d79f46a670479fcdaa75df0942a1571c78</id>
<content type='text'>
This commit fixes titlebar button positioning when maximization isn't
available but minimization is.
</content>
</entry>
<entry>
<title>render: refactor to allow setting only selection bg or fg</title>
<updated>2025-05-05T11:02:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-05T10:43:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=073b637d4535cd0dfe92ca1ce954b552ae9f1a4a'/>
<id>urn:sha1:073b637d4535cd0dfe92ca1ce954b552ae9f1a4a</id>
<content type='text'>
Before this, we only applied custom selection colors, if *both* the
selection bg and fg had been set.

Since the options are already split up into two separate options, and
since it makes sense to at least be able to keep the foreground colors
unchanged (i.e. only setting the selection background), let's allow
only having one of the selection colors set.

Closes #1846
</content>
</entry>
<entry>
<title>config: tweak.surface-bit-depth now defaults to 'auto'</title>
<updated>2025-05-01T06:54:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-01T06:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e5a0755451b736c635be58764799ef8d7b536e8d'/>
<id>urn:sha1:e5a0755451b736c635be58764799ef8d7b536e8d</id>
<content type='text'>
When set to 'auto', use 10-bit surfaces if gamma-correct blending is
enabled, and 8-bit surfaces otherwise.

Note that we may still fallback to 8-bit surfaces (without disabling
gamma-correct blending) if the compositor does not support 10-bit
surfaces.

Closes #2082
</content>
</entry>
<entry>
<title>config: gamma-correct-blending: disable by default</title>
<updated>2025-05-01T06:09:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-01T06:09:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b07ce56321404a34fc02635ecf4d5b63ddddf1ea'/>
<id>urn:sha1:b07ce56321404a34fc02635ecf4d5b63ddddf1ea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: regression: alpha applied to inversed text/selections</title>
<updated>2025-04-25T17:20:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-25T17:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb1b7ba0c5752eeb92c72a80640fbd1f09ad4b7d'/>
<id>urn:sha1:cb1b7ba0c5752eeb92c72a80640fbd1f09ad4b7d</id>
<content type='text'>
Introduced by 5f83278afd0530c323d4192e1095b3d1dea644c9

Closes #2073
</content>
</entry>
<entry>
<title>render: fix colors.alpha-mode=matching</title>
<updated>2025-04-19T11:33:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-19T05:46:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1a2e5f4932a17c9804ca6d201b7d8cf84d7f19d9'/>
<id>urn:sha1:1a2e5f4932a17c9804ca6d201b7d8cf84d7f19d9</id>
<content type='text'>
Before this patch, it only matched RGB color sources. It did not match
the default bg color, or indexed colors. That is, e.g. CSI 43m didn't
apply alpha, even if the color3 matched the default background color.
</content>
</entry>
</feed>
