aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* meson: bump version to 1.27.01.27.0releases/1.27Daniel Eklöf2026-05-15-1/+1
|
* changelog: prepare for 1.27.0Daniel Eklöf2026-05-15-8/+3
|
* osc: kitty notifications: increase query reply buffer sizeDaniel Eklöf2026-05-14-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* render: cursor: improve handling of fg == bgDaniel Eklöf2026-05-12-5/+20
| | | | | | | | | | | | | | | | | | | | 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
* search/url/unicode-mode: set last-shortcut-symDaniel Eklöf2026-05-12-0/+8
| | | | | | | | | | When processing shortcuts, set seat->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.
* uri: check 'scheme' is non-null before de-referencing itDaniel Eklöf2026-05-11-1/+1
|
* meson: add -Dfanalyzer=false|trueDaniel Eklöf2026-05-11-1/+6
| | | | When enabled, compile with -fanalyzer
* keymap: no reason keypad keys shouldn't map shiftDaniel Eklöf2026-04-17-22/+3
| | | | | | | | | | I'm guessing, but I'm not sure, that when I initially implemented this, XTerm ignored shift in keypad escapes. Testing again, it doesn't. And regardless of what XTerm does, I don't really see any reason to exclude shift from keypad escapes. Closes #2324
* config: add url.style=none|single|double|curly|dotted|dashedDaniel Eklöf2026-04-06-11/+50
| | | | | | | | | | | 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
* wayland: shm: fix debug builds when LOG_ENABLE_DBG == 0Daniel Eklöf2026-04-06-1/+1
|
* wayland: shm: included decoded fourcc name when logging shm formatsDaniel Eklöf2026-04-06-2/+18
|
* input: no extra key processing in alternate input modesDaniel Eklöf2026-04-06-8/+15
| | | | | | | | | | | | | | | | | | | 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
* osc-52: don't strip any control characters, and don't do newline conversionDaniel Eklöf2026-03-22-19/+32
|
* term: enqueue data to slave if there are queued paste data buffersDaniel Eklöf2026-03-21-1/+11
| | | | | | | | | | | | | | | | | | | | When writing paste data to the terminal (either interactively, or as an OSC-52 reply), we enqueue other data (key presses, for examples, or query replies) while the paste is happening. The idea is to send the key press _after_ all paste data has been written, to ensure consistency. Unfortunately, we only checked for an on-going paste. I.e. where the paste itself hasn't yet finished. It is also possible the paste itself has finished, but we haven't yet flushed all the paste buffers. That is, if we were able to *receive* paste data faster than the terminal client was able to *consume* it. In this case, we've queued up paste data in the terminal. These are in separate queues, and when emitting e.g. a key press, we didn't check if all _those_ queues had been flushed yet. Closes #2307
* changelog: add new 'unreleased' sectionDaniel Eklöf2026-03-14-0/+11
|
* Merge branch 'releases/1.26'Daniel Eklöf2026-03-14-8/+7
|\
| * meson: bump version to 1.26.11.26.1releases/1.26Daniel Eklöf2026-03-14-1/+1
| |
| * changelog: prepare for 1.26.1Daniel Eklöf2026-03-14-7/+6
| |
| * Merge branch 'master' into releases/1.26Daniel Eklöf2026-03-14-5/+31
| |\ | |/ |/|
* | OpenBSD has UTF-32vlkrs2026-03-12-1/+1
| |
* | wayland: do all surface unmap and roundtrips before waiting for pre-apply damageDaniel Eklöf2026-03-10-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pre-apply damage thread may be running when we destroy a terminal instance, and we need to wait for it to finish before destroying the underlying buffer. c291194a4e593bbbb91420e81fa0111508084448 did this, but failed to realize the thread may get re-started in the roundtrips done later in wayl_win_destroy(); after the wait added in c291194a4e593bbbb91420e81fa0111508084448, we unmap all surfaces (including the main grid), and roundtrip. This means the compositor will release the currently active buffer, and that means _we_ will trigger the pre-apply damage thread on it. This introduces a race, where wayl_win_destroy() may reach its shm_purge() calls before the pre-apply damage thread has finished. That typically causes foot to crash. Closes #2288
* | meson: clang: add -Wno-wc2y-extensionsDaniel Eklöf2026-03-10-0/+5
| | | | | | | | | | | | | | | | Recent clang versions warn on __COUNTER__, unless compiling with -std=c2y (which breaks other things). "Fixes" '__COUNTER__' is a C2y extension (__COUNTER__ is used by our UNITTEST macro).
* | themes: paper-color-light: fix newlineRoshless2026-03-05-1/+1
| |
* | doc: foot.ini: fix default value of initial-color-themeDaniel Eklöf2026-03-05-1/+8
| | | | | | | | Closes #2292
* | changelog: add new 'unreleased' sectionDaniel Eklöf2026-03-03-0/+11
| |
* | Merge branch 'releases/1.26'Daniel Eklöf2026-03-03-4/+16
|\|
| * meson: bump version to 1.26.01.26.0Daniel Eklöf2026-03-03-1/+1
| |
| * changelog: prepare for 1.26.0Daniel Eklöf2026-03-03-3/+15
|/
* Remove metainfo.xmlDaniel Eklöf2026-03-03-57/+0
| | | | | It hasn't been kept up to date for a long time, and no one seems to care, so lets remove it.
* readme: update sixel screenshotDaniel Eklöf2026-03-02-1/+1
| | | | Closes #2215
* test: config: blur: fix test failure; use the correct parsing functionDaniel Eklöf2026-03-02-2/+2
|
* Add support for background blurDaniel Eklöf2026-03-02-43/+154
| | | | | | | | | 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.
* Spawning new terminal with --config from parent instanceStéphane Klein2026-03-02-1/+21
| | | | | Reference: https://codeberg.org/dnkl/foot/issues/1622 Signed-off-by: Stéphane Klein <contact@stephane-klein.info>
* support four-sided padding (left/top/right/bottom)pi662026-03-02-29/+69
|
* doc: foot.ini: mention titlebar text color in button-colornariby2026-03-02-2/+2
|
* doc: fix typos in foot.ini.5.scdBarinderpreet Singh2026-03-02-21/+21
|
* Fix cursor colorvaloq2026-02-23-1/+1
| | | | Default cursor color in alacritty is white (foreground) and not cyan.
* wayland: wait for pre-apply damage thread before destroying a terminal instanceDaniel Eklöf2026-02-02-5/+11
| | | | | | | | | | | | | | | | 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
* osc-8: don't log URL + ID when closingDaniel Eklöf2026-02-02-3/+5
|
* sixel: force a height of at least one sixel when explicitly resizingDaniel Eklöf2026-01-28-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Applications often prefix the sixel with a raster attributes (RA) sequence, where they tell us how large the sixel is. Strictly speaking, this just tells us the size of the area to clear, but we use it as a hint and pre-allocates the image buffer. It's important to stress that it is valid to emit a MxN RA, and then write sixel data outside of that area. Foot handles this, in _most_ cases. We didn't handle the corner case Mx0. I.e. a width > 0, but height == 0. No image buffer was allocated, and we also failed to detect a resize was necessary when the application started printing sixel data. Much of this is for performance reason; we only check the minimum necessary. For example, we only check if going outside the pre-allocated *column* while printing sixels. *Rows* are checked on a graphical newline. In other words, the *current* row has to be valid when writing sixels. And in case of Mx0, it wasn't. Fix by forcing a height of at least one sixel (typically 6 pixels). Closes #2267
* input: ignore release events after a keyboard shortcut was triggeredDaniel Eklöf2026-01-28-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* input: execute: add missing 'return true' to a couple of switch casesDaniel Eklöf2026-01-10-6/+14
| | | | | | 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).
* shm: don't bother with xrgb surfaces, always use argbDaniel Eklöf2026-01-04-79/+42
| | | | | | | | | | | | | | | 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.
* csi: secondary DA: fix comment; we don't use an XTerm version numberDaniel Eklöf2025-12-28-4/+4
|
* ci: python: upgrade pip before installing python packagesDaniel Eklöf2025-12-26-0/+1
|
* ci: combine the codespell and mypy stagesDaniel Eklöf2025-12-26-19/+5
| | | | | They both need python and a venv, so let's combine them, to avoid having to install the same things twice.
* box-drawing: fenv.h: remove, not needed anymoreDaniel Eklöf2025-12-26-1/+0
|
* codespell: use pyproject.toml to define options and exceptionsDaniel Eklöf2025-12-26-2/+6
|
* mypy: no need to declare None as return type for __init__Daniel Eklöf2025-12-26-5/+5
|
* ci: run mypy + ruff checkDaniel Eklöf2025-12-26-0/+18
|
* scripts: mypy fixesDaniel Eklöf2025-12-26-51/+77
|
* pyproject.toml: add initial pyright configurationDaniel Eklöf2025-12-26-0/+3
|
* pyproject.toml: add initial mypy configurationDaniel Eklöf2025-12-26-0/+3
|
* csi: make sure the ASCII printer function is updated on plain underlinesDaniel Eklöf2025-12-24-3/+3
| | | | | | | | | | Otherwise, a sequence like \E[4:2;4m # Enable double-underline, then immediately switch to single Will switch to the slow printer, and then get stuck there even though we immediately switch to plain underlines (which don't need the slow printer).
* builtin terminfo: add custom 'query-os-name'Daniel Eklöf2025-12-20-0/+9
| | | | | | | | | | | | | | Inspired by Kitty's 'kitty-query-os_name'. Notable changes: * Drop kitty prefix * os_name -> os-name * Use "uname -s" without any transformations (e.g. no lower-casing) $ ./utils/xtgettcap query-os-name reply: (44 chars): <ESC>P1+r71756572792d6f732d6e616d65=4C696E7578<ESC>\ query-os-name=Linux Closes #2209
* config: remove deprecated config option cursor.colorDaniel Eklöf2025-12-20-22/+5
| | | | | This option was deprecated in 1.23.0. Use colors-{dark,light}.cursor instead.
* config: add [colors-dark] and [colors-light], replacing [colors] and [colors2]Daniel Eklöf2025-12-20-298/+542
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...)
* shm: revert part of 299186a6547f6e038ee6f3822caf9a0fdfabceefDaniel Eklöf2025-12-17-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 299186a6547f6e038ee6f3822caf9a0fdfabceef introduced a regression, where we don't handle SHM buffer "hiccups" correctly. If foot, for some reason is forced to render a frame "too soon", we might end up having multiple buffers "in flight" (i.e. committed to the compositor). This could happen if the compositor pushes multiple configure events rapidly, for example. Or anything else that forces foot to render something "immediately", without waiting for a frame callback. The compositor typically releases both buffers at the same time (or close to it), so the _next_ time we want to render a frame, we have *two* buffers to pick between. The problem here is that after 299186a6547f6e038ee6f3822caf9a0fdfabceef, foot no longer purges the additional buffer(s), but keeps all of them around. This messes up foot's age tracking, and the _next_ time we're forced to pull two buffers (without the compositor releasing the first one in between), we try to apply damage tracking that is no longer valid. This results in visual glitches. This never self-repairs, and we're stuck with visual glitches until the window is resized, and we're forced to allocate completely new buffers. It is unclear why 299186a6547f6e038ee6f3822caf9a0fdfabceef stopped removing the buffers. It was likely done early in the development, and is no longer needed. So far, I haven't noticed any bugs by re-introducing the buffer purging, but further testing is needed.
* Fix discarded const qualifiers from string functionsYaakov Selkowitz2025-12-17-3/+3
| | | | | This is a new warning in GCC 15 that is being promoted to an error due to the werror=true in meson.build.
* term: mouse SGR mode: don't emit negative CSI valuesDaniel Eklöf2025-12-13-2/+8
| | | | | | | | | | | | | | | | | | When reporting the column/row pixel value in mouse SGR mode, we emitted negative values when the cursor was being dragged outside the window. Unfortunately, negative values aren't allowed in CSI parameters, as '-' is an intermediate value. It was done this way, to be consistent with XTerm behavior. Allegedly, XTerm has changed its behavior in patch 404. With that in mind, and seeing that foot has never emitted negative values in any other mouse mode, let's stop emitting negative values in SGR mode too. Closes #2226
* ci: codespell: ignore 'rin'Daniel Eklöf2025-12-13-1/+1
|
* term: reverse-scroll: fix crash when viewport ends up outside the (new) scrollbackDaniel Eklöf2025-12-13-1/+21
| | | | | | | | | | | | | | | | | | | | | | If the viewport has been scrolled up, it is possible for a reverse-scroll (rin) to cause the viewport to point to lines outside the scrollback. This is an issue if the scrollback isn't full, since in that case, the viewport will contain NULL lines. This will potentially trigger assertions in a couple of different places. Example backtrace: #2 0x555555cd230c in bug ../../debug.c:44 #3 0x555555ad485e in grid_row_in_view ../../grid.h:83 #4 0x555555b15a89 in grid_render ../../render.c:3465 #5 0x555555b3b0ab in fdm_hook_refresh_pending_terminals ../../render.c:5165 #6 0x555555a74980 in fdm_poll ../../fdm.c:435 #7 0x555555ac2b85 in main ../../main.c:676 Detect when this happens, and force-move the viewport to ensure it is valid. Closes #2232
* doc: remove duplicated ctrl+shift+w in foot(1)Whyme Lyu2025-12-01-3/+0
|
* client: add missing <limits.h> (for CHAR_MAX)Daniel Eklöf2025-11-29-6/+7
| | | | Closes #2221
* config: add toplevel-tag=TAGDaniel Eklöf2025-11-12-6/+113
| | | | | | | | | | | Add support for the new xdg-toplevel-tag-v1 Wayland protocol, by exposing a new config option, `toplevel-tag`, and a corresponding command option, `--toplevel-tag` (in both `foot` and `footclient`). This can help the compositor with session management, or custom window rules. Closes #2212
* changelog: triple-click when there's a quote in the last columnDaniel Eklöf2025-11-12-0/+2
|
* Fix assertion failure triple-clicking line with quote in last columnJohannes Altmanninger2025-11-12-3/+10
| | | | | | | | | | | | | | | | | | By default, triple-click tries to select quoted strings within a logical line. This also works if the line spans multiple screen lines. If there is a quote character in the last column: printf %"$COLUMNS"s \'; printf wrapped; sleep inf and I triple-click on the following soft-wrapped line, there's an assertion failure because the column next to the quote is out of range. The quote position has been found by walking at least one cell backwards from "pos". This means that if the quote position is in the very last column, there must be a row below. Also move the assertion to be a pre-condition, though that's debatable.
* changelog: case sensitive scrollback search: move to correct releaseDaniel Eklöf2025-11-01-2/+2
|
* csi: focus mode (private mode 1004): send focus event immediate, when enabledDaniel Eklöf2025-11-01-0/+10
| | | | | | | This lets the application now the current state, without having to wait for the user to switch focus. Fixes #2202
* search: do not emit composing keysRonan Pigott2025-11-01-1/+6
| | | | | When we are in the composing state for XCompose key sequences, we should not add the compose component keys to the search buffer.
* search: use case insensitive search only if there's no uppercase in searchc4llv07e2025-10-30-2/+9
|
* char32: add helper functions to work with c32 casec4llv07e2025-10-30-0/+37
|
* doc: foot.ini: fix typoAndrei2025-10-24-1/+1
|
* input: keymap(): use a goto-label on error, to ensure we always close the keymap FDDaniel Eklöf2025-10-18-9/+8
|
* changelog: add new 'unreleased' sectionDaniel Eklöf2025-10-16-0/+11
|
* Merge branch 'releases/1.25'Daniel Eklöf2025-10-16-6/+7
|\
| * meson: bump version to 1.25.01.25.0releases/1.25Daniel Eklöf2025-10-16-1/+1
| |
| * changelog: prepare for 1.25.0Daniel Eklöf2025-10-16-5/+6
|/
* render: don't warn about immediate buffer release if pre-apply-damage has been activatedDaniel Eklöf2025-10-16-1/+1
|
* wayland: always render a new frame after a fullscreen changeDaniel Eklöf2025-10-15-8/+23
| | | | | | | | | | | This is needed, since we disable alpha in fullscreen, and since we use different image buffer formats (XRGB vs. ARGB) when we have alpha vs. when we don't (and fullscreen always disables alpha). Normally, this happens anyway, as the window is resized when going in or out from fullscreen. But, it's technically possible for a compositor to change an application's fullscreen state without resizing the window.
* extract: number of spaces after the tab shouldn't include the tab cell itselfDaniel Eklöf2025-10-11-2/+5
| | | | | | | | This fixes an off by one, where we sometimes "ate" an extra space when extracting contents with tabs. This happened if the tab (and its subsequent spaces) were followed by an additional space. Closes #2194
* config: add colors.dim-blend-towards=black|whiteDaniel Eklöf2025-10-10-4/+51
| | | | | | | | | | | | 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
* changelog: updated jump label colors in modus-operandiDaniel Eklöf2025-10-10-0/+2
|
* fix: jump labels are more readableMatthias Heyman2025-10-10-0/+2
|
* wayland: restore opacity after exiting fullscreenCharalampos Mitrodimas2025-10-10-1/+12
| | | | | | | | | | | | | | | | | | | | When exiting fullscreen mode, the window's transparency was not being restored, leaving it opaque until another window was fullscreened. This occurred because the Wayland opaque region was set based only on the configured alpha value, without considering the fullscreen state. Since commit 899b768b74 ("render: disable transparency when we're fullscreened") transparency is disabled during fullscreen to avoid compositor-mandated black backgrounds affecting the intended colors. However, the opaque region was not being updated when the fullscreen state changed. Fixes: https://codeberg.org/dnkl/foot/issues/2180 Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
* render: when double-buffering, pre-apply previous frame's damage earlyDaniel Eklöf2025-10-10-26/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* changelog: shm buffer stride alignmentDaniel Eklöf2025-10-05-0/+10
|
* doc: foot.ini: document tweak.min-stride-alignmentDaniel Eklöf2025-10-05-0/+26
|
* shm: page-align the memfd size (also needed for GPU direct import)Daniel Eklöf2025-10-05-4/+8
|
* config: add tweak.min-stride-alignmentDaniel Eklöf2025-10-05-1/+29
| | | | | | | | | | | | This allows the user to configure the value by which a surface buffer's stride must be an even multiple of. This can be used to ensure the stride meets the GPU driver's requirements for direct import. Defaults to 256. Set to 0 to disable. Closes #2182
* term: osc8: tag *all* cells in a multi-column character as an URIDaniel Eklöf2025-10-04-3/+12
| | | | | | | | | | | | | 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
* Revert "term: erase: use erase_line() whenever a range corresponds to a full line"Daniel Eklöf2025-10-04-8/+2
| | | | | | This reverts commit 44a674edb86f2f8db3304d76faf567346dcd7d94. It caused a regression with prompt markers, in at least fish+starship.
* term: erase: use erase_line() whenever a range corresponds to a full lineDaniel Eklöf2025-09-25-2/+8
|
* changelog: add new 'unreleased' sectionDaniel Eklöf2025-09-12-0/+11
|
* Merge branch 'releases/1.24'Daniel Eklöf2025-09-12-6/+7
|\
| * meson: bump version to 1.24.01.24.0releases/1.24Daniel Eklöf2025-09-12-1/+1
| |
| * changelog: prepare for 1.24.0Daniel Eklöf2025-09-12-5/+6
|/
* term: no need to pass ptmx as stdout to utempterDaniel Eklöf2025-09-09-2/+2
|
* meson: utempter del has no argumentDaniel Eklöf2025-09-09-2/+3
| | | | | This fixes an issue where we didn't record a logout record when using the libutempter backend.
* doc: foot.ini: typo: upppercase -> uppercaseDaniel Eklöf2025-08-31-1/+1
|