aboutsummaryrefslogtreecommitdiff
path: root/config.c (unfollow)
Commit message (Collapse)AuthorLines
2026-09-02config: remove support for the deprecated color-theme-switch-{1,2} key bindingsDaniel Eklöf-25/+0
They were deprecated in 1.26.0, along with the 'colors' and 'colors2' sections.
2026-09-02config: remove support for the deprecated colors and colors2 sectionsDaniel Eklöf-70/+2
They were deprecated in 1.26.0, and replaced by colors-dark and colors-light.
2026-09-02config: remove debug printf from unit testDaniel Eklöf-2/+0
2026-09-02config: add unit test for modifiers_disjoint()Daniel Eklöf-1/+77
2026-09-02config: fix modifiers conflict checkCismonX-1/+19
Currently, if a mouse binding contains _any_ modifier key set in config 'selection-override-modifiers', it does not work since these modifiers get unset in function 'match_mouse_binding()'. Function 'resolve_key_binding_collisions()' is supposed to detect this and display an error message, however, it does not work unless the conflicting modifiers are identical. For example, given the following config options: selection-override-modifiers=Control+Shift select-begin-block=Control+BTN_LEFT Foot does not display an error message for this, but if you try to select text with 'Control+BTN_LEFT', it behaves as if only 'BTN_LEFT' is pressed. This is due to function 'modifiers_disjoint()' being implemented as "not equal" rather than "disjoint". Fixed by properly implementing this function. Also clarify the 'selection-override-modifiers' config option in the man page. As a side effect, this also fixes 'selection-override-modifiers=none' conflicting with mouse bindings that do not contain modifier keys (an empty set is disjoint with itself).
2026-08-30config: fix error message for modifiers conflictCismonX-3/+0
The trailing '+' is already removed in modifiers_to_str(). Don't do that twice.
2026-07-26config: add unit test for default URL regexDaniel Eklöf-0/+137
2026-07-26config: update default URL regexDaniel Eklöf-42/+43
* Allow single-quotes _inside_ URLs (but still not at the end) * Require at least one character inside balanced parenthesis or quotes. Closes #2417
2026-06-24config: font_parse(): handle font family names with \-:,Daniel Eklöf-1/+19
These characters have special meaning, and when they appear in the font *family name*, they need to be escaped in the font pattern. Before this patch, even if the user did escape them properly, _we_ un-escaped them in FcNameUnparse(), causing the wrong font to be loaded later.
2026-04-06config: add url.style=none|single|double|curly|dotted|dashedDaniel Eklöf-0/+9
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
2026-03-02Add support for background blurDaniel Eklöf-0/+4
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.
2026-03-02Spawning new terminal with --config from parent instanceStéphane Klein-0/+3
Reference: https://codeberg.org/dnkl/foot/issues/1622 Signed-off-by: Stéphane Klein <contact@stephane-klein.info>
2026-03-02support four-sided padding (left/top/right/bottom)pi66-11/+30
2025-12-20config: remove deprecated config option cursor.colorDaniel Eklöf-22/+0
This option was deprecated in 1.23.0. Use colors-{dark,light}.cursor instead.
2025-12-20config: add [colors-dark] and [colors-light], replacing [colors] and [colors2]Daniel Eklöf-17/+111
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...)
2025-11-12config: add toplevel-tag=TAGDaniel Eklöf-0/+6
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
2025-10-10config: add colors.dim-blend-towards=black|whiteDaniel Eklöf-1/+14
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
2025-10-10render: when double-buffering, pre-apply previous frame's damage earlyDaniel Eklöf-2/+5
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
2025-10-05config: add tweak.min-stride-alignmentDaniel Eklöf-0/+5
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
2025-08-31config: add 'uppercase-regex-insert'Ryan Roden-Corrent-0/+4
This makes the "uppercase hint character inserts selected text" behavior added in #1975 configurable, as it can have unexpected behavior for some users. It defaults to "on", preserving the new behavior of `foot`, after Fixes #2159.
2025-08-25config: value_to_*(): don't overwrite result variable on errorDaniel Eklöf-6/+14
Some of the value_to_*() functions wrote directly to the output variable, even when the value was invalid. This often resulted in the an actual configuration option (i.e. a member in the config struct) to be overwritten by an invalid value. For example, -o initial-color-theme=0 would set conf->initial_color_theme to -1, resulting in a crash later, when initializing a terminal instance.
2025-07-11config: silence valgrind-detected leak in config_font_parse()Daniel Eklöf-1/+3
2025-05-24conf: pad: add center-when-fullscreen and center-when-maximized-and-fullscreenDaniel Eklöf-7/+21
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
2025-05-05render: refactor to allow setting only selection bg or fgDaniel Eklöf-5/+0
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
2025-05-03config: tweak.surface-bit-depth: add support for 16-bit surfacesDaniel Eklöf-1/+8
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.
2025-05-01config: tweak.surface-bit-depth now defaults to 'auto'Daniel Eklöf-2/+2
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
2025-05-01config: gamma-correct-blending: disable by defaultDaniel Eklöf-12/+3
2025-05-01config: tweak.surface-bit-depth now defaults to 'auto'Daniel Eklöf-2/+2
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
2025-05-01config: gamma-correct-blending: disable by defaultDaniel Eklöf-12/+3
2025-04-27config: parse_color_theme(): make NOINLINEDaniel Eklöf-1/+1
2025-04-26config: add initial-color-theme=1|2Daniel Eklöf-1/+10
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.
2025-04-26key-bindings: add bindings to switch between color themesDaniel Eklöf-0/+4
* 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
2025-04-26config: add new section 'colors2'Daniel Eklöf-0/+8
This section defines an alternative color theme. The keys are the same as in the 'colors' section, as are the default values. Values are *not* inherited from 'colors'. That is, if you set a value in 'colors', but not in 'colors2', it is *not* inherited by 'colors2'.
2025-04-26config: refactor: break out color theme parsing to a separate functionDaniel Eklöf-38/+41
2025-04-26config: move cursor.color to colors.cursorDaniel Eklöf-10/+31
2025-04-14config+render: move alpha-mode to colors.alpha-mode, fix cursor handlingDaniel Eklöf-10/+10
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.
2025-04-14config: add alpha_mode optionFazzi-0/+10
2025-04-07config: update default URL regexDaniel Eklöf-31/+38
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
2025-03-23render: dim and brighten using linear rgb interpolationSam McCall-0/+4
Adds setting tweak.dim-amount, similar to bold-text-in-bright-amount. Closes #2006
2025-03-17config: remove deprecated options 'notify' and 'notify-focus-inhibit'Daniel Eklöf-24/+0
They've been deprecated since 1.18.0
2025-03-13meson: require wayland-protocols >= 1.41Daniel Eklöf-14/+0
2025-03-12fcft: require fcft >= 3.3.0, add support for new scaling-filtersDaniel Eklöf-0/+7
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.
2025-03-05render: gamma-correct blendingDaniel Eklöf-0/+38
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
2025-03-05config: add search-bindings.delete-to-{start,end} key bindingsAdrian fxj9a-0/+4
Defaults to ctrl+u and ctrl+k respectively. Closes #1972
2025-02-19config+render: allow cursor.style=hollowDaniel Eklöf-1/+1
Closes #1965
2025-02-10config: regex: fix invalid freeDaniel Eklöf-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
2025-02-05url-mode: use the first *sub* expression as URLDaniel Eklöf-20/+36
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.
2025-02-05config: remove debug loggingDaniel Eklöf-2/+0
2025-02-05config+url: add support for user-defined regex patternsDaniel Eklöf-32/+231
Users can now define their own regex patterns, and use them via key bindings: [regex:foo] regex=foo(bar)? launch=path-to-script-or-application {match} [key-bindings] regex-launch=[foo] Control+Shift+q regex-copy=[foo] Control+Mod1+Shift+q That is, add a section called 'regex:', followed by an identifier. Define a regex and a launcher command line. Add a key-binding, regex-launch and/or regex-copy (similar to show-urls-launch and show-urls-copy), and connect them to the regex with the "[regex-name]" syntax (similar to how the pipe-* bindings work).
2025-02-05foot.ini+doc: add default value of url.regexDaniel Eklöf-0/+1
2025-02-05url-mode+config: wip: add url.regex optionDaniel Eklöf-0/+60
2025-02-05config: remove url.{uri-characters,protocols}Daniel Eklöf-111/+0
2025-01-31key-bindings: add keypad variants to existing default key-bindingsDaniel Eklöf-0/+5
2025-01-27config: fix memory leak on e.g. "not a valid XKB key name" errorsDaniel Eklöf-5/+4
2025-01-24config: check for FcNameUnparse() failureDaniel Eklöf-0/+5
2025-01-18Revert "config: don't allow colors.flash-alpha to be 1.0"Alexander Orzechowski-2/+2
This reverts commit 56d2c3e990509d18de31e6009e0d0c6254f99b67.
2025-01-17Add support for the new Wayland protocol xdg-system-bellDaniel Eklöf-0/+3
From the release notes: system bell - allowing e.g. terminal emulators to hand off system bell alerts to the compositor for among other things accessibility purposes The new protocol is used when the new config option bell.system=yes (and the compositor implements the protocol, obviously). The system bell is rung independent of whether the foot window has keyboard focus or not (thus relying on compositor configuration to determine whether anything should be done or not in response to the bell). The new option is enabled by default.
2025-01-09Revert "config: don't allow colors.flash-alpha to be 1.0"Alexander Orzechowski-2/+2
This reverts commit 56d2c3e990509d18de31e6009e0d0c6254f99b67.
2025-01-02config: don't allow colors.flash-alpha to be 1.0Daniel Eklöf-2/+2
A compositor will not send a frame callback for our main window if it is fully occluded (for example, by a fully opaque overlay...). This causes the overlay to stuck. For regular buffers, it _should_ be enough to *not* hint the compositor it's opaque. But at least some compositor special cases single-pixel buffers, and actually look at their pixel value. Thus, we have two options: implement frame callback handling for the overlay sub-surface, or ensure we don't use a fully opaque surface. Since no overlays are fully opaque by default, and the flash surface is the only one that can be configured to be opaque (colors.flash-alpha), and since adding frame callback handling adds a lot of boilerplate code... let's go with the simpler solution of
2024-12-22osc: add option to disable OSC-52, partially or fullyDaniel Eklöf-0/+24
Closes #1867
2024-10-23config: add color.sixelN optionsDaniel Eklöf-0/+29
These options allows you to configure the default sixel color palette.
2024-08-26add setting for strikeout thicknessOleh Hushchenkov-0/+4
2024-08-20feature: add resize-keep-grid to allow text reflow on font changesAndrew J. Hesford-0/+4
2024-08-04osc: kitty notifications: add support for XDG sound namesDaniel Eklöf-1/+1
2024-08-04osc: kitty notifications: implement s=silentDaniel Eklöf-1/+1
This implements part of the new 's' (sound) parameter; the 'silent' value. When s=silent, we set the ${muted} template argument to "true". It is intended to set the 'suppress-sound' hint: notify-send --hint BOOLEAN:suppress-sound:${muted}
2024-08-03xmalloc: remove delim param from xstrjoin() and add separate xstrjoin3()Craig Barnes-5/+5
This avoids the need for an unused third argument for most xstrjoin() calls and replaces the cases where it's needed with a more flexible function. Code generation is the same in both cases, when there are 2 string params and a compile-time known delimiter. This commit also converts 4 uses of xasprintf() to use xstrjoin*(). See also: https://godbolt.org/z/xsjrhv9b6
2024-08-02osc: kitty notifications: cleanup and update to latest version of specDaniel Eklöf-6/+6
* Don't store a list of unfinished notifications. Use a single one. If the notification ID of the 'current' notification doesn't match the previous, unfinished one, the 'current' notification replaces the previous one, instead of updating it. * Update xstrjoin() to take an optional delimiter (for example ','), and use that when joining categories and 'alive IDs'. * Rename ${action-arg} to ${action-argument} * Update handling of the 'n' parameter (symbolic icon name); the spec allows it to be used multiple times, and the terminal is supposed to pick the first one it can resolve. Foot can't resolve icons at all, neither can 'notify-send' or 'fyi' (which is what foot typically executes to display a notification); it's the notification daemon that resolves icons. The spec _could_ be interpreted to mean the terminal should lookup .desktop files, and use the value of the 'Icon' key from the first matching .desktop files. But foot doesn't read .desktop files, and I don't intend to implement XDG directory scanning and parsing of .desktop files just to figure out which icon to use. Instead, use a simple heuristics; use the *shortest* symbolic names. The idea is pretty simple: plain icon names are typically shorter than .desktop file IDs.
2024-07-31osc: kitty notifications: buttons, icons, app-name, categories etcDaniel Eklöf-1/+16
First, icons have been finalized in the specification. There were only three things we needed to adjust: * symbolic names are base64 encoded * there are a couple of OSC-99 defined symbolic names that need to be translated to the corresponding XDG icon name. * allow in-band icons without a cache ID (that is, allow applications to use p=icon without having to cache the icon first). Second, add support for the following new additions to the protocol: * 'f': custom app-name, overrides the terminal's app-id * 't': categories * 'p=alive': lets applications poll for currently active notifications * 'id' is now 'unset' by default, rather than "0" * 'w': expire time (i.e. notification timeout) * "buttons": aka actions. This lets applications add additional (to the terminal defined "default" action) actions. The 'activated' event has been updated to report which button/action was used to activate the notification. To support button/actions, desktop-notifications.command had to be reworked a bit. There's now a new config option: desktop-notifications.command-action-arg. It has two template arguments ${action-name} and ${action-label}. command-action-arg gets expanded for *each* action. ${action-name} and ${action-label} has been replaced by ${action-arg} in command. This is a somewhat special template, in that it gets replaced by *all* instances of the expanded actions.
2024-07-30notify: ${icon}: don't fallback to app-idDaniel Eklöf-1/+1
* Revert --icon to ${app-id} * Use --hint STRING:image-path:${icon} instead * ${icon} no longer expands to ${app-id} if notification has no icon
2024-07-25osc: kitty notifications: implement the 'close' requestDaniel Eklöf-0/+9
Add a new config option, desktop-notifications.close, defining what to execute to close a notification. It has a single template parameter, ${id}, that is expanded to the external notification ID foot may have picked up from the notification helper. notify-send does not support closing notifications, and it appears impossible to pass an *unsigned* integer as argument to gdbus. Hence no default value for the new 'close' option. Example: printf '\e]99;i=123;this is a notification\e\\' printf '\e]99;i=123:p=close;\e\\'
2024-07-24config: notify-send: it's "action=label", not "action,label"Daniel Eklöf-1/+1
2024-07-23notify: split up the ${action} template parameterDaniel Eklöf-1/+1
Split it up into two, ${action-name} and ${action-label}. Dunstify, for example, has a different syntax compared to notify-send: notify-send: default=foobar dunstify: default,foobar
2024-07-23notify: don't focus/report on notification dismissalDaniel Eklöf-1/+1
Only do it when the notification was activated. Here, activated means the 'click to activate' notification action was triggered. How do we tie everything together? First, we add a new template parameter, ${action}. It's intended to be used with e.g. notify-send's --action option. When the action is triggered, notify-send prints its name on stdout, on a separate line. Look for this in stdout. Only if we've seen it do we focus/report the notification.
2024-07-23osc: kitty notifications: implement focus|reportDaniel Eklöf-11/+52
This patch adds support for window focusing, and sending events back to the client application when a notification is closed. * Refactor notification related configuration options: - add desktop-notifications sub-section - deprecate 'notify' in favor of 'desktop-notifications.command' - deprecate 'notify-focus-inhibit' in favor of 'desktop-notifications.inhibit-when-focused' * Refactor: rename 'struct kitty_notification' to 'struct notification' * Pass a 'struct notification' to notify_notify(), instead of many arguments. * notify_notify() now registers a reaper callback. When the notifier process has terminated, the notification is considered closed, and we either try to focus (activate) the window, or send an event to the client application, depending on the notification setting. * For the window activation, we need an XDG activation token. For now, assume *everything* written on stdout is part of the token. * Refactor: remove much of the warnings from OSC-99; we don't typically log anything when an OSC/CSI has invalid values. * Add icon support to OSC-99. This isn't part of the upstream spec. Foot's implementation: - uses the 'I' parameter - the value is expected to be a symbolic icon name - a quick check for absolute paths is done, and such icon requests are ignored. * Added ${icon} to the 'desktop-notifications.command' template. Uses the icon specified in the notification, or ${app-id} if not set.
2024-07-23osc/notify: add support for OSC-99, kitty desktop notificationsDaniel Eklöf-2/+3
This adds limited support for OSC-99, kitty desktop notifications[^1]. We support everything defined by the "protocol", except: * 'a': action to perform on notification activation. Since we don't trigger the notification ourselves (over D-Bus), we don't know a) which ID the notification got, or b) when it is clicked. * ... and that's it. Everything else is supported To be explicit, we *do* support: * Chunked notifications (d=0|1), allowing the application to append data to a notification in chunks, before it's finally displayed. * Plain UTF-8, or base64-encoded UTF-8 payload (e=0|1). * Notification identifier (i=xyz). * Payload type (p=title|body). * When to honor the notification (o=always|unfocused|invisible), with the following quirks: - we don't know when the window is invisible, thus it's treated as 'unfocused'. - the foot option 'notify-focus-inhibit' overrides 'always' * Urgency (u=0|1|2) [^1]: https://sw.kovidgoyal.net/kitty/desktop-notifications/
2024-07-13input: don't map wheel events to BTN_{BACK,FORWARD}Daniel Eklöf-4/+11
BTN_BACK and BTN_FORWARD are separate buttons. The scroll wheel don't have any button mappings in libinput/wayland, so make up our own defines. This allows us to map them in mouse bindings. Also expose BTN_WHEEL_{LEFT,RIGHT}. These were already defined, and used, internally, to handle wheel tilt events. With this, they can also be used in mouse bindings. Finally, fix encoding used for BTN_{BACK,FORWARD} when sending mouse button events to the client application. Before this, they were mapped to buttons 4/5. But, button 4/5 are for the scroll wheel, and as mentioned above, BTN_{BACK,FORWARD} are not the same as scroll wheel "buttons". Closes #1763
2024-05-20config: add cursor.blink-rate optionDaniel Eklöf-2/+8
The default is 500ms, which corresponds to the old, hardcoded default. Closes #1707
2024-04-11config: add new key-binding 'quit', unbound by defaultDaniel Eklöf-0/+1
Closes #1475
2024-04-10config: add cursor.unfocused-styleDaniel Eklöf-0/+11
This option controls how we render the cursor when the terminal window is unfocused. Possible values are: * hollow: the default, and how we rendered the cursor before this patch. * unchanged: render the cursor exactly the same way as when the window is focused. * none: do not render any cursor at all Closes #1582
2024-03-17xmalloc: add xmemdup() and use to replace some uses of xmalloc+memcpyCraig Barnes-10/+5
2024-03-16main/config: replace some uses of xasprintf() with xstrjoin()Craig Barnes-4/+4
2024-02-24config: don't try to free key combos we haven't allocatedDaniel Eklöf-2/+4
When erroring out due to a key combo being "empty", we incorrectly tried to free one key binding. This is because 'used_combos' is initialized to '1'. And it should, but an empty key binding is a special case. Fixes a test failure, and closes #1620
2024-02-23config: on error, correctly free partially parsed key combosDaniel Eklöf-6/+4
2024-02-15config: map Control+wheel to font increase/decreaseDaniel Eklöf-0/+2
This is in addition to the already existing keyboard shortcuts. Also add missing default keyboard/mouse bindings to readme + foot(1).
2024-02-06Don't use fancy Unicode quotes, stick to ASCIIDaniel Eklöf-5/+5
2024-02-06config: add pipe-command-output key-bindingDaniel Eklöf-0/+1
2024-02-06input/config: support *all* modifier namesDaniel Eklöf-159/+204
That is, allow custom modifiers (i.e. other than ctrl/shift/alt etc) in key bindings. This is done by no longer validating/translating modifier names to booleans for a pre-configured set of modifiers (ctrl, shift, alt, super). Instead, we keep the modifier *names* in a list, in the key binding struct. When a keymap is loaded, and we "convert" the key binding, _then_ we do modifier translation. For invalid modifier names, we print an error, and then ignore it. I.e. we no longer fail to load a config due to invalid modifier names. We also need to update how we determine the set of significant modifiers. Any modifier not in this list will be ignored when matching key bindings. Before this patch, we hardcoded this to shift/alt/ctrl/super. Now, to handle custom modifiers as well, we simply treat *all* modifiers defined by the current layout as significant. Typically, the only unwanted modifiers are "locked" modifiers. We are already filtering these out.
2024-02-05feature: add resize-by-cells option to constrain window sizes...Andrew J. Hesford-0/+4
...to multiples of the cell size, and preserve grid size when changing fonts or display scales in floating windows.
2024-02-05util: add streq() function and use in place of strcmp(...) == 0Craig Barnes-110/+110
2024-01-25Replace unchecked allocations with calls to xmalloc.h functionsCraig Barnes-1/+1
2024-01-10config: fix cloning of env_vars tllistDaniel Eklöf-0/+2
When cloning a config struct, the env_vars tllist wasn't correctly copied. We did correctly iterate and duplicate all old entries, but we did *not* reset the list in the cloned struct before doing so. This meant the list contained entries shared with the original list, causing double free:s in --server mode.
2023-10-27config: reset conf file descriptor after closing file streamJan Palus-0/+1
conf file descriptor is closed once again during cleanup at the end of config_load() if descriptor >= 0. avoid double closing by assigning negative value to fd after first close. by the time second close happens some other descriptor might be opened reusing previous number ie it might happen during foot server startup when syslog message is logged between one close and the other. in this particular situation, as of this writing, it considers fd=3 for which following events apply: 1. conf file is opened and fclosed() 2. warning is logged with syslog which leads to opening socket to /dev/log which is kept open by glibc (gets fd=3) 3. second close during config_load() closes /dev/log socket descriptor 4. epoll_create() in fdm.c reuses fd=3 again 5. another message is being logged with syslog. glibc notices sendto() failure on saved /dev/log descriptor hence it closes it and opens new one Due to epoll descriptor closure foot starts a chain of errors that lead to startup failure. Fixes #1531
2023-10-26config: improve validation of color values, default alpha to 0xffDaniel Eklöf-6/+18
Reject color values that aren't in either RGB, or ARGB format. That is, color values that aren't hexadecimal numbers with either 6 or 8 digits. Also, if a color value is allowed to have an alpha component, and the user left it out, default to 0xff (opaque) rather than 0x00 (fully transparent). Closes #1526
2023-10-10Enable the use of flash as visual bellRaimund Sacherer-0/+21
With this patch we can configure flash in the bell section. The colors section allow now to configure the color and translucency of the flash.
2023-10-08config: log_contextual_errno(): sync with log_contextual()Daniel Eklöf-3/+12
... in terms of whether to print section/value separators
2023-10-08config: add remaining search.scrollback key bindingsDaniel Eklöf-2/+8
All scrollback up/down key bindings are now available in search mode.
2023-10-08config: map ctrl+shift+right to extend-to-word-boundaryDaniel Eklöf-1/+1
2023-10-08search: add more key bindings to extend the current matchDaniel Eklöf-5/+22
This patch adds the following new search key bindings: * extend-char (shift+right) * extend-line-down (shift+down) * extend-backward-char (shift+left) * extend-backward-to-word-boundary (ctrl+shift+left) * extend-backward-to-next-whitespace (ctrl+shift+alt+left) * extend-line-up (shift+up) They can be used to extend the search match (i.e. the selection). This patch also adds an initial set of key bindings to scroll in the scrollback history: * scrollback-up-page * scrollback-down-page These work just like the key bindings for the normal mode. Also note that it was already possible to scroll using the mouse. This patch also fixes a couple of search mode bugs: * crashing when a search match ends in the last column * grapheme clusters not being matched correctly * Search match not being "extendable" after a pointer leave event * A few others, related to either large matches, or extending matches after moving the viewport. There are still a couple of (known) issues: * A search match isn't correctly highlighted if its *starting* point is outside the viewport. * Extending the match to end of the scrollback (i.e. the most recent output) is simply buggy. Related to #419
2023-09-25config: apply overrides even if there's no fileAlyssa Ross-22/+17
Previously, foot -a test wouldn't actually set the app ID if there was no config file and the defaults were used, which was very counterintuitive. Now, load_config() will carry on until the end, even if there's no config file, so overrides still work.
2023-09-19selection: add support for selecting the contents of a quoteDaniel Eklöf-1/+3
This patch changes the default of triple clicking, from selecting the current logical row, to first trying to select the contents of the quote under the cursor, and if failing to find a quote, selecting the current row (like before). This is implemented by adding a new key binding, 'select-quote'. It will search for surrounding quote characters, and if one is found on each side of the cursor, the quote is selected. If not, the entire row is selected instead. Subsequent selection operations will behave as if the selection is either a word selection (a quote was found), or a row selection (no quote found). Escaped quote characters are not supported: "foo \" bar" will match 'foo \', and not 'foo " bar'. Mismatched quotes are not custom handled. They will simply not match. Nested quotes ("123 'abc def' 456") are supported. Closes #1364