aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* meson: bump version to 1.22.01.22.0Daniel Eklöf2025-04-17-1/+1
|
* changelog: prepare for 1.22.0Daniel Eklöf2025-04-17-5/+11
|
* themes: add "Night Owl" themedatsudo2025-04-15-0/+30
|
* doc: foot.ini: add colors.alpha-modeDaniel Eklöf2025-04-14-0/+15
|
* tests: config: test colors.alpha-modeDaniel Eklöf2025-04-14-0/+5
|
* config+render: move alpha-mode to colors.alpha-mode, fix cursor handlingDaniel Eklöf2025-04-14-77/+73
| | | | | | | | | | Move main.alpha-mode to colors.alpha-mode. Fix (inverted) cursor handling, by always using the bg color without alpha. Do a minor optimization, where we don't even lock at colors.alpha-mode if there's no transparency configured.
* changelog: move 'alpha-mode' to next-releaseDaniel Eklöf2025-04-14-3/+5
|
* config: add alpha_mode optionFazzi2025-04-14-0/+38
|
* doc: foot.ini: workers: "if you have a ridiculous number of cores"Daniel Eklöf2025-04-14-0/+4
|
* url-mode: fix double-width characters not being handled correctlyDaniel Eklöf2025-04-13-2/+9
| | | | | | | | | When a regex matches a string containing double-width characters, the CELL_SPACER values were included in the URL string. This meant the final URL (either launched, or copied) weren't handled correctly, as invalid UTF-8 sequences were inserted in the middle of the string. Closes #2027
* changelog: move vmod support in config from "changed" to "added"Daniel Eklöf2025-04-10-4/+4
|
* wayland+input: add support for toplevel edge constraintsDaniel Eklöf2025-04-07-30/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* wayland: handle xdg-shell edge constraintsDominique Martinet2025-04-07-0/+6
| | | | | | | | | | | | | | | | | | | wayland-protocols commit 86750c99ed06 ("xdg-shell: Add edge constraints") added a few more enums to handle, making the build fail with -Werror: ../wayland.c: In function ‘xdg_toplevel_configure’: ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT’ not handled in switch [-Werror=switch] 878 | switch (*state) { | ^~~~~~ ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT’ not handled in switch [-Werror=switch] ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_TOP’ not handled in switch [-Werror=switch] ../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM’ not handled in switch [-Werror=switch] (This is not part of any release yet, but can be used when building with the submodule) From a quick look it sounds like the meaning is the same as tiling as far as we are concerned so handle these as we do of tiling.
* xkbcommon: require libxkbcommon >= 1.8.0Dominique Martinet2025-04-07-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to build with an older libxkbcommon fails as follow: ``` ../input.c: In function ‘keyboard_keymap’: ../input.c:648:82: error: ‘XKB_VMOD_NAME_ALT’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_ALT’? 648 | xkb_mod_index_t alt = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_ALT); | ^~~~~~~~~~~~~~~~~ | XKB_MOD_NAME_ALT ../input.c:648:82: note: each undeclared identifier is reported only once for each function it appears in ../input.c:649:83: error: ‘XKB_VMOD_NAME_META’ undeclared (first use in this function); did you mean XKB_MOD_NAME_ALT’? 649 | xkb_mod_index_t meta = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_META); | ^~~~~~~~~~~~~~~~~~ | XKB_MOD_NAME_ALT ../input.c:650:84: error: ‘XKB_VMOD_NAME_SUPER’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_NUM’? 650 | xkb_mod_index_t super = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_SUPER); | ^~~~~~~~~~~~~~~~~~~ | XKB_MOD_NAME_NUM ../input.c:651:84: error: ‘XKB_VMOD_NAME_HYPER’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_CAPS’? 651 | xkb_mod_index_t hyper = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_HYPER); | ^~~~~~~~~~~~~~~~~~~ | XKB_MOD_NAME_CAPS ../input.c:652:87: error: ‘XKB_VMOD_NAME_NUM’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_NUM’? 652 | xkb_mod_index_t num_lock = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_NUM); | ^~~~~~~~~~~~~~~~~ | XKB_MOD_NAME_NUM ../input.c:653:90: error: ‘XKB_VMOD_NAME_SCROLL’ undeclared (first use in this function); did you mean ‘XKB_LED_NAME_SCROLL’? 653 | xkb_mod_index_t scroll_lock = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_SCROLL); | ^~~~~~~~~~~~~~~~~~~~ | XKB_LED_NAME_SCROLL ../input.c:654:90: error: ‘XKB_VMOD_NAME_LEVEL3’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_CTRL’? 654 | xkb_mod_index_t level_three = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_LEVEL3); | ^~~~~~~~~~~~~~~~~~~~ | XKB_MOD_NAME_CTRL ../input.c:655:89: error: ‘XKB_VMOD_NAME_LEVEL5’ undeclared (first use in this function); did you mean ‘XKB_MOD_NAME_CTRL’? 655 | xkb_mod_index_t level_five = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, XKB_VMOD_NAME_LEVEL5); | ^~~~~~~~~~~~~~~~~~~~ | XKB_MOD_NAME_CTRL ```
* Themes: Add 'Molokai' themeŁukasz Wojniłowicz2025-04-07-0/+23
|
* config: update default URL regexDaniel Eklöf2025-04-07-33/+45
| | | | | | | | | | | | | | | | | | | The old one is in some cases too liberal. The new one is stricter in two ways: 1. The protocol list is now explicit, rather than matching anything:// 2. Allowed characters are now limited to the "safe character set", the "reserved character set", and some from the "unsafe character set" Furthermore, some of the characters are restricted in how/when they are allowed: 1. Periods, commas, question marks etc are allowed inside an URL, but not at the end. 2. [ ], ( ), " " and ' ' are allowed but only when balanced. This allows us to match e.g. [http://foo.bar/foo[bar]] correctly. Closes #2016
* Merge branch 'kbd-no-virtual-modifiers'Daniel Eklöf2025-03-31-8/+151
|\ | | | | | | Closes #2009
| * changelog: reword, and remove section that no longer appliesDaniel Eklöf2025-03-31-7/+2
| |
| * doc: foot.ini: mention virtual modifiers are allowedDaniel Eklöf2025-03-31-1/+2
| |
| * key-binding: recognize virtual modifiers, and translate to the corresponding real modifier.Daniel Eklöf2025-03-31-9/+90
| |
| * input: xkb: ignore virtual modifiersDaniel Eklöf2025-03-31-0/+66
|/ | | | | | | | | | | | | | | | | | | | | | | | 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
* grid: reflow: fix empty line coalescingDaniel Eklöf2025-03-29-4/+5
| | | | | | | If a range of empty lines ended with a non-empty line at the very bottom of the to-be-resized grid, all those empty lines were removed. Closes #2011
* meson: add foot (render.c) -> srgb.h depAlex Xu (Hello71)2025-03-26-1/+2
| | | | | | | otherwise, depending on ninja dependency resolution order and parallel build, srgb.h may not be built in time Fixes: ccf625b991 ("render: gamma-correct blending")
* doc: foot.ini: gamma-correct: move sectionDaniel Eklöf2025-03-23-5/+5
|
* render: dim and brighten using linear rgb interpolationSam McCall2025-03-23-66/+51
| | | | | | Adds setting tweak.dim-amount, similar to bold-text-in-bright-amount. Closes #2006
* changelog: url-mode: show-urls-persistent regression fixDaniel Eklöf2025-03-20-0/+7
|
* url-mode: fix crash when opening multiple urls with persist modellyyr2025-03-20-2/+0
| | | | | Fixes: 051cd6ecfc8b98e1d80b399ebea40207fe040750 Closes #2000
* vt: utf8: insert a REPLACEMENT CHARACTER when an invalid UTF-8 sequence is detectedDaniel Eklöf2025-03-18-6/+6
|
* vt: utf8: don't discard current byte when an invalid UTF-8 sequence is detectedDaniel Eklöf2025-03-18-6/+10
| | | | | | | | | | | | | | | | Example: printf "pok\xe9mon\n" would result in 'pokon' - the 'm' has been discarded along with E9. While correct, in some sense, it's perhaps not intuitive. This patch changes the VT parser to instead discard everything up to the invalid byte, but then try the invalid byte from the ground state. This way, invalid UTF-8 sequences followed by both plain ASCII, or longer (and valid) UTF-8 sequences are printed as expected instead of being discarded.
* changelog: add new 'unreleased' sectionDaniel Eklöf2025-03-17-0/+11
|
* Merge branch 'releases/1.21'Daniel Eklöf2025-03-17-5/+14
|\
| * doc: foot.ini: codespell: shouuld -> should1.21.0releases/1.21Daniel Eklöf2025-03-17-1/+1
| |
| * meson: bump version to 1.21.0Daniel Eklöf2025-03-17-1/+1
| |
| * changelog: prepare for 1.21.0Daniel Eklöf2025-03-17-4/+13
| |
* | doc: foot.ini: codespell: shouuld -> shouldDaniel Eklöf2025-03-17-1/+1
|/
* config: remove deprecated options 'notify' and 'notify-focus-inhibit'Daniel Eklöf2025-03-17-27/+2
| | | | They've been deprecated since 1.18.0
* doc: foot.init: surface-bit-depth: mention 10-bit surfaces are slowDaniel Eklöf2025-03-17-0/+3
|
* ime: fix initial cursor rectangle being reported as 0,0,0,0Daniel Eklöf2025-03-17-0/+13
| | | | Closes #1994
* main/client: simplify code for printing --version stringCraig Barnes2025-03-14-68/+42
|
* meson: require wayland-protocols >= 1.41Daniel Eklöf2025-03-13-139/+10
|
* meson: require fcft-3.3.1Daniel Eklöf2025-03-13-2/+2
| | | | fcft-3.3.0 is not binary compatible with 3.2.x, and earlier.
* changelog: mention some of the side-effects the new fcft requirement bringsDaniel Eklöf2025-03-12-0/+3
|
* fcft: require fcft >= 3.3.0, add support for new scaling-filtersDaniel Eklöf2025-03-12-6/+12
| | | | | | | | 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.
* input: kitty: unittest: don't fail if system has no compose tablesDaniel Eklöf2025-03-11-2/+6
|
* changelog: kitty: release events for composed keysDaniel Eklöf2025-03-11-0/+2
|
* input: kitty: send release events for composed keysDaniel Eklöf2025-03-11-3/+0
|
* input: kitty: regression test for #1987Daniel Eklöf2025-03-11-0/+97
|
* input: kitty: always use shifted key when it's the result of a composeDaniel Eklöf2025-03-10-1/+1
| | | | Closes #1987
* grid: set linebreak=false when printing to a line, not when allocating itDaniel Eklöf2025-03-05-9/+11
| | | | | | | | | | | This ensures empty lines are treated correctly, and is also more in line with how lines are handled at runtime, when filling the scrollback. For now, set linebreak=false as soon as something is printed on a line. It will remain like that *until* we reach the end of an old row with linebreak=true, at which point we set linebreak=true on the current new line.
* grid: change default value of linebreak to trueDaniel Eklöf2025-03-05-27/+60
| | | | | | | | | | | | | | | | | | 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.
* term: tweak linebreakingDaniel Eklöf2025-03-05-1/+6
| | | | | | | | | Don't set linebreak on linefeed. Instead, rely on the default value of true, and that it is only cleared when a character is printed while LCF=1. Note that printing to a row that has linebreak cleared, will set the linebreak flag again.
* render: gamma-correct blendingDaniel Eklöf2025-03-05-101/+746
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements gamma-correct blending, which mainly affects font rendering. The implementation requires compile-time availability of the new color-management protocol (available in wayland-protocols >= 1.41), and run-time support for the same in the compositor (specifically, the EXT_LINEAR TF function and sRGB primaries). How it works: all colors are decoded from sRGB to linear (using a lookup table, generated in the exact same way pixman generates it's internal conversion tables) before being used by pixman. The resulting image buffer is thus in decoded/linear format. We use the color-management protocol to inform the compositor of this, by tagging the wayland surfaces with the 'ext_linear' image attribute. Sixes: all colors are sRGB internally, and decoded to linear before being used in any sixels. Thus, the image buffers will contain linear colors. This is important, since otherwise there would be a decode/encode penalty every time a sixel is blended to the grid. Emojis: we require fcft >= 3.2, which adds support for sRGB decoding color glyphs. Meaning, the emoji pixman surfaces can be blended directly to the grid, just like sixels. Gamma-correct blending is enabled by default *when the compositor supports it*. There's a new option to explicitly enable/disable it: gamma-correct-blending=no|yes. If set to 'yes', and the compositor does not implement the required color-management features, warning logs are emitted. There's a loss of precision when storing linear pixels in 8-bit channels. For this reason, this patch also adds supports for 10-bit surfaces. For now, this is disabled by default since such surfaces only have 2 bits for alpha. It can be enabled with tweak.surface-bit-depth=10-bit. Perhaps, in the future, we can enable it by default if: * gamma-correct blending is enabled * the user has not enabled a transparent background
* config: add search-bindings.delete-to-{start,end} key bindingsAdrian fxj9a2025-03-05-0/+47
| | | | | | Defaults to ctrl+u and ctrl+k respectively. Closes #1972
* term: reset the grapheme clustering state on cursor movementsDaniel Eklöf2025-03-04-0/+8
|
* shm-format: add new shm formatsDaniel Eklöf2025-03-02-0/+17
|
* DECSCUSR+DECRQSS: treat hollow cursor as a block cursorDaniel Eklöf2025-02-21-1/+3
| | | | | | | | | | | | | | | If the user has configured cursor.style=hollow, make DECSCUSR 1/2 set the cursor to hollow rather than block, and make DECRQSS DECSCUSR respond as if cursor.style=block. The idea is to not expose the hollow variant in DECSCUSR in any way, to avoid having to extend it with custom encodings. Another way to think about it is this is just a slightly more discoverable way of doing: cursor.style=block cursor.block-cursor-is-hollow=yes
* config+render: allow cursor.style=hollowDaniel Eklöf2025-02-19-4/+11
| | | | Closes #1965
* terminal: add comment/link to cursor::lcf, to clarify its purposeCraig Barnes2025-02-18-1/+1
|
* term: set_app_id(): app_id may be NULL, in which case we can't do strlen()Daniel Eklöf2025-02-18-1/+4
| | | | Closes #1963
* changelog: --server=FD failing on FreeBSDDaniel Eklöf2025-02-16-0/+2
|
* server: fix --server=<fd> on OSes returning SO_ACCEPTCONN > 1Guillaume Outters2025-02-16-1/+6
| | | | Closes #1956
* term: append zero-width grapheme breaking characters to previous cellDaniel Eklöf2025-02-16-1/+5
| | | | | | | | | | | | | | | | | | When compiled with grapheme clustering support, zero-width characters that also are grapheme breaks, were ignored (not stored in the grid). When utf8proc says the character is a grapheme break, we try to print the character to the current cell. But this is only done when width > 0. As a result, zero width grapheme breaks were simply discarded. This only happens when grapheme clustering is enabled; when disabled, all zero width characters are appended. Fix this by also requiring the width to be non-zero when if we should append the character or not. Closes #1960
* doc: foot.ini: font: add one more fontfeatures exampleDaniel Eklöf2025-02-16-0/+7
| | | | | | | | Add a fontfeatures example where we: * set multiple features * assign a value to the features (as opposed to just enabling a boolean feature)
* grid: reflow: fix cursor reflow when LCF is setDaniel Eklöf2025-02-13-3/+17
| | | | | | | | | | When the cursor is at the end of the line, with a pending wrap (LCF set), the lcf flag should be cleared *and* the cursor moved one cell to the right. Before this patch, we cleared LCF, but didn't move the cursor. Closes #1954
* themes: update Tokyo Night LightLudovico Gerardi2025-02-13-21/+26
|
* grid: reflow: shell integration: no need to check for >= 0Daniel Eklöf2025-02-10-8/+2
|
* render: minimum window size: 2 cols -> 1 colDaniel Eklöf2025-02-10-1/+1
|
* grid: reflow: don't special case the first cell in a multi-column characterDaniel Eklöf2025-02-10-54/+56
| | | | | | | | Wrap *all* cell copying logic in a for-loop for the characters width. This _should_, in theory, mean reflow of e.g. cursor coordinates in the middle of a multi-column character works correctly. Also fix reflow of cmd start/end integration.
* grid: performance: check for non-NULL before comparing with terminatorDaniel Eklöf2025-02-10-2/+2
| | | | | This should be slightly faster in the normal(?) case (no styled underlines or OSC-8).
* grid: refactor reflowDaniel Eklöf2025-02-10-151/+88
| | | | | | | | | | | | We've been trying to performance optimize reflow by "chunking" cells; try to gather as many as possible, and memcpy a chunk at once. The problem is that a) this quickly becomes very complex, and b) is very hard to get right for multi-column characters, especially when we need to truncate long ones due to the window being too small. Refactor, and once again walk and copy all cells one by one. This is slower, but at least it's correct.
* url-mode: regex: don't try to NULL-terminate an invalid vlineDaniel Eklöf2025-02-10-1/+4
|
* doc: foot.ini: fix 'hashes' regex exampleDaniel Eklöf2025-02-10-2/+2
| | | | It's A-F, not A-f
* forgejo: better names for templatesDaniel Eklöf2025-02-10-0/+0
|
* grid: pull in misc.h when TIME_REFLOW is definedDaniel Eklöf2025-02-10-0/+4
|
* url-mode: terminate last virtual line before regex matchingDaniel Eklöf2025-02-10-1/+5
| | | | | If the last line doesn't have a hard linebreak, it was never NULL terminated, causing regexec() to crash on an out-of-bounds access.
* Fix URL detection regression on lines with NUL bytesJohannes Altmanninger2025-02-10-1/+2
| | | | | | | | | | | | Commit 859b4c89 (url-mode: wip: more work on regex matching, 2025-01-30) regressed URL detection in weechat. Some of the URLs still work but others don't. This is because regexec() stops at the first NUL, thus skipping the rest of the line. weechat seems create NUL cells between their UI widgets. Work around this by replacing NUL with space. This is probably correct because selecting and copying those cells also translates to space (not sure where in the code).
* config: regex: fix invalid freeDaniel Eklöf2025-02-10-1/+1
| | | | | | | | | Zero-initialize the 'launch' spawn template before calling value_to_spawn_template(). This is needed since value_to_spawn_template() tries to free the old value before assigning the new one. Closes #1951
* Merge branch 'text-width-protocol'Daniel Eklöf2025-02-06-333/+514
|\
| * changelog: text-sizing protocolDaniel Eklöf2025-02-06-1/+2
| |
| * render: resize: note why min_cols=7Daniel Eklöf2025-02-06-1/+1
| |
| * grid: reflow: get number of spacers to insert from the old gridDaniel Eklöf2025-02-06-1/+1
| | | | | | | | | | | | | | | | When checking if we're breaking in the middle of a multi-column character, we counted spacers starting from the break point. But, the character may be wider than that. Use the fact that the spacers cells encode how many *more* there are after them; when we get to the first one, we know exactly how wide the character is.
| * term: print-non-ascii: propagate existing forced-widthDaniel Eklöf2025-02-06-2/+2
| | | | | | | | | | | | | | | | | | | | | | When appending to an existing composed character, "inherit" its forced width, if set. Also make sure to actually _use_ the forced width, if set, rather than the calculated width. This fixes an issue when appending zero-width codepoints to a forced-width combining character.
| * osc: text-size: disable optimizationDaniel Eklöf2025-02-06-0/+2
| | | | | | | | | | | | The optimization prevents the forced-width to be set on the new combining character, causing issues when followed by more zero-width codepoints.
| * doc: ctlseq: add OSC 66 (kitty text sizing)Daniel Eklöf2025-02-06-1/+4
| |
| * composed: codespell: infinitelyDaniel Eklöf2025-02-06-1/+1
| |
| * osc: text-sizing: implement w=0, plus optimize single-codepoint casesDaniel Eklöf2025-02-06-4/+51
| | | | | | | | | | | | | | | | | | | | If there's a single codepoint in the text portion of the OSC sequence, and its calculated width matches the forced width, print it directly to the grid instead of emitting a combining character. When w=0, we split up the text string "as we normally would". Since we don't support any other text-sizing parameters, this means simply printing each codepoint to the grid.
| * term+vt: refactor: move "utf8" char processing to term_process_and_print_non_ascii()Daniel Eklöf2025-02-06-251/+261
| | | | | | | | | | | | | | | | | | | | | | This function "prints" any non-ascii character (i.e. any character that ends up in the action_utf8_print() function in vt.c) to the grid. This includes grapheme cluster processing etc. action_utf8_print() now simply calls this function. This allows us to re-use the same functionality from other places (like the text-sizing protocol).
| * osc: wip: kitty text size protocolDaniel Eklöf2025-02-06-14/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings initial support for the new kitty text-sizing protocol. Note hat only the width-parameter ('w') is supported. That is, no font scaling, and no multi-line cells. For now, only explicit widths are supported. That is, w=0 does not yet work. There are a couple of changes to the renderer, to handle e.g. OSC 66 ; w=6 ; foobar ST There are two ways this can get rendered, depending on whether grapheme shaping has been enabled. We either shape it, and get an array of glyphs back that we render. Or, we rasterize each codepoint ourselves, and render each resulting glyph. The two cases ends up in two different renderer loops, that worked somewhat different. In particular, the first case has probably never been tested/used at all... With this patch, both are changed, and now uses some heuristic to differentiate between multi-cell text strings (like in the example above), or single-cell combining characters. The difference is mainly in which offset to use for the secondary glyphs. In a multi-cell string, each glyph is mapped to its own cell, while in the combining case, we try to map all glyphs to the same cell.
| * grid: reflow: handle composed characters longer than 2 cellsDaniel Eklöf2025-02-06-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic that tries to ensure we don't break a line in the middle of a multi-cell character was flawed when the number of cells were larger than 2. In particular, if the number of cells to copy were limited by the number of cells left on the current (new) line, and were less than the length of the multi-cell character, then we failed to insert the correct number of spacers, and also ended up misplacing the multi-cell character; instead of pushing it to the next line, it was inserted on the current line, even though it doesn't fit. Also change how trailing SPACER cells are rendered (cells that are "fillers" at then end of a line, when a multi-column character was pushed over to the next line): don't copy the previous cell's attributes (which may be wrong anyway), use default attributes instead.
| * composed: refactor: break out lookup with collision detectionDaniel Eklöf2025-02-06-53/+54
| |
| * composed: re-factor: break out key calculation from vt.cDaniel Eklöf2025-02-06-22/+51
|/
* term: insert-mode: handle combining characters correctlyDaniel Eklöf2025-02-06-6/+14
| | | | | | | | | | | | | | | | | When the client application emits combining characters, for example multi-codepoint emojis, in insert-mode, we ended up pushing partial graphemes to the right, for each codepoint, resulting in too many cells (and with the wrong content) being inserted. The fix is fairly simple; don't "insert" when appending characters to an existing grapheme cluster. This isn't something we can detect easily in print_insert() (it would require us to do grapheme clustering again). Fortunately, we do have the required information in action_utf8_print(). So, pass this information as a boolean to term_print(). Closes #1947
* Merge branch 'regex-mode'Daniel Eklöf2025-02-05-413/+593
|\ | | | | | | | | Closes #1386 Closes #1872
| * changelog: custom regex'sDaniel Eklöf2025-02-05-0/+5
| |
| * doc: regex: custom regex's aren't URLsDaniel Eklöf2025-02-05-4/+4
| |
| * doc: improve regex exampleDaniel Eklöf2025-02-05-10/+11
| |
| * spawn template variables are on the form ${}, not {}Daniel Eklöf2025-02-05-3/+3
| |
| * url-mode: use the first *sub* expression as URLDaniel Eklöf2025-02-05-28/+51
| | | | | | | | | | | | | | | | When auto-matching URLs (or custom regular expressions), use the first *subexpression* as URL, rather than the while regex match. This allows us to write custom regular expressions with prefix/suffix strings that should not be included in the presented match.
| * config: remove debug loggingDaniel Eklöf2025-02-05-2/+0
| |
| * tests: config: handle regex key bindingsDaniel Eklöf2025-02-05-8/+28
| |