aboutsummaryrefslogtreecommitdiff
path: root/config.c (follow)
Commit message (Collapse)AuthorAgeLines
* config: bind shift+insert to primary-paste by defaultDaniel Eklöf2020-10-11-0/+1
|
* config: fix "-Wformat-nonliteral" warningsCraig Barnes2020-10-11-3/+3
|
* config: ignore key/value pairs following an invalid section nameDaniel Eklöf2020-10-11-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-10-11-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
|
* term: add capability to print warnings *inside* the terminalDaniel Eklöf2020-07-29-0/+6
| | | | | This is intended to be used to print e.g. deprecation warnings inside the terminal, *before* the shell is started.
* config: add scrollback sectionDaniel Eklöf2020-07-29-4/+30
| | | | | | | | | * Move 'scrollback' to 'scrollback.lines' * Move (the new) 'scrollback-indicator-*' options to 'scrollback.indicator-*' Log a deprecation warning when the old 'scrollback' option is used, but don't remove it, yet.
* search/config: configurable key bindings for (scrollback) search modeDaniel Eklöf2020-07-29-9/+124
|
* config: fix check for scrollback-indicator-format=percentageDaniel Eklöf2020-07-28-1/+1
|
* config: add free-form text variant to 'scrollback-indicator-format'Daniel Eklöf2020-07-28-5/+14
| | | | And make the empty string the new default.
* config: handle trailing comments and empty valuesDaniel Eklöf2020-07-28-16/+32
|
* config: rename scrollback-indicator-style to scrollback-indicator-positionDaniel Eklöf2020-07-27-6/+6
|
* config: scrollback-indicator-format: percent -> percentageDaniel Eklöf2020-07-26-6/+8
|
* config: fix error message for 'scrollback-indicator-style'Daniel Eklöf2020-07-26-1/+1
|
* config: fix key check for 'scrollback-indicator-style'Daniel Eklöf2020-07-26-1/+1
|
* config: rename scrollback-indicator-style value 'static' to 'fixed'Daniel Eklöf2020-07-25-3/+3
|
* config: rename scrollback-indicator-style value 'moving' to 'relative'Daniel Eklöf2020-07-25-2/+2
|
* config: rename scrollback-indicator to scrollback-indicator-styleDaniel Eklöf2020-07-25-11/+26
| | | | | | | | And turn it from a boolean to an enum. It can be set to: * `none` - disables the indicator * `static` - always rendered near the top of the window * `moving` - position reflects the scrollback position
* config: add 'scrollback-indicator-format' optionDaniel Eklöf2020-07-24-0/+14
| | | | | The value of this option must be either 'percent', or 'line', and determines _how_ we render the scrollback indicator.
* config: rename show-scrollback-position to scrollback-indicatorDaniel Eklöf2020-07-24-3/+3
|
* config: add 'show-scrollback-position' option to footrcDaniel Eklöf2020-07-24-0/+4
|
* config: oopsie, need to use strndup() on the pipe commandDaniel Eklöf2020-07-15-1/+1
| | | | Since it isn't NULL-terminated.
* config: change syntax for pipe-command in key bindingDaniel Eklöf2020-07-15-7/+18
| | | | | | | | | | | | | | | | | | | The pipe command can contain almost all printable characters. In particular, we can expect it to contain '='. Having the pipe command as part of the key breaks the key/value splitting. Change it so that it is instead an optional initial part of the value, enclosed in '[]'. I.e. instead of pipe-visible:cmd=binding we now need to write pipe-visible=[cmd] binding
* conf: bindings: allow several mappings for the same actionDaniel Eklöf2020-07-15-66/+137
| | | | | If the bindings has different pipe command associated with them, treat them as different actions.
* config: add support for appending a 'spawn' argument to key bindingsDaniel Eklöf2020-07-15-3/+16
| | | | | | | | | | | | A key binding may now have an optional ':<cmd>' string appended to the key. This is intended to be used like so: pipe-scrollback:sh -c "cat > file"=Print TODO: we still only allow one *action*. Meaning you still cannot specify multiple pipe-scrollback bindings, for example.
* conf: add definitions for pipe-{scrollback,view} bindingsDaniel Eklöf2020-07-15-0/+2
|
* term: don't use deprecated fcft_size_adjust()Daniel Eklöf2020-07-07-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | When resizing the font on-the-fly, we now do a complete font-reload (this is basically what fcft_size_adjust() did anyway). To get the correct size, we maintain the current size ourselves. We get the initial size from the user-provided font pattern, by converting the string to an FcPattern, and using FcPatternGet() to retrieve both the FC_SIZE and FC_PIXEL_SIZE attributes. These attributes are then removed from the pattern, and the pattern is converted back to a string. The terminal struct maintains a copy of the font sizes. These are initially set to the sizes from the config. When the user resizes the font, the terminal-local sizes are adjusted. To ensure the primary and user-configured fallback fonts are resizes equally much, convert any pixel sizes to point sizes at this point. When the font size is reset, we reload the font sizes from the config (thus once again returning actual pixel-sizes, if that's what the user has configured).
* config: add 'blink' option to cursor section in footrcDaniel Eklöf2020-06-30-0/+4
| | | | | This option controls whether the default cursor should blink or not. The default is to *not* blink.
* util.h: new header file defining commonly used macrosDaniel Eklöf2020-05-01-3/+1
|
* misc: replace all explicit zero-initializers with empty initializersDaniel Eklöf2020-04-13-1/+1
|
* config: use an unsigned constant, since we're shifting 31 bitsDaniel Eklöf2020-04-09-2/+2
|
* conf: add 'title' conf option and --title command line optionDaniel Eklöf2020-04-01-0/+7
|
* conf: add app-id config option and --app-id command line optionDaniel Eklöf2020-04-01-0/+7
|
* Merge branch 'scroll-damage-performance'Daniel Eklöf2020-03-29-0/+14
|\
| * Merge branch 'master' into scroll-damage-performanceDaniel Eklöf2020-03-27-1/+17
| |\
| * | shm: make max pool size user configurable (via a 'tweak' setting)Daniel Eklöf2020-03-25-0/+14
| | |
* | | conf: rename 'startup-mode' to 'initial-window-mode'Daniel Eklöf2020-03-28-1/+1
| |/ |/|
* | config: add 'startup-mode' optionDaniel Eklöf2020-03-26-1/+17
|/ | | | | This option controls the initial window mode: windowed, maximized or fullscreen. The default is windowed.
* search: replace hard-coded key bindings with "user configurable" onesDaniel Eklöf2020-03-18-9/+25
| | | | | | | | They aren't really user configurable. At least not yet. However, with this, we now handle raw key codes just like the normal key bindings. Meaning, e.g. ctrl+g, ctrl+a, ctrl+e etc now works while searching with e.g. a russian layout.
* conf: bindings: case insensitive matching against 'none'Daniel Eklöf2020-03-18-1/+1
|
* conf: change default key binding for spawn-terminal to ctrl+shift+nDaniel Eklöf2020-03-17-1/+1
|
* conf: make delayed rendering timeouts configurableDaniel Eklöf2020-03-17-0/+52
| | | | | | | | | | | This adds an undocumented 'tweak' section to footrc, with two new options: * delayed-render-lower * delayed-render-upper Both takes an integer value, representing the lower/upper timeout values (in nano seconds) for delayed rendering.
* Merge branch 'master' into bindingsDaniel Eklöf2020-03-12-5/+10
|\
| * config: add str_to_bool()Daniel Eklöf2020-03-11-5/+10
| |
* | config: key-bindings: verify key combo isn't already mapped to another actionDaniel Eklöf2020-03-12-11/+47
| |
* | config: mouse-bindings: verify button isn't already mappedDaniel Eklöf2020-03-12-1/+25
| | | | | | | | | | | | | | | | | | A button may only be mapped to a single action. Detect when the user tried to map the same button to multiple actions and error out. To clear a binding (for example, to free up a button from the default bindings), one can set the action it is bound to to `NONE` (e.g. `primary-paste=NONE`).
* | config/input: implement mouse bindingsDaniel Eklöf2020-03-12-10/+51
| | | | | | | | | | | | | | | | | | | | * New config section, "mouse-bindings", where bindings are defined on the form "action=BTN_<name> * pointer_button() handler now scans the bindings list instead of hardcoding primary-paste to BTN_MIDDLE. * The implementation handles single- double- and triple clicks in the bindings, but there is currently no way to define anything but a single-click binding in the configuration.
* | config: 'invalid key' is always an error, not a warningDaniel Eklöf2020-03-12-4/+3
| |
* | bindings: add minimize/maximize/fullscreen actionsDaniel Eklöf2020-03-12-0/+6
| | | | | | | | These actions are by default not bound to anything.
* | config: load custom key bindingsDaniel Eklöf2020-03-09-22/+74
| | | | | | | | | | | | | | | | This adds parsing of a new section - "key-bindings" - where the user can configure the key bindings on the form "action=combo1 .. comboN" The validity of the key combinations are checked with the default XKB keymap.
* | Merge branch 'master' into bindingsDaniel Eklöf2020-03-09-2/+12
|\|
| * server/client: add XDG_SESSION_ID to the default socket pathDaniel Eklöf2020-03-09-2/+6
| | | | | | | | This allows multiple foot servers to run in multiple sessions.
| * config: csd: error out on invalid keyDaniel Eklöf2020-03-08-0/+6
| |
* | input: convert the rest of the normal key bindings to configurable bindingsDaniel Eklöf2020-03-08-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New actions defined and implemented: * scrollback up/down * font size up/down/reset * spawn terminal Break out key combo parsing to a new function, parse_key_binding_for_action(). This function parses a string containing one or more space separated key combo definitions on the form (mod1+mod2+...+key), where key is a XKB key name (e.g. KP_Add). Convert all hardcoded key bindings to configuration based bindings. These still cannot actually be configured by the user, but at least lives in the conf struct.