aboutsummaryrefslogtreecommitdiff
path: root/config.c (follow)
Commit message (Collapse)AuthorAgeLines
...
* 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
|/
* config: add user-configured search-binding to the correct binding listDaniel Eklöf2020-08-23-2/+2
| | | | Search bindings were added to the normal key binding list...
* config: don't pass -1 to mbstowcs(), silences linker(?) warningDaniel Eklöf2020-08-22-2/+4
| | | | | | | | | | | | 'n' _is_ ignored when 'dest' is NULL, but you can still get the following warning: In function ‘mbstowcs’, inlined from ‘parse_section_scrollback’ at ../config.c:429:26: /usr/include/bits/stdlib.h:129:10: warning: ‘__mbstowcs_alias’ specified size 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=] 129 | return __mbstowcs_alias (__dst, __src, __len); To silence this warning, pass 0 instead, since it is ignored anyway.
* config: don't allow Shift in mouse bindingsDaniel Eklöf2020-08-14-0/+5
| | | | | Shift is a special modifier that is used to enable selection when the client application is grabbing the mouse.
* config: mouse bindings: add select-begin-block and select-rowDaniel Eklöf2020-08-14-2/+6
|
* config: add mouse specific bind actionsDaniel Eklöf2020-08-14-4/+20
| | | | | | | | | | | | | | | | | | | | This extends the "normal" bind action enum with mouse specific actions. When parsing key bindings, we only check up to the last valid keyboard binding, while mouse bindings support *both* key actions and mouse actions. The new actions are: * select-begin: starts an interactive selection * select-extend: interactively extend an existing selection * select-word: select word under cursor * select-word-whitespace: select word under cursor, where the only word separating characters are whitespace characters. The old hard-coded selection "bindings" have been converted to instead use these actions, via default bindings added to the configuration.
* config: mouse bindings: add support for click countDaniel Eklöf2020-08-14-2/+26
| | | | Specified by appending "-X", where X is a number.
* config: wrap LOG_AND_NOTIFY_*() in do {} while (0)Daniel Eklöf2020-08-14-27/+25
| | | | This allows us to use these macros in if-statement without braces.
* config: key/mouse bindings: refactor: less parsing in keyboard_enter()Daniel Eklöf2020-08-13-232/+385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the handling of mouse and keyboard bindings. Before, the bindings where parsed *both* when loading the configuration, and then on every keyboard enter event. This was done since keys require a keymap to be decoded. Something we don't have at configuration time. The idea was that at config time, we used a default keymap just to verify the key combo strings were valid. The following has changed: * The bindings in the config struct is now *one* key combo per entry. Previously, it was one *action* per entry, and each entry had one or more key combos. Doing it this way makes it easier when converting the binding in the keyboard enter event (which previously had to expand the combos anyway). * The bindings in the config struct no longer contains any unparsed strings. A key binding contains a decoded 'modifier' struct (which specifies whether e.g. ctrl, or shift, or ctrl+shift must be pressed for the binding to be used). It also contains a decoded XKB keysym. * A mouse binding in the config struct is similar to a key binding, except it contains the button, and click count instead of the XKB key sym. * The modifiers in the user-specified key combo is decoded at config time, by using the pre-defined XKB constants XKB_MOD_NAME_<modifier>. The result is stored in a 'modifiers' struct, which is just a collection of booleans; one for each supported modifier. The supported modifiers are: shift, ctrl, alt and meta/super. * The key sym is decoded at config time using xkb_keysym_from_name(). This call does *not* depend on a keymap. * The mouse button is decoded at config time using a hardcoded mapping table (just like before). * The click count is currently hard-coded to 1. * In the keyboard enter event, all we need to do is pre-compute the xkb_mod_mask_t variable for each key/mouse binding, and find all the *key codes* that map to the (already decoded) symbol. For mouse bindings, the modifiers are the *only* reason we convert the mouse bindings at all. In fact, on button events, we check if the seat has a keyboard. If not, we use the mouse bindings from the configuration directly, and simply filter out those with a non-empty set of modifiers.
* config: wip: add support for modifiers in mouse bindingsDaniel Eklöf2020-08-13-19/+83
| | | | | | | Mouse bindings can now include modifiers. They are specified in pretty much the same way as in keyboard bindings: Control+BTN_LEFT
* config: add tweak.render-timer optionDaniel Eklöf2020-08-13-1/+25
| | | | | | | | | This can be set to 'none' (the default), 'osd', 'log' or 'both'. When 'osd' is enabled, we'll render the frame rendering time to a sub-surface after each frame. When 'log' is enabled, the frame rendering time is logged on stderr.
* config: make selection foreground/background colors configurableDaniel Eklöf2020-08-12-0/+9
| | | | | | | | | The default is still to inverse the regular foreground/background colors. If the user sets *both* of the new options, selection-foreground and selection-background, those colors will *always* be used for selected cells, instead of inverting the regular foreground/background colors.
* Convert most dynamic allocations to use functions from xmalloc.hCraig Barnes2020-08-08-1/+1
|
* Replace GCC "unused" and "format" attributes with portable macrosCraig Barnes2020-08-07-1/+2
|
* fix printf-format errors in 32-bit buildsDaniel Eklöf2020-08-06-2/+2
|
* config: handle allocation failure explicitlyCraig Barnes2020-08-04-65/+52
|
* config: move cursor.hide-when-typing to mouse.hide-when-typingDaniel Eklöf2020-08-04-4/+20
|
* config: add scrollback.multiplier optionDaniel Eklöf2020-08-03-0/+12
| | | | | | | This option is used to multiply the mouse scroll amount for mouse and trackpad based scrollback scrolling. Closes #54.
* Replace non-portable "\e" escape in string literals with "\033"Craig Barnes2020-08-02-1/+1
|
* config: clean upDaniel Eklöf2020-08-02-10/+1
| | | | | Better parsing means we catch syntax errors earlier, meaning we can remove some of the checks.
* server/client: use $WAYLAND_DISPLAY instead of $XDG_SESSION_ID in default socket pathDaniel Eklöf2020-08-02-5/+8
| | | | | | | | | Foot is a Wayland client and cannot be run outside of a Wayland session. As such, it makes more sense to use $WAYLAND_SESSION instead of $XDG_SESSION_ID in the default socket path since this makes it clearer which Wayland session we belong to. Closes #55.
* doc: foot.1: fix default path in -s,--serverDaniel Eklöf2020-08-02-1/+1
| | | | | | | | | | | | | | | | | | | The documentation incorrectly stated that the default path is $XDG_RUNTIME_DIR/foot.sock. The correct default path is * $XDG_RUNTIME_DIR/foot-$XDG_SESSION_ID.sock * $XDG_RUNTIME_DIR/foot-no-session.sock * /tmp/foot.sock Depending on whether XDG_RUNTIME_DIR and XDG_SESSION_ID has been set or not. This also removes the '<>' from the default when XDG_SESSION_ID is not set. Closes #53.
* config: pipe-*: fix length calculation of the pipe command substringDaniel Eklöf2020-07-31-1/+1
|
* config: add 'hide-when-typing'Daniel Eklöf2020-07-31-0/+4
| | | | | | When enabled, the mouse cursor is hidden when the user types in the terminal. It is un-hidden when the user moves the mouse, or when the window loses keyboard focus.
* config: configuration errors are no longer fatalDaniel Eklöf2020-07-31-78/+139
| | | | | Instead of refusing to start foot on configuration errors, we start and print a user-notification.
* config: add 'pipe-selected' key bindingDaniel Eklöf2020-07-31-0/+1
| | | | | | | This works just like pipe-visible and pipe-scrollback, but pipes the user-selected text, if any, to the external tool. Closes #51
* user-notification: 'productify' the user-warning systemDaniel Eklöf2020-07-30-14/+59
| | | | | | | | * Rename user_warning to user_notification * Add warning and error types (in addition to the existing deprecated) * Simplify logic when emitting a user notification after forking; we don't need to copy the notification data since we're in a new process and have total control over that memory.
* config: tokenize key bindings' pipe command when loading the configurationDaniel Eklöf2020-07-30-45/+32
| | | | | | This allows us to detect syntax errors early on, and is also more efficient since we don't have to re-tokenize the command line every time the binding is executed.
* config: emit a user-warning for deprecated option 'scrollback'Daniel Eklöf2020-07-29-0/+11
|