aboutsummaryrefslogtreecommitdiff
path: root/config.c (follow)
Commit message (Collapse)AuthorAgeLines
* config: value_to_*(): don't overwrite result variable on errorDaniel Eklöf2025-08-25-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.
* config: silence valgrind-detected leak in config_font_parse()Daniel Eklöf2025-07-11-1/+3
|
* conf: pad: add center-when-fullscreen and center-when-maximized-and-fullscreenDaniel Eklöf2025-05-24-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
* render: refactor to allow setting only selection bg or fgDaniel Eklöf2025-05-05-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
* config: tweak.surface-bit-depth: add support for 16-bit surfacesDaniel Eklöf2025-05-03-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.
* config: tweak.surface-bit-depth now defaults to 'auto'Daniel Eklöf2025-05-01-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
* config: gamma-correct-blending: disable by defaultDaniel Eklöf2025-05-01-12/+3
|
* config: parse_color_theme(): make NOINLINEDaniel Eklöf2025-04-27-1/+1
|
* config: add initial-color-theme=1|2Daniel Eklöf2025-04-26-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.
* key-bindings: add bindings to switch between color themesDaniel Eklöf2025-04-26-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
* config: add new section 'colors2'Daniel Eklöf2025-04-26-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'.
* config: refactor: break out color theme parsing to a separate functionDaniel Eklöf2025-04-26-38/+41
|
* config: move cursor.color to colors.cursorDaniel Eklöf2025-04-26-10/+31
|
* config+render: move alpha-mode to colors.alpha-mode, fix cursor handlingDaniel Eklöf2025-04-14-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.
* config: add alpha_mode optionFazzi2025-04-14-0/+10
|
* config: update default URL regexDaniel Eklöf2025-04-07-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
* render: dim and brighten using linear rgb interpolationSam McCall2025-03-23-0/+4
| | | | | | Adds setting tweak.dim-amount, similar to bold-text-in-bright-amount. Closes #2006
* config: remove deprecated options 'notify' and 'notify-focus-inhibit'Daniel Eklöf2025-03-17-24/+0
| | | | They've been deprecated since 1.18.0
* meson: require wayland-protocols >= 1.41Daniel Eklöf2025-03-13-14/+0
|
* fcft: require fcft >= 3.3.0, add support for new scaling-filtersDaniel Eklöf2025-03-12-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.
* render: gamma-correct blendingDaniel Eklöf2025-03-05-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
* config: add search-bindings.delete-to-{start,end} key bindingsAdrian fxj9a2025-03-05-0/+4
| | | | | | Defaults to ctrl+u and ctrl+k respectively. Closes #1972
* config+render: allow cursor.style=hollowDaniel Eklöf2025-02-19-1/+1
| | | | Closes #1965
* 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
* url-mode: use the first *sub* expression as URLDaniel Eklöf2025-02-05-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.
* config: remove debug loggingDaniel Eklöf2025-02-05-2/+0
|
* config+url: add support for user-defined regex patternsDaniel Eklöf2025-02-05-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).
* foot.ini+doc: add default value of url.regexDaniel Eklöf2025-02-05-0/+1
|
* url-mode+config: wip: add url.regex optionDaniel Eklöf2025-02-05-0/+60
|
* config: remove url.{uri-characters,protocols}Daniel Eklöf2025-02-05-111/+0
|
* key-bindings: add keypad variants to existing default key-bindingsDaniel Eklöf2025-01-31-0/+5
|
* config: fix memory leak on e.g. "not a valid XKB key name" errorsDaniel Eklöf2025-01-27-5/+4
|
* config: check for FcNameUnparse() failureDaniel Eklöf2025-01-24-0/+5
|
* Add support for the new Wayland protocol xdg-system-bellDaniel Eklöf2025-01-17-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.
* Revert "config: don't allow colors.flash-alpha to be 1.0"Alexander Orzechowski2025-01-09-2/+2
| | | | This reverts commit 56d2c3e990509d18de31e6009e0d0c6254f99b67.
* config: don't allow colors.flash-alpha to be 1.0Daniel Eklöf2025-01-02-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
* osc: add option to disable OSC-52, partially or fullyDaniel Eklöf2024-12-22-0/+24
| | | | Closes #1867
* config: add color.sixelN optionsDaniel Eklöf2024-10-23-0/+29
| | | | These options allows you to configure the default sixel color palette.
* add setting for strikeout thicknessOleh Hushchenkov2024-08-26-0/+4
|
* feature: add resize-keep-grid to allow text reflow on font changesAndrew J. Hesford2024-08-20-0/+4
|
* osc: kitty notifications: add support for XDG sound namesDaniel Eklöf2024-08-04-1/+1
|
* osc: kitty notifications: implement s=silentDaniel Eklöf2024-08-04-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}
* xmalloc: remove delim param from xstrjoin() and add separate xstrjoin3()Craig Barnes2024-08-03-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
* osc: kitty notifications: cleanup and update to latest version of specDaniel Eklöf2024-08-02-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.
* osc: kitty notifications: buttons, icons, app-name, categories etcDaniel Eklöf2024-07-31-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.
* notify: ${icon}: don't fallback to app-idDaniel Eklöf2024-07-30-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
* osc: kitty notifications: implement the 'close' requestDaniel Eklöf2024-07-25-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\\'
* config: notify-send: it's "action=label", not "action,label"Daniel Eklöf2024-07-24-1/+1
|
* notify: split up the ${action} template parameterDaniel Eklöf2024-07-23-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
* notify: don't focus/report on notification dismissalDaniel Eklöf2024-07-23-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.
* osc: kitty notifications: implement focus|reportDaniel Eklöf2024-07-23-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.
* osc/notify: add support for OSC-99, kitty desktop notificationsDaniel Eklöf2024-07-23-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/
* input: don't map wheel events to BTN_{BACK,FORWARD}Daniel Eklöf2024-07-13-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
* config: add cursor.blink-rate optionDaniel Eklöf2024-05-20-2/+8
| | | | | | The default is 500ms, which corresponds to the old, hardcoded default. Closes #1707
* config: add new key-binding 'quit', unbound by defaultDaniel Eklöf2024-04-11-0/+1
| | | | Closes #1475
* config: add cursor.unfocused-styleDaniel Eklöf2024-04-10-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
* xmalloc: add xmemdup() and use to replace some uses of xmalloc+memcpyCraig Barnes2024-03-17-10/+5
|
* main/config: replace some uses of xasprintf() with xstrjoin()Craig Barnes2024-03-16-4/+4
|
* config: don't try to free key combos we haven't allocatedDaniel Eklöf2024-02-24-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
* config: on error, correctly free partially parsed key combosDaniel Eklöf2024-02-23-6/+4
|
* config: map Control+wheel to font increase/decreaseDaniel Eklöf2024-02-15-0/+2
| | | | | | This is in addition to the already existing keyboard shortcuts. Also add missing default keyboard/mouse bindings to readme + foot(1).
* Don't use fancy Unicode quotes, stick to ASCIIDaniel Eklöf2024-02-06-5/+5
|
* config: add pipe-command-output key-bindingDaniel Eklöf2024-02-06-0/+1
|
* input/config: support *all* modifier namesDaniel Eklöf2024-02-06-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.
* feature: add resize-by-cells option to constrain window sizes...Andrew J. Hesford2024-02-05-0/+4
| | | | | ...to multiples of the cell size, and preserve grid size when changing fonts or display scales in floating windows.
* util: add streq() function and use in place of strcmp(...) == 0Craig Barnes2024-02-05-110/+110
|
* Replace unchecked allocations with calls to xmalloc.h functionsCraig Barnes2024-01-25-1/+1
|
* config: fix cloning of env_vars tllistDaniel Eklöf2024-01-10-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.
* config: reset conf file descriptor after closing file streamJan Palus2023-10-27-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
* config: improve validation of color values, default alpha to 0xffDaniel Eklöf2023-10-26-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
* Enable the use of flash as visual bellRaimund Sacherer2023-10-10-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.
* config: log_contextual_errno(): sync with log_contextual()Daniel Eklöf2023-10-08-3/+12
| | | | ... in terms of whether to print section/value separators
* config: add remaining search.scrollback key bindingsDaniel Eklöf2023-10-08-2/+8
| | | | All scrollback up/down key bindings are now available in search mode.
* config: map ctrl+shift+right to extend-to-word-boundaryDaniel Eklöf2023-10-08-1/+1
|
* search: add more key bindings to extend the current matchDaniel Eklöf2023-10-08-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
* config: apply overrides even if there's no fileAlyssa Ross2023-09-25-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.
* selection: add support for selecting the contents of a quoteDaniel Eklöf2023-09-19-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
* input: make wheel events mappableDaniel Eklöf2023-09-18-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Un-grabbed wheel events are now passed through the mouse binding matching logic, instead of being hardcoded to scrolling the terminal contents. They are mappable through the BTN_BACK and BTN_FORWARD buttons. Since they're not actually button *presses*, they never generate a click count other than 1. This limitation is documented, but not checked in the config. This means it's possible to create bindings like "BTN_BACK+3" (i.e. triple "click"). They will however never trigger. The old, hardcoded logic is now accessible through the new scrollback-up-mouse and scrollback-down-mouse mouse bindings. They (obiously) default to BTN_BACK and BTN_FORWARD, respectively. Example usage: keep the default of scrolling terminal contents with the wheel, when used without modifiers, but map Control+wheel to font zoom in/out: [mouse-bindings] font-increase=Control+BTN_FORWARD font-decrease=Control+BTN_BACK (this also keeps the default key bindings to zoom in/out; ctrl-+ and ctrl+-) Closes #1077
* config: remove deprecated option 'utempter'Daniel Eklöf2023-07-31-17/+1
|
* config: add tweak.bold-text-in-bright-amountDaniel Eklöf2023-07-28-5/+9
| | | | | | | | By how much to increase the luminance when brightening bold fonts. This was previously hard-coded to a factor of 1.3, which is now the default value of the new config option. Closes #1434
* themes: starlight: update to V4Daniel Eklöf2023-07-18-12/+12
| | | | | | | This also updates the default theme in foot, as well as the documentation. Closes #1409
* config: add csd.double-click-to-maximize=no|yes optionDaniel Eklöf2023-07-14-0/+4
| | | | | | | | | When enabled, double-clicking the CSD titlebar will (un)maximize the window. Defaults to ‘yes’ (since this is the old hard-coded behavior). Closes #1293
* config: make ‘starlight’ the default color themeDaniel Eklöf2023-07-14-17/+17
| | | | Closes #1321
* bind control-shift-u to unicode-input, move urls to oAntoine Beaupré2023-07-10-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having a keybinding to invoke arbitrary unicode characters is very useful. It's often used as a method of last resort to communicate with people outside of your main language. For example, if you want to type the last letter of my real name, you can invoke the latin-1 character 0xe9 or unicode 0x00e9. You can also use this to type special characters, for example, unicode U+1F4A9 is of course, the infamous PILE OF POO, which is sure to produce million laughs everywhere you go. In foot, there's no keybinding by default to invoke the very useful unicode-input command. There is no "standard" (as in "ISO") keybinding this either. But there *is* a de-facto standard currently deployed by *both* GTK and Qt (a rare feat) *and* Chrome OS (an even rarer feat) and it's control-shift-u. Alternatives include Control-x 8 (emacs), Control V u (vim), Alt (Windows, LibreOffice), or Option (Mac). I doubt we want to adopt any of those. So let's use control-shift-u for this. Unfortunately, it's currently assigned to show-urls-launch, which is unfortunate, but insurmountable. We can reassign this keybinding elsewhere. I have picked control-shift-o in my configuration, because "o" is a good mnemonic for "open URLs". Others have suggested "m" instead. Closes: #1183
* input: add basic support for touchscreen inputCismonX2023-07-05-0/+20
| | | | Closes #517
* config: dpi-aware: remove ‘auto’ value, and default to ‘no’Daniel Eklöf2023-06-29-12/+3
| | | | | | | | | | We now default to scaling fonts using the scaling factor, not monitor DPI. The ‘auto’ value for dpi-aware has been removed. Documentation (man pages and README) have been updated to reflect the new default.
* config: unittest: explicitly call fcft_init() + fcft_fini()Daniel Eklöf2023-06-26-0/+4
| | | | | This plugs a memory leak, caused by fontconfig functions being called as part of the unit test implicitly allocating global objects.
* .desktop: remove StartupWMClass from server, use distinct StartupWMClass for foot and footclientjdevdevdev2023-05-22-3/+4
| | | | | | | | | | | | | | | For this to work, the default app-id of footclient has been changed from ‘foot’ to ‘footclient’. By using distinct StartupWMClasses, the compositor can connect a running foot/footclient instance to the correct .desktop-file. This ensures the correct icon is being used in e.g. docks, and that actions like “open another window” works correctly. Note that the user can override the app-id, either by setting app-id in foot.ini, or with the -a,--app-id command line option. Closes #1355
* utmp: rewrite utmp loggingDaniel Eklöf2023-05-22-11/+30
| | | | | | | | | | | | | | | | | | | | | | | This patch generalizes the utmp support, to not only support libutempter, but also ulog (and in the future, even more interfaces). * Rename config option main.utempter to main.utmp-helper * Add meson option -Dutmp-backend=none|libutempter|ulog|auto * Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path * utmp is no longer detected at compile time, but at runtime instead. Meson will configure the following pre-processor macros, based on the selected utmp backend: * UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot) * UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot) * UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY) * UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary The documentation has been updated to mention which arguments are passed to the helper binary. Closes #1314
* config: apply fontconfig rules if user didn’t set an explicit font sizeDaniel Eklöf2023-03-06-6/+34
| | | | | | | | | | | | | | | | | | | | | | | If the user didn’t explicitly set the font size (e.g. font=monospace, instead of font=monospace:size=12), our initial attempt to read the FC_SIZE and FC_PIXEL_SIZE attributes will fail, and we used to fallback to setting the size to 8pt. Change this slightly, so that when we fail to read the FC_*_SIZE attributes, apply the fontconfig rules, but *without expanding* them (i.e. without calling FcDefaultSubstitute()). Then try reading FC_*_SIZE again. If that too fails, _then_ set size to 8pt. This allows us to pick up rules that set a default {pixel}size: <fontconfig> <match> <edit name="pixelsize" mode="append"><double>14</double></edit> </fontconfig> Closes #1287
* config: don’t double-free key binding auxiliary dataDaniel Eklöf2023-01-15-0/+3
| | | | | | | | | | | | | | | | Key bindings with multiple key mappings share auxiliary data (e.g. the command to execute in pipe-* bindings, or the escape sequence in text-bindings). The first one is the designated “master” copy. Only that one should be freed. This fixed a double-free on exit, with e.g. [text-bindings] \x1b\x23=Mod4+space Mod4+equal Closes #1259
* config: change default grapheme-width-method from wcswidth to double-widthDaniel Eklöf2023-01-01-1/+1
| | | | | | | | | | | | | | | | | | The old default, wcswidth, simply calls wcswidth() on the grapheme cluster. This was supposedly the implementation with the highest application compatibility. Except we never even tried to measure it. It was just assumed. A lot of modern applications have better implementations. Let’s try to push support for better emoji support by changing our default method from wcswith to double-width. While far from correct (it’s not based on the Unicode tables), the ‘double-width’ method produces accurate results anyway. double-width is like wcswidth(), in that it adds together the individual wcwidths of all codepoints in the grapheme cluster. But, it limits the maximum width to 2.
* config: font-size-adjustment: don’t allow empty %-values (key=%)Daniel Eklöf2022-12-17-1/+1
|
* config: value_to_pt_or_px(): don’t allow empty px values (key=px)Daniel Eklöf2022-12-17-1/+1
|
* config: add ‘font-size-adjustment=N[px|%]’ optionDaniel Eklöf2022-12-17-0/+26
| | | | | | | | | | | This patch adds a new config option, font-size-adjustment. It lets you configure how much the font size should be incremented/decremented when zooming in or out (ctrl-+, ctrl+-). Values can be specified in points, pixels or percent. Closes #1188
* slave: unsetenv() env vars that have been set to the empty stringDaniel Eklöf2022-12-06-11/+12
| | | | | | | | | | | That is, users can now *clear* environment variables by doing: [environment] VAR=”” Note that the quotes are required. Closes #1225
* config: allow string values to be quotedDaniel Eklöf2022-12-06-1/+41
| | | | | | | | | | | * Both double and single quotes are recognized. There’s no difference in how they are handled. * The entire string must be quoted: - “a quoted string” - OK - quotes “in the middle” of a string - NOT ok * Two escape characters are regonized: - Backslash - The quote character itself
* Add support for creating utmp recordsDaniel Eklöf2022-09-23-0/+19
| | | | | | | | | | | | | | | | | This patch adds support for creating utmp records using the ‘utempter’ helper binary from the ‘libutempter’ package. * New config option ‘main.utempter’ * New meson command line option, -Ddefault-utempter-path. Defaults to auto-detecting the path. The default value of the new ‘main.utempter’ config option depends on the meson command line option ‘-Ddefault-utempter-path’. If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute the utempter helper binary to create utmp records when a new terminal is instantiated. The record is removed when the terminal instance is destroyed.
* config: fix "maybe-uninitialized" error when compiling with CFLAGS=-OgCraig Barnes2022-09-17-0/+3
| | | | | | | | | | | | | | | Using GCC 12.2.0 with the following build steps: CFLAGS=-Og meson bld ninja -C bld ...produces the compiler error: ../config.c:2000:18: error: ‘sym_equal’ may be used uninitialized [-Werror=maybe-uninitialized] This commit fixes that by using BUG() to assert that all possible values are accounted for in the offending switch statement.
* config: change default ‘pad’ to 0x0 (i.e. no padding)Daniel Eklöf2022-09-03-2/+2
|