aboutsummaryrefslogtreecommitdiff
path: root/config.c (follow)
Commit message (Collapse)AuthorAgeLines
* config: bold-text-in-bright: add ‘palette-based’ as a special valueDaniel Eklöf2021-04-18-3/+13
| | | | | | | | | When ‘bold-text-in-bright’ is set ‘to palette-based’, colors matching one of the 8 regular palette colors are brightened by using the corresponding bright palette color. Other colors, or all colors if ‘bold-text-in-bright’ is set to ‘yes|true’, are brightened by increasing the luminance.
* config: add box-drawings-uses-font-glyphs=no|yes optionDaniel Eklöf2021-04-18-0/+4
| | | | | | | | | When disabled, we render box drawing characters ourselves. This is the default. When enabled, we instead use font glyphs. I.e. no special treatment. Closes #430
* config/terminal: refactor: remove “default_*” color members from terminal structDaniel Eklöf2021-04-18-19/+38
| | | | Access the original colors in the configuration instead.
* config: make {search,url}_binding_action_map[] function localDaniel Eklöf2021-04-18-34/+34
| | | | | | | | | This ensures we don’t accidentally reference them from places we shouldn’t. Unfortunately, binding_action_map[] (for “normal” key bindings) cannot easily be made function local since it is used when parsing both key- and mouse bindings (i.e. it’s used in multiple functions).
* config: parse_key_binding_section(): use provided action-mapDaniel Eklöf2021-04-18-1/+1
| | | | | | | | Don’t call has_key_binding_collisions() with ‘binding_action_map’ unconditionally; use the provided ‘action_map’ instead. This fixes wrong error messages for key combo collisions in key binding sections other than the regular “key-bindings”.
* config: open_config(): remove unused argument ‘conf’Daniel Eklöf2021-03-16-2/+2
|
* input: repair key combos containing both explicit modifier and shifted symbolDaniel Eklöf2021-03-04-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a user-provided key combo contains both an explicit modifier, and the shifted symbol it produces, replace the symbol with its un-shifted version. Example: Control+Shift+U contains both ‘Shift’, and ‘U’, where ‘Shift’ is the modifier that shifts ‘u’ to ‘U’. Such modifiers are “consumed”, i.e. filtered out, when matching key combos. As such, Control+Shift+U will never trigger since we’ll never be able to match the consumed modifier ‘Shift’. The above combo can be written in two ways: - Control+U - Control+Shift+u To be able to detect that Control+Shift+U is an invalid combination, we need to check all *shifted* symbols for all key *codes*. Once we’ve detected a shifted symbol (and where it differs from the un-shifted symbol), we loop all modifier sets that produce the shift level where our shifted symbol is. For each such set, check if it intersects with the user-provided key combo’s modifier set. If there is an intersection, it means the user provided a key combo containing a modifier and symbol, such that the modifier is consumed when the symbol is produced. In this case, we replace the symbol with its un-shifted version.
* config: parse_key_combos: lower case manually, instead of calling tolower()Daniel Eklöf2021-03-04-1/+1
| | | | tolower() is locale dependent, something we do not want in this case.
* config: fix default key binding for extend-to-next-whitespaceDaniel Eklöf2021-03-04-1/+1
| | | | Bindings now use lower-cased keys
* input: rewrite of how we match foot’s own key bindingsDaniel Eklöf2021-03-04-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bindings are matched in one out of three ways: * By translated (by XKB) symbols * By untranslated symbols * By raw key codes A translated symbol is affected by pressed modifiers, some of which can be “consumed”. Consumed modifiers to not partake in the comparison with the binding’s modifiers. In this mode, ctrl+shift+2 maps to ctrl+@ on a US layout. Untranslated symbols, or un-shifted symbols refer to the “base” symbol of the pressed key, i.e. it’s unaffected by modifiers. In this mode, consumed modifiers *do* partake in the comparison with the binding’s modifiers, and ctrl+shift+2 maps to ctrl+shift+2 on a US layout. More examples: ctrl+shift+u maps to ctrl+U in the translated lookup, while ctrl+shift+u maps to ctrl+shift+u in the untranslated lookup. Finally, we also match raw key codes. This allows our bindings to work using the same physical keys when the user switches between latin and non-latin layouts. This means key bindings in foot.ini *must* not include both +shift+ and a *shifted* key. I.e. ctrl+shift+U is not a valid combo as it cannot be triggered. Unfortunately, this was how you were supposed to write bindings up until now... so, we try to detect such bindings, log a deprecation warning and then “fix” the binding for the user. When specifying bindings in foot.ini, both ctrl+U and ctrl+shift+u are valid, and will work. The latter is preferred though, since we cannot detect the raw key code for the former variant. Personally, I also prefer the latter one because it is more explicit; it’s more obvious which keys are involved. However, in some cases it makes more sense to use the other variant. Typically for non-letter combos.
* Fix typo.L3MON4D32021-03-01-1/+1
|
* config: reuse HAVE_TERMINFO via DEFAULT_TERMChloe Kudryavtsev2021-02-26-5/+1
| | | | | add detection in --help output also make it more easily accessible for other locations to change
* Merge branch 'rename-_errno'Daniel Eklöf2021-02-22-3/+3
|\
| * errno: don’t use ‘_errno’ as a variable name; _ are reserved for use as identifiersDaniel Eklöf2021-02-21-3/+3
| |
* | config: typo: osc8-underline=always means ALWAYSDaniel Eklöf2021-02-21-1/+1
| |
* | config: osc8-underline: default to ‘url-mode’Daniel Eklöf2021-02-21-1/+1
| |
* | urls: OSC-8 URLs can now optionally be underlined outside of url-modeDaniel Eklöf2021-02-21-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new configuration option, ‘osc8-underline=url-mode|always’. When set to ‘url-mode’, OSC-8 URLs are only highlighted (i.e. underlined) in url-mode, just like auto-detected URLs. When set to ‘always’, they are always underlined, regardless of mode, and regardless of their other attributes. This is implemented by tagging collected URLs with a boolean, instructing urls_render() and urls_reset() whether they should update the cells’ ‘url’ attribute or not. The OSC-8 collecter sets this based on the value of ‘osc8-underline’. Finally, when closing an OSC-8 URL, the cells are immediately tagged with the ‘url’ attribute if ‘osc8-underline’ is set to ‘always’.
* | config: change default key binding for toggle-url-visible to ‘t’Daniel Eklöf2021-02-21-1/+1
| |
* | urls: add key binding that toggles whether URLs are displayed on jump-labelDaniel Eklöf2021-02-21-0/+2
|/ | | | | | | | | | | | | | | | | By default, the URL isn’t shown on the jump-label. For auto-detect URLs, doing so is virtually always useless, as the URL is already visible in the grid. For OSC-8 URLs however, the URL is often _not_ visible in the grid. Many times, seeing the URL is still not needed (if you’re doing ‘ls --hyperlink’, you already know what the URIs are). But it is still useful to have a way to show the URLs. This patch adds a new key binding action that can be used in url-mode to toggle the URL on and off in the jump label. It is bound to ctrl+t by default.
* config: add jump-label-letters optionDaniel Eklöf2021-02-13-0/+12
|
* config: refactor: add str_to_wchars(), use it when parsing word-delimitersDaniel Eklöf2021-02-13-8/+24
|
* Convert some uses of xassert(false) to BUG("some error message")Craig Barnes2021-02-09-1/+1
|
* Merge branch 'refactor-key-bindings'Daniel Eklöf2021-02-08-204/+76
|\
| * key-bindings: refactor: use a single type for all key bindingsDaniel Eklöf2021-02-08-204/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, the various key binding modes (“normal”, “search” and “url”) have used their own struct definitions for their key bindings. The only reason for this was to have a properly typed “action” (using the appropriate “action” enum). This caused lots of duplicated code. This patch refactors this to use a single struct definition for the “unparsed” key bindings handled by the configuration, and another single definition for “parsed” bindings used while handling input. This allows us to implement configuration parsing, keymap translation and so on using one set of functions, regardless of key binding mode.
* | misc: when free:ing tll lists, prefer tll_remove() over tll_free()Daniel Eklöf2021-02-08-4/+6
|/ | | | | | | | | | | | | | | | | | | In many places we have the following pattern: tll_foreach(list, it) free(it->item.thing); tll_free(list); Since all tll functions are macros, and thus inlined, and since tll_free in itself expands to a tll_foreach(), the above pattern expands to more native code than necessary. This is somewhat smaller: tll_foreach(list, it) { free(it->item.thing); tll_remove(list, it); }
* config: add colors.jump_labels and colors.urlsDaniel Eklöf2021-02-07-13/+55
| | | | | | | | | | * colors.jump_labels configures the foreground and background colors used when rendering URL jump labels. Defaults to “regular0 regular3” (i.e. black on yellow). * colors.urls configures the color to use when highlighting URLs in URL mode. Note that we aren’t currently doing any highlighting... Defaults to regular3 (i.e. yellow).
* config: use a packed bitfield for “use custom color” flagsDaniel Eklöf2021-02-07-2/+4
|
* config: add show-urls-copy actionDaniel Eklöf2021-02-07-0/+1
| | | | | | This works just like show-urls-launch, except that instead of opening the URL (typically using xdg-open), it is placed in the clipboard when activated.
* config: show-urls-launch: change default key binding to ctrl+shift+uDaniel Eklöf2021-02-07-1/+1
|
* config: rename ‘show-urls’ to ‘show-urls-launch’Daniel Eklöf2021-02-07-2/+2
|
* config: add ctrl+d as (yet another) default binding url-bindings.cancelDaniel Eklöf2021-02-07-0/+1
|
* config: add ‘url-launch’ option, defaulting to “xdg-open ${url}”Daniel Eklöf2021-02-07-17/+49
|
* config: free URL bindingsDaniel Eklöf2021-02-07-0/+1
|
* config: add infrastructure to handle URL mode specific key bindingsDaniel Eklöf2021-02-07-0/+120
| | | | | | * Add “show-urls” action to regular key bindings * Add url-bindings section to foot.ini * Add “cancel” action to URL mode key bindings
* config: promote tweak.resize-delay-ms to a real, supported optionDaniel Eklöf2021-01-26-14/+14
|
* render: delay TIOCSWINSZ while doing an interactive resizeDaniel Eklöf2021-01-26-0/+14
| | | | | | | | | | | | | | | | | | | Instead of disabling content centering, delay the TIOCSWINSZ (a.k.a delay sending the new dimensions to the client) by a small amount while doing an interactive resize. Non-interactive resizes are still immediate. For now, force a resize when the user stops the interactive resize. This ensures the client application receives the new dimensions immediately. It still works without the last, forced, resize, but there typically be a small delay until the client application receives the final dimensions. Closes #301 Closes #283
* config: selection-target: space-optimize the static ‘value’ arrayDaniel Eklöf2021-01-23-1/+1
|
* config: add ‘none’ as a possible value for ‘selection-target’Daniel Eklöf2021-01-23-12/+18
| | | | | | | When ‘selection-target’ is set to ‘none’, selecting text does not copy the text to _any_ clipboard. This patch also refactors the value parsing to be data driven.
* config: add new option ‘selection-target’Daniel Eklöf2021-01-23-0/+17
| | | | | This option controls the clipboard target that selected text should be copied to.
* meson: optionalize terminfo dependencyJan Beich2021-01-23-0/+4
| | | | | | | | ncurses on FreeBSD still uses termcap(5) while foot works fine with xterm-256color sans status line and visible bell. Having more than one ncurses version installed may break other applications. Document -Dterminfo=false uses --term=xterm-256color by default
* debug: rename assert() to xassert(), to avoid clashing with <assert.h>Craig Barnes2021-01-16-15/+15
|
* Print stack trace on assert() failure or when calling fatal_error()Craig Barnes2021-01-16-1/+1
| | | | | | Note: this uses the __sanitizer_print_stack_trace() function from the AddressSanitizer runtime, so it only works when AddressSanitizer is in use.
* config: add ‘select-extend-character-wise’ bind actionDaniel Eklöf2021-01-14-0/+2
| | | | | | | This forces the (new) selection mode to be character-wise when extending a word- or line-wise selection. Default key binding is ctrl+RMB.
* config: change default box drawing line thickness from 0.02 -> 0.04Daniel Eklöf2021-01-12-1/+1
|
* config: add temporary(?) tweak option for box drawing line thicknessDaniel Eklöf2021-01-12-0/+15
|
* config: pt_or_px cannot be a unionDaniel Eklöf2021-01-11-1/+1
|
* config: line-height, letter-spacing: values are in pt by default, but we allow pxDaniel Eklöf2021-01-11-45/+48
| | | | | | | | If the value is specified without a unit, then the value is assumed to be in points, subject to DPI scaling. The value can optionally have a ‘px’ suffix, in which case the value is treated as a raw pixel count.
* config: str_to_color(): use LOG_AND_NOTIFY(), not just LOG()Daniel Eklöf2021-01-11-11/+14
|
* config; {horizontal,vertical}-letter-offsets may be negativeDaniel Eklöf2021-01-11-4/+4
|
* config: letter-spacing: make this a relative valueDaniel Eklöf2021-01-11-2/+15
| | | | | | | | 0, the default, means no additional spacing; the cell width is defined by the font metrics. A positive value *adds* to the width from the font metrics, while a negative value *subtracts*.
* config: add line-height, letter-spacing, {horizontal,vertical}-letter-offsetDaniel Eklöf2021-01-11-0/+48
|
* config: add optional ‘center’ argument to ‘pad’Daniel Eklöf2021-01-06-2/+9
| | | | | | | | | | When set, the grid contents is centered in the window. I.e. the left/right and top/bottom margins are equal (+- 1px). This causes the content to “jump” while doing an interactive resize, but may still be preferred in e.g. a tiling WM. Closes #273
* Require trailing comment to be preceded by a space or tabPeter Colberg2021-01-03-3/+12
| | | | | | Fixes `word-delimiters` option to not ignore `#` and subsequent characters. Closes #270
* fonts: size fonts using the scaling factor when output scaling is enabledDaniel Eklöf2020-12-17-3/+7
| | | | | | | | | | | | | | | | | | | This extends the new ‘dpi-aware’ option with a new default value, ‘auto’. When set to ‘auto’, fonts are sized using monitors’ DPI when output scaling is disabled. When output scaling is enabled, fonts are instead sized using the scaling factor. The reasoning here is that a user that has enabled output scaling is obviously *not* relying on DPI scaling. Output scaling can also be a way to compensate for different viewing distances, in which case we do *not* want to break that by using DPI scaling. Users can still force DPI-only font sizing by setting ‘dpi-aware=yes’, or disable it completely by setting ‘dpi-aware=no’.
* config_font_parse(): return fail/successDaniel Eklöf2020-12-15-8/+26
|
* config: add ‘notify’ to possible values for ‘bell’ in foot.iniDaniel Eklöf2020-12-10-5/+8
| | | | | When `bell=notify`, foot will trigger a desktop notification when it receives a BEL in an unfocused window.
* osc: implement urxvt’s “OSC 777;notify”Daniel Eklöf2020-12-09-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSC 777 is URxvt’s generic escape to send commands to its perl extensions. The first parameter is the name of the extension, followed by its arguments. OSC 777;notify is a, if not well established, at least a fairly well known escape sequence to request a (desktop) notification. The syntax is: \e]777;notify;<title>;<body>\e\\ Neither title nor body is escaped in any way, meaning they should not contain a ‘;’. Foot will split title from body at the *first* ‘;’. Any remaining ‘;’ characters are treated as part of ‘body’. Instead of adding built-in support for the freedesktop notification specification (which would require us to link against at least dbus), add a new config option to foot.ini: ‘notify’. This option specifies the command to execute when a notification is received. ‘${title}’ and ‘${body}’ can be used anywhere, in any combination, and as many times as you want, in any of the command arguments. The default value is ‘notify-send -a foot -i foot ${title} ${body}’
* config: remove support for scrollback-up and scrollback-downDaniel Eklöf2020-12-08-47/+2
|
* config: remove support for default.geometryDaniel Eklöf2020-12-08-16/+1
|
* config: remove support for default.scrollbackDaniel Eklöf2020-12-08-22/+0
|
* config: remove support for loading configuration from footrcDaniel Eklöf2020-12-08-24/+0
|
* config: ignore “self” when detecting key binding collisionsDaniel Eklöf2020-12-05-4/+12
| | | | | | | | | | | | | | | | | | | | | | | Previously, foot would not accept the following: [key-bindings] minimize=Escape minimize=Escape Now it does. I.e. key combos in the action being updated are ignored when detecting collisions. The example above is contrived; a real world example could be to remove certain combos from an action with multiple combos; perhaps to free up a combo for another action. Example: [search-bindings] cancel=Escape This would previously cause an error since `cancel=Control+g Escape` by default. Closes #233
* config: replace union in config struct with simple width/height membersCraig Barnes2020-11-30-8/+6
|
* config: add ‘dpi-aware’ option, defaulting to enabledDaniel Eklöf2020-11-19-0/+4
| | | | | | | | | | When disabled, foot no longers uses outputs’ DPI to scale the font. Instead, it uses the outputs’ scaling factor. That is, instead of appending “:dpi=123” to the fontconfig string, modify the “:pixelsize” or “:size” attribute. Closes #206
* config: add default.bold-text-in-bright optionDaniel Eklöf2020-11-14-0/+4
|
* config: enable allow-overflowing-double-width-glyphs by defaultDaniel Eklöf2020-11-13-3/+3
|
* config: add support for pipe-* actions in mouse bindingsDaniel Eklöf2020-11-06-4/+52
| | | | Closes #183
* config: mouse combos: set count=1 if user has omitted click countDaniel Eklöf2020-11-06-1/+1
|
* config: break out “[cmd arg1 arg2]” parsing to separate functionDaniel Eklöf2020-11-06-21/+63
|
* config: don’t use memcmp() to compare structsDaniel Eklöf2020-11-06-11/+22
|
* search: add {clipboard,primary}-paste key bindingsDaniel Eklöf2020-11-01-0/+6
| | | | | | | | | | These bindings copy from the clipboard or primary selection into the search buffer. Default bindings: * clipboard-paste: ctrl+v, ctrl+y * primary-paste: shift+insert
* config: add font-bold, font-italic and font-bold-italic optionsDaniel Eklöf2020-10-20-8/+24
| | | | | | | | | | These options lets the user configure custom fonts and styles, to use with the bold and italic cell attributes. By default, they are unset, meaning we use the bold/italic variants of the regular font. Closes #169.
* csi: implement ‘CSI ? 1042 h/l’ - enable/disable bell-is-urgentDaniel Eklöf2020-10-11-4/+4
|
* conf: csd.preferred can now be set to ‘none’Daniel Eklöf2020-10-10-1/+5
| | | | | | | | | | | When csd.preferred == none, we will request CSDs from the compositor, but internally render as if we are using SSDs. That is, we don’t render any window decorations at all. Note that some compositors may ignore our request to use CSDs, and still render SSDs for us. Closes #163
* Merge branch 'bind-shift+insert-to-primary-paste' into masterDaniel Eklöf2020-10-10-0/+1
|\
| * config: bind shift+insert to primary-paste by defaultDaniel Eklöf2020-10-10-0/+1
| |
* | config: add ‘[default].word-delimiters’Daniel Eklöf2020-10-09-1/+18
|/ | | | | | | | | | This option lets the user configure which characters act as word delimiters when selecting text. This affects both “double clicking”, and ‘ctrl-w’ in scrollback search mode. Closes #156
* config: fix "-Wformat-nonliteral" warningsCraig Barnes2020-10-09-3/+3
|
* bell: optionally render margins in red when receiving BELDaniel Eklöf2020-10-08-0/+15
| | | | | | | | | | | Add anew config option, ‘bell=none|set-urgency’. When set to ‘set-urgency’, the margins will be painted in red (if the window did not have keyboard focus). This is intended as a cheap replacement for the ‘urgency’ hint, that doesn’t (yet) exist on Wayland. Closes #157
* config: ignore key/value pairs following an invalid section nameDaniel Eklöf2020-10-07-0/+7
| | | | | | | | | | | When we detected an invalid section name, we correctly logged this and warned the user. However, the internal state machine now had an invalid section enum value. This caused a crash when the next key/value pair was to be parsed and we tried to lookup which parser function to call. Closes #159.
* config: change default multiplier from 1.0 -> 3.0Daniel Eklöf2020-09-29-1/+1
|
* config: add mouse.alternate-scroll-mode optionDaniel Eklöf2020-09-15-0/+4
| | | | | This option controls the initial state of the Alternate Scroll Mode, and defaults to ‘enabled’.
* config: add tweak.scaling-filterDaniel Eklöf2020-09-13-1/+29
| | | | | | | | Use the new fcft_set_scaling_filter() API to use a non-default scaling filter. By default, we use lanczo3, the ‘best’ filter. This overrides the default in fcft, which is ‘cubic’ filtering.
* config: log warning when new boolean tweak options have been enabledDaniel Eklöf2020-09-12-2/+8
|
* key-binding: deprecate scrollback-up/down, add scrollback-up/down-lineDaniel Eklöf2020-09-10-4/+52
| | | | | | | | This deprecates/renames scrollback-up/down to scrollback-up/down-page. It also renames scrollback-up/down-half to scrollback-up/down-half-page, and adds the new bindings scrollback-up/down-line.
* config: add scrollback-{up,down}-half key bindingsDaniel Eklöf2020-09-09-0/+2
| | | | | | | | These new bindings scroll up/down half a page in the scrollback (instead of the full page scrolled by ‘scrollback-{up,down}’). Closes #128.
* config: spelling: mosue -> mouseDaniel Eklöf2020-09-09-2/+3
|
* Merge branch 'window-size-in-characters' into masterDaniel Eklöf2020-09-09-12/+51
|\
| * Add -W,--window-size-chars, and foot.ini:initial-window-size-charsDaniel Eklöf2020-09-08-12/+51
| | | | | | | | | | | | | | | | | | | | | | * Add -W,--window-size-chars command line option * Add initial-window-size-chars foot.ini option * Add -w,--window-size-pixels command line option * Add initial-window-size-pixels foot.ini option * Deprecate -g,--geometry command line option in favor of -w,--window-size-pixels * Deprecate geometry option in foot.ini in favor of initial-window-size-pixels
* | config: key binding: free pipe cmd/argv when action is invalidDaniel Eklöf2020-09-08-0/+2
|/
* config: add tweak.damage-whole-windowDaniel Eklöf2020-09-06-0/+4
| | | | | | | | | | When enabled, foot will ‘damage’ the entire window, instead of just the modified/updated rows. This will force the compositor to redraw/blend the whole window. This can be used to workaround an issue with fractional scaling in Gnome, where random thin lines may appear.
* config: use correct config file path when logging errors and warningsDaniel Eklöf2020-09-06-1/+1
|
* render: optionally enable heuristics that deal with private usage area charsDaniel Eklöf2020-09-03-1/+5
| | | | | | | | | | | | | | Try to detect double-width *glyphs* for single-width *characters*, and allow them to overflow into the next cell. This is only done for single-width chars with a glyph width that is at least 1.5 cells wide, but at most 3 cells. The feature is gated by the new ‘tweak.allow-overflowing-double-width-glyphs’, and is disabled by default. Closes #116
* config: close FD if it is *valid*, not when it is *invalid*Daniel Eklöf2020-08-27-1/+1
|
* config: prefer loading configuration from $XDG_CONFIG_HOME/foot/foot.iniDaniel Eklöf2020-08-27-43/+217
|
* fix some buggy comparisons relating to signed/unsigned typesCraig Barnes2020-08-25-1/+1
|
* Merge branch 'pedantic' into masterDaniel Eklöf2020-08-25-15/+15
|\
| * log: include 'fmt' in __VA_ARGS__Daniel Eklöf2020-08-23-10/+10
| | | | | | | | | | This ensures all calls have at least one __VA_ARGS__ argument, thus making them ISO C99 compliant.
| * don't use empty struct initializersDaniel Eklöf2020-08-23-5/+5
| |
* | synchronize config-error-message with available field valuesJonas 'cherti' Große Sundrup2020-08-23-1/+1
|/