aboutsummaryrefslogtreecommitdiff
path: root/config.c (follow)
Commit message (Collapse)AuthorAgeLines
* 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
|
* theme: change default color theme to solarized-dark-normal-brightsDaniel Eklöf2022-08-22-17/+17
| | | | | | | | | This is my variant of the solarized theme, were only the first eight colors (i.e. the "normal") colors are from the solarized theme. The remaining eight (the "bright" colors) are brightened versions of the "normal" colors. This results in a theme that is usually in all applications, not just those that are "aware" that the terminal color theme is "solarized".
* config: add setting for underline thicknessYorick Peterse2022-08-20-0/+4
| | | | | | | | This adds an "underline-thickness" setting to the "main" section, similar to the existing "underline-offset" setting. This setting is used to specify a custom height for regular (= non-cursor) underlines. Fixes #1136
* config: reset errno before calling getline() againDaniel Eklöf2022-07-29-0/+3
| | | | Related to #1107
* input: add new Unicode input modeDaniel Eklöf2022-07-29-0/+2
| | | | | | | | | | | | | | This mode is activated through the new key-bindings.unicode-input and search-bindings.unicode-input key bindings. When active, the user can “build” a Unicode codepoint by typing its hexadecimal value. Note that there’s no visual feedback in this mode. This is intentional. This mode is intended to be a fallback for users that don’t use an IME. Closes #1116
* config: add colors.search-box-{no-,}matchDaniel Eklöf2022-07-28-0/+28
| | | | Closes #1112
* osc: add support for OSC 133;A (prompt markers)Daniel Eklöf2022-06-16-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the OSC-133;A sequence, introduced by FinalTerm and implemented by iTerm2, Kitty and more. See https://iterm2.com/documentation-one-page.html#documentation-escape-codes.html. The shell emits the OSC just before printing the prompt. This lets the terminal know where, in the scrollback, there are prompts. We implement this using a simple boolean in the row struct ("this row has a prompt"). The prompt marker must be reflowed along with the text on window resizes. In an ideal world, erasing, or overwriting the cell where the OSC was emitted, would remove the prompt mark. Since we don't store this information in the cell struct, we can't do that. The best we can do is reset it in erase_line(). This works well enough in the "normal" screen, when used with a "normal" shell. It doesn't really work in fullscreen apps, on the alt screen. But that doesn't matter since we don't support jumping between prompts on the alt screen anyway. To be able to jump between prompts, two new key bindings have been added: prompt-prev and prompt-next, bound to ctrl+shift+z and ctrl+shift+x respectively. prompt-prev will jump to the previous, not currently visible, prompt, by moving the viewport, ensuring the prompt is at the top of the screen. prompt-next jumps to the next prompt, visible or not. Again, by moving the viewport to ensure the prompt is at the top of the screen. If we're at the bottom of the scrollback, the viewport is instead moved as far down as possible. Closes #30
* config: add a new ‘environment’ sectionDaniel Eklöf2022-06-13-0/+40
| | | | | | | | This section allows the user to define custom environment variables to be set in the child process: [environment] name=value
* config: use $HOME instead of getpwuid() to retrieve users’s home dirDaniel Eklöf2022-05-25-11/+2
| | | | | When searching for foot.ini, use $HOME instead of getpwuid() to retrieve the user’s home directory.
* config: add ctrl+shift+v and XF86 paste to SEARCH_CLIPBOARD_PASTEDaniel Eklöf2022-04-26-0/+2
| | | | | | | | | | | | | We now bind ctrl+v, ctrl+shift+v, ctrl+y and XF86Paste to pasting from the clipboard into the scrollback search buffer. Why all these? Because we can, and because all are common shortcuts for pasting: * ctrl+v: “normal” apps use this by default * ctrl+shift+v: used in terminals (including foot) * ctrl+y: Emacs * XF86Paste: special keyboard key, for pasting
* key-binding: new API, for handling sets of key bindingsDaniel Eklöf2022-04-17-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, our Wayland seats have been tracking key bindings. This makes sense, since the seat’s keymap determines how the key bindings are resolved. However, tying bindings to the seat/keymap alone isn’t enough, since we also depend on the current configuration (i.e. user settings) when resolving a key binding. This means configurations that doesn’t match the wayland object’s configuration, currently don’t resolve key bindings correctly. This applies to footclients where the user has overridden key bindings on the command line (e.g. --override key-bindings.foo=bar). Thus, to correctly resolve key bindings, each set of key bindings must be tied *both* to a seat/keymap, *and* a configuration. This patch introduces a key-binding manager, with an API to add/remove/lookup, and load/unload keymaps from sets of key bindings. In the API, sets are tied to a seat and terminal instance, since this makes the most sense (we need to instantiate, or incref a set whenever a new terminal instance is created). Internally, the set is tied to a seat and the terminal’s configuration. Sets are *added* when a new seat is added, and when a new terminal instance is created. Since there can only be one instance of each seat, sets are always removed when a seat is removed. Terminals on the other hand can re-use the same configuration (and typically do). Thus, sets ref-count the configuration. In other words, when instantiating a new terminal, we may not have to instantiate a new set of key bindings, but can often be incref:ed instead. Whenever the keymap changes on a seat, all key bindings sets associated with that seat reloads (re-resolves) their key bindings. Closes #931
* url-mode: add a key binding that enables “persistent” URL modeDaniel Eklöf2022-04-17-1/+2
| | | | | | | This is an alternative to ‘show-urls-launch’, where we stay in URL mode after activating an URL. Closes #964
* config: add [csd].hide-when-maximized=yes|noDaniel Eklöf2022-04-16-0/+4
| | | | | | | When enabled, the CSD titlebar will be hidden when the window is maximized. Closes #1019
* fix some small typosMerlin Büge2022-04-13-5/+5
|
* config: config_free(): pass conf struct by pointer, not by-valueDaniel Eklöf2022-04-12-26/+26
|
* config: simplify lookup of foot.iniDaniel Eklöf2022-04-12-144/+31
| | | | | | | | The old, complex, way of using a dynamic list to hold each path component made _some_ sense before, when we needed to support both ~/.config/foot.ini and ~/.config/foot/foot.ini. But now, it just over complicates things.
* config: use fallback when XDG_CONFIG_{HOME,DIRS} is set, but emptyDaniel Eklöf2022-04-07-2/+2
|
* config: fallback to /etc/xdg if XDG_CONFIG_DIRS is unsetDaniel Eklöf2022-04-07-2/+4
| | | | Closes #1008
* config: add tweak option to allow disabling sixelsjvoisin2022-04-06-0/+4
| | | | Closes #950
* config/input: add scrollback-home|end key bindings (unbound by default)Daniel Eklöf2022-02-23-0/+2
|
* config: do key binding collision handling in overridesDaniel Eklöf2022-02-16-18/+17
| | | | | This ensures we detect, and handle, collisions also for key-bindings specified as overrides.
* wip: map key combos to custom text strings (including escapes)Daniel Eklöf2022-02-16-3/+112
| | | | | | | | | | | | | With this, it is now possible to map key combos to custom escapes. The new bindings are defined in a new section, “text-bindings”, on the form “string=key combo”. The string can consist of printable characters, or \xNN style hex digits: [text-bindings] abcd = Control+a \x1b[A = Control+b Control+c Control+d # map ctrl+b/c/d to UP
* config: rename csd.color.close -> quitDaniel Eklöf2022-02-09-1/+1
| | | | | | | | | | | This fixes a compilation error on FreeBSD: ../../foot/render.c:2055:45: error: no member named 'epoll_shim_close' in 'struct config::(anonymous at ../../foot/config.h:254:9)' conf_color = &term->conf->csd.color.close; ~~~~~~~~~~~~~~~~~~~~~ ^ /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:8:15: note: expanded from macro 'close': #define close epoll_shim_close
* config: ‘pipe’ is now optional ‘aux’ data in the key-binding structDaniel Eklöf2022-02-09-52/+74
| | | | | This allows us to add helper functions that e.g. compare bindings’ aux data in a generic way.
* config: rename enum config_key_binding_type -> key_binding_typeDaniel Eklöf2022-02-09-2/+2
|
* config: font->name may be NULLDaniel Eklöf2022-02-06-2/+6
| | | | | If it is, fallback to the font pattern instead, like we used to do before fcft-3.
* fcft: adapt to API changes in fcft-3.xDaniel Eklöf2022-02-05-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fcft no longer uses wchar_t, but plain uint32_t to represent codepoints. Since we do a fair amount of string operations in foot, it still makes sense to use something that actually _is_ a string (or character), rather than an array of uint32_t. For this reason, we switch out all wchar_t usage in foot to char32_t. We also verify, at compile-time, that char32_t used UTF-32 (which is what fcft expects). Unfortunately, there are no string functions for char32_t. To avoid having to re-implement all wcs*() functions, we add a small wrapper layer of c32*() functions. These wrapper functions take char32_t arguments, but then simply call the corresponding wcs*() function. For this to work, wcs*() must _also_ be UTF-32 compatible. We can check for the presence of the __STDC_ISO_10646__ macro. If set, wchar_t is at least 4 bytes and its internal representation is UTF-32. FreeBSD does *not* define this macro, because its internal wchar_t representation depends on the current locale. It _does_ use UTF-32 _if_ the current locale is UTF-8. Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is defined. Other fcft API changes: * fcft_glyph_rasterize() -> fcft_codepoint_rasterize() * font.space_advance has been removed * ‘tags’ have been removed from fcft_grapheme_rasterize() * ‘fcft_log_init()’ removed * ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
* config: s/of the form/on the form/Daniel Eklöf2022-02-05-1/+1
|
* config: use getline idiomaticallyPranjal Kole2022-02-05-66/+72
| | | | | | getline(3) contains an example program at the end, showing its usage. A few other changes have also been made.
* config: don't pass null strings to *printf()Pranjal Kole2022-02-05-18/+61
| | | | | | | | | | | | | musl and glibc's *printf() convert NULL strings to "(null)" [0][1], but this is undefined behaviour. context.value has to be set to two backspaces, so that the extra colon is removed. context.key is set to one backspace, so that the extra dot is removed. context.section is now set to "main" by default, so it is never NULL. [0]: https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593 [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf-internal.c;hb=HEAD#l1011
* config: support Copy and Paste keycodes by defaultMark Stosberg2022-01-25-0/+2
| | | | | | | | | | | | These work as expected and don't interfere with anything else. They are useful on the increasing number of keyboards with custom firmware. The keycodes enable using the same key combination for terminals as other apps. For example: by holding down a layer-switching key with a thumb, the Copy and Paste key codes can be assigned to the C and V keys on a secondary layer, making for a natural universal copy/paste key combination.
* config: convert tweak.render_timer to an enumDaniel Eklöf2022-01-13-15/+7
|
* Add irc:// to default URL schemesSimon Ser2021-12-27-0/+2
|
* config: update most parse_section_*() functions to return in each if-branchDaniel Eklöf2021-12-25-28/+20
|
* config: scrollback: add missing return for ‘lines’Daniel Eklöf2021-12-25-1/+1
| | | | The missing return meant failures were not reported correctly.
* config: csd.border_width now always reflects the full/total widthDaniel Eklöf2021-12-22-0/+6
|
* config: error out on empty key- or mouse bindingDaniel Eklöf2021-12-18-0/+6
| | | | Closes #851
* config: NOINLINE modifiers_to_str()Daniel Eklöf2021-12-11-1/+1
|