<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/terminal.c, branch 1.25.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.25.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.25.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-10-10T08:23:17Z</updated>
<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>term: osc8: tag *all* cells in a multi-column character as an URI</title>
<updated>2025-10-04T07:24:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-04T07:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=80951ab7a6b3bcc4dd3c30a5454bf648d3d9ed93'/>
<id>urn:sha1:80951ab7a6b3bcc4dd3c30a5454bf648d3d9ed93</id>
<content type='text'>
When we print a character to the grid, we must also update its OSC-8
state if an OSC-8 URI is currently active.

For double-width characters, this was only being done for the first
cell.

This causes the labels in URL mode to be off, as the link was
effectively chopped up into multiple pieces.

Closes #2179
</content>
</entry>
<entry>
<title>Revert "term: erase: use erase_line() whenever a range corresponds to a full line"</title>
<updated>2025-10-04T05:21:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-04T05:21:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1dfa86c93ac3585b1b8b6ff3d8617176a57942c3'/>
<id>urn:sha1:1dfa86c93ac3585b1b8b6ff3d8617176a57942c3</id>
<content type='text'>
This reverts commit 44a674edb86f2f8db3304d76faf567346dcd7d94.

It caused a regression with prompt markers, in at least fish+starship.
</content>
</entry>
<entry>
<title>term: erase: use erase_line() whenever a range corresponds to a full line</title>
<updated>2025-09-25T14:57:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-09-25T14:57:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=44a674edb86f2f8db3304d76faf567346dcd7d94'/>
<id>urn:sha1:44a674edb86f2f8db3304d76faf567346dcd7d94</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: no need to pass ptmx as stdout to utempter</title>
<updated>2025-09-09T15:34:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-09-09T15:34:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=efc39097e5a939c4e6f54bf80d24871bfeeaf80b'/>
<id>urn:sha1:efc39097e5a939c4e6f54bf80d24871bfeeaf80b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: make sure the color table is populated *before* the slave process is spawned</title>
<updated>2025-07-22T11:30:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-07-22T11:30:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=42be74214a0b2cd1b4245b262c99cbd5030a0e0c'/>
<id>urn:sha1:42be74214a0b2cd1b4245b262c99cbd5030a0e0c</id>
<content type='text'>
</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>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>term: unittest: auto-scroll timer FD is created on-demand nowadays</title>
<updated>2025-05-08T08:22:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-08T08:22:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9b0d5e7c96f75d7ca81cd2e452cda54688ecc259'/>
<id>urn:sha1:9b0d5e7c96f75d7ca81cd2e452cda54688ecc259</id>
<content type='text'>
</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: add support for 16-bit surfaces</title>
<updated>2025-05-03T07:04:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-01T07:37:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=970e13db8deebf6c7542c7aede4f34703fa86769'/>
<id>urn:sha1:970e13db8deebf6c7542c7aede4f34703fa86769</id>
<content type='text'>
This adds supports for 16-bit surfaces, using the new
PIXMAN_a16b16g16r16 buffer format. This maps to
WL_SHM_FORMAT_ABGR16161616 (little-endian).

Use the new 16-bit surfaces by default, when
gamma-correct-blending=yes.
</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: add initial-color-theme=1|2</title>
<updated>2025-04-26T12:43:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-21T10:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bc5b71666867c00e7dc850740bb5cc2a13a9c2a9'/>
<id>urn:sha1:bc5b71666867c00e7dc850740bb5cc2a13a9c2a9</id>
<content type='text'>
This option selects which color theme to use by default. I.e. at
startup, and after a reset.

This is useful with combined theme files, where a single file defines
e.g. both a dark and light version of the theme.
</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>config: move cursor.color to colors.cursor</title>
<updated>2025-04-26T08:46:39Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-20T05:16:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=624c383a1f45a4fbd5ebf687613c509e6c22d909'/>
<id>urn:sha1:624c383a1f45a4fbd5ebf687613c509e6c22d909</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert "term: append zero-width grapheme breaking characters to previous cell"</title>
<updated>2025-04-24T16:22:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-24T16:22:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1fec0cf5ea0c3fe3be92a49eaee5eef5aafa9c49'/>
<id>urn:sha1:1fec0cf5ea0c3fe3be92a49eaee5eef5aafa9c49</id>
<content type='text'>
This reverts commit 76503fb86a8b8a6b5c3ce1be87c15a55af38508d.
</content>
</entry>
<entry>
<title>Revert "term: ignore LTR+RTL markers  (U+200E + U+200F)"</title>
<updated>2025-04-24T16:20:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-24T16:20:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1b15cc5f3d633809114d9d569b34abf934426c69'/>
<id>urn:sha1:1b15cc5f3d633809114d9d569b34abf934426c69</id>
<content type='text'>
This reverts commit 70b324b24c86473a99528feb6f1f91ca70e11a02.
</content>
</entry>
<entry>
<title>term: ignore LTR+RTL markers  (U+200E + U+200F)</title>
<updated>2025-04-24T06:23:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-24T06:23:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=70b324b24c86473a99528feb6f1f91ca70e11a02'/>
<id>urn:sha1:70b324b24c86473a99528feb6f1f91ca70e11a02</id>
<content type='text'>
Foot doesn't implement RTL, and explicit LTR markers is neither
needed, nor used in anyway. In fact, they cause issues with font
lookup, as fcft often fails to find the marker codepoint in the
primary font, causing a fallback font to be used instead.

Closes #2049
</content>
</entry>
<entry>
<title>fcft: require fcft &gt;= 3.3.0, add support for new scaling-filters</title>
<updated>2025-03-12T09:03:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-12T09:03:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7f11ba59efad352b1ff0bb11c0286942ae3d1edb'/>
<id>urn:sha1:7f11ba59efad352b1ff0bb11c0286942ae3d1edb</id>
<content type='text'>
Update tweak.scaling-filter to recognize the new scaling filters added
in fcft-3.3.0.

Since fcft_set_scaling_filter() is deprecated in 3.3.0, don't use it
anymore, and set the scaling filter via fcft_font_options instead.
</content>
</entry>
<entry>
<title>grid: change default value of linebreak to true</title>
<updated>2025-03-05T17:55:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-04T07:34:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7b6efcf19a10794dd7b41e30ce706eae3a290388'/>
<id>urn:sha1:7b6efcf19a10794dd7b41e30ce706eae3a290388</id>
<content type='text'>
This way, all lines are treated as having a hard linebreak, until it's
cleared when we do an auto-wrap.

This change alone causes issues when reflowing text, as now all
trailing lines in an otherwise empty window are treated as hard
linebreaks, causing the new grid to insert lots of unwanted, empty
lines.

Fix by doing two things:

* *clear* the linebreak flag when we pull in new lines for the new
  grid. We only want to set it explicitly, when an old row has its
  linebreak flag set.
* Coalesce empty lines with linebreak=true, and only "emit" them as
  new liens in the new grid if they are followed by non-empty lines.
</content>
</entry>
</feed>
