aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* Merge branch 'xtgettcap'Daniel Eklöf2022-01-14-26/+525
|\ | | | | | | Closes #846
| * doc: foot.1: XTGETTCAPDaniel Eklöf2022-01-14-0/+47
| |
| * changelog: XTGETTCAPDaniel Eklöf2022-01-14-1/+3
| |
| * readme: document XTGETTCAP behaviorDaniel Eklöf2022-01-14-0/+49
| |
| * xtgettcap: switch from a table based internal structure, to a single char arrayDaniel Eklöf2022-01-13-46/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the builtin terminfo DB as a table, with one entry per capability/value pair was ineffective memory-wise - we ended up adding ~20K to the final binary size. This patch changes the internal representation from a table, to a single NULL-separated (and NULL-terminated) char array: cap1-name \0 cap1-value \0 cap2-name \0 cap2-value \0 The capabilities are still sorted; to lookup a capability we need to scan from the beginning until we either find a match, or until the capabilities from the DB sort higher (lexicographically) than the searched-for capability. The terminfo char array is 3.3K - more better than before.
| * doc: ctlseq: add XTGETTCAPDaniel Eklöf2022-01-13-0/+3
| |
| * dcs: xtgettcap: handle boolean capabilitiesDaniel Eklöf2022-01-13-4/+13
| | | | | | | | Reply with DCS 1 + r <cap> ST
| * scripts: generate-builtin-terminfo: add custom capability ‘Co’Daniel Eklöf2022-01-13-1/+2
| | | | | | | | | | | | This is a “special feature”, similar to “TN” and “RGB”: Co for termcap colors (or colors for terminfo colors)
| * dcs: implement XTGETTCAPDaniel Eklöf2022-01-13-1/+147
| | | | | | | | | | | | | | | | | | | | | | | | We emit one DCS reply for each queried capability (like Kitty, but unlike XTerm), as this allows us to a) not skip any capabilities in the query, and b) reply with correct success/fail flag for each capability. We do not batch the entire reply - as soon as the reply for _one_ capability is done, we write it to the PTY. Closes #846
| * uri: move hex2nibble() to util.hDaniel Eklöf2022-01-13-23/+24
| |
| * script: add generate-builtin-terminfo.pyDaniel Eklöf2022-01-13-1/+213
|/ | | | | | | This script parses a terminfo source file and generates a C header file with a static struct containing terminfo names and their values. The table is sorted on the capability names
* test: config: tweak.grapheme-shaping can’t be set when grapheme-clustering has been disabledDaniel Eklöf2022-01-13-0/+5
|
* test: config: test ‘tweak’ sectionDaniel Eklöf2022-01-13-1/+70
|
* config: convert tweak.render_timer to an enumDaniel Eklöf2022-01-13-22/+42
|
* Merge branch 'bad-locale'Daniel Eklöf2022-01-13-3/+54
|\
| * main: log locale errors (in addition to adding a user notification)Daniel Eklöf2022-01-13-5/+7
| |
| * main: display warning only, when we succeed in enabling a fallback localeDaniel Eklöf2022-01-13-12/+21
| |
| * changelog: improved handling of incompatible localesDaniel Eklöf2022-01-13-0/+5
| |
| * main: try to force an UTF-8 locale if user’s locale isn’t UTF-8Daniel Eklöf2022-01-13-0/+19
| |
| * main: present invalid locale errors as a user-notificationDaniel Eklöf2022-01-13-3/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foot does not support running under non-UTF8 locales. If we detect a non-UTF8 locale, we log this and exit with an error. However, it appears a fairly common situation is this: user (knowingly or unknowingly) only configures his/hers locale in e.g. the shell RC files. These aren’t sourced when the compositor is started via a display manager. Thus, compositor key binds will fail to launch, and the user typically has no way of seeing foot’s output. So, the user proceeds to start another terminal, and from that one tries launching foot. And it works... (because the shell in the other terminal sourced the locale configuration). User is left confused and often don’t know how to debug. This patch is somewhat hackish; in addition to logging the locale error, it also pushes a user notification. For this to be visible, we need to actually start a terminal window. So, we ignore the configured shell, and we ignore any custom command line, and instead spawns “/bin/sh -c ‘’”. This allows us to get something running (that hopefully doesn’t produce too much output we can’t decode due to the non-UTF8 locale). But, it will exit immediately. So we also set the --hold flag. This works, and may be a good enough “solution”. However, it only works for standalone foot instances, not footclients.
* Merge branch 'improve-mouse-button-multi-click'Daniel Eklöf2022-01-13-0/+10
|\ | | | | | | Closes #883
| * input: reset mouse button click counter when mouse movesDaniel Eklöf2022-01-13-0/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in #883, creating a block selection (with ctrl+BTN_LEFT), then *quickly* (within 300ms from) creating a new one, will, in fact, _not_ create a new block selection, but a ‘select-word-whitespace’ selection (ctrl+BTN_LEFT-2). A similar effect can be seen with plain selections (BTN_LEFT). Click and drag to make a selection, but *release*, and make a new selection within 300ms from the initial button press, and the new selection is suddenly a word-based selection. This happens because triggering a binding does *not* reset the button click counter. So, shouldn’t we just do that? No, because we rely on this behavior to handle single-, double- and triple-click actions. If we were to reset the button click handler, then we’d have to instead delay triggering the first action with 300ms, which would make things appear laggy. If we don’t do this, it would be impossible to double- and triple-click, since the single-click action would keep resetting the click counter. This patch takes a slightly different approach; we reset the click counter when the mouse has moved “too much”. For now, “too much” is when the cursor has moved to a different cell. This way, single-, double- and triple-clicks continue to work as before. But, creating actual selections, and then quickly releasing and starting a new selection produces the expected results. Closes #883
* input: reset view when pasting from primaryDaniel Eklöf2022-01-11-0/+3
| | | | | We’re already doing this for keyboard input, and regular clipboard pastes.
* Merge branch 'wl-output-version-4'Daniel Eklöf2022-01-06-1/+9
|\ | | | | | | Closes #876
| * wayland: don’t try to bind wl_output version 4 unconditionallyDaniel Eklöf2022-01-06-1/+9
|/ | | | | | | | | | | The compositor may offer version 4, while we’re still linked against an old libwayland that does not implement version 4. While we properly #ifdef the callbacks from version 4, we were still requesting version 4 (if offered by the compositor), even when compiled against a too old libwayland. Closes #876
* Merge branch 'argc-is-zero'Daniel Eklöf2022-01-02-6/+11
|\
| * changelog: fixed failing to launch when exec(3):ed with an empty argvDaniel Eklöf2022-01-01-0/+1
| |
| * foot{,client}: handle argc == 0Daniel Eklöf2022-01-01-6/+10
|/ | | | | | | | | | | | | | Our getopt_long() based argument parser would (correctly) break out of the while loop immediately. However, we would then proceed and decrement ‘argc’ by 1, resulting in it being -1. This was then passed to the terminal constructor, which passed it on to the client application fork+exec logic. That finally resulted in an exec(3) failure: err: slave.c:339: SHELL=/bin/zsh: failed to execute: No such file or directory err: fdm.c:215: no such FD: 7 info: main.c:604: goodbye
* doc: ctlseq: add missing ‘[‘ to a couple of CSI sequencesDaniel Eklöf2022-01-01-5/+5
|
* doc: ctlseq: kitty kbd: swap name/fromDaniel Eklöf2022-01-01-4/+4
|
* doc: ctlseq: kitty keyboard protocolDaniel Eklöf2022-01-01-0/+17
|
* doc: ctlseq: private mode 1016 - SGR-PixelsDaniel Eklöf2022-01-01-0/+3
|
* Merge branch 'sgr-pixels'Daniel Eklöf2022-01-01-8/+44
|\ | | | | | | Closes #762
| * SGR-Pixels mouse mode, closes #762Autumn Lamonte2022-01-01-8/+44
|/
* test: config: colors: test ‘256’ is an invalid keyDaniel Eklöf2021-12-30-0/+2
|
* test: config: test colors sectionDaniel Eklöf2021-12-29-1/+56
|
* test: config: csd: test color optionsDaniel Eklöf2021-12-29-6/+12
|
* test: config: add test_color() utility functionDaniel Eklöf2021-12-29-0/+34
|
* test: config: test csd sectionDaniel Eklöf2021-12-29-0/+37
|
* test: config: test mouse sectionDaniel Eklöf2021-12-29-0/+18
|
* test: config: test cursor sectionDaniel Eklöf2021-12-29-0/+27
|
* test: config: test URL sectionDaniel Eklöf2021-12-29-0/+24
|
* test: config: rename ‘conf_ptr’ -> ‘ptr’Daniel Eklöf2021-12-29-21/+21
|
* test: config: scrollback: test indicator-posititionDaniel Eklöf2021-12-29-1/+9
|
* test: config: main: test dpi-aware, selection-target and initial-window-modeDaniel Eklöf2021-12-29-3/+27
|
* test: config: add test_enum() utility functionDaniel Eklöf2021-12-29-0/+27
|
* render: csd: scale border width when rendering the CSD border’s visible partDaniel Eklöf2021-12-29-2/+5
|
* render: limit the unfocused block cursor’s outline widthDaniel Eklöf2021-12-29-4/+5
| | | | Ensure the outline width doesn’t exceed the cell width/height.
* Merge branch 'scale-outline-of-unfocused-block-cursor'Daniel Eklöf2021-12-29-4/+9
|\
| * render: scale the width out the outline of the unfocused block cursorDaniel Eklöf2021-12-28-4/+9
|/
* Merge branch 'apply-scrollback-multiplier-in-alternate-scroll-mode'Daniel Eklöf2021-12-28-7/+14
|\
| * input: apply scrollback.multplier in alterate scroll modeDaniel Eklöf2021-12-28-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, foot only applied [scrollback].multiplier on the normal screen, never the alt screen. However, scrolling can be done in two ways on the alt screen: If the application has enabled mouse support, we simply pass on the mouse scroll events to the application. Here, it makes sense to not apply the multiplier, and instead let the application choose how much to scroll for each scroll event. But, if the application has not enabled mouse support, we can still scroll by simulating the arrow keys being pressed - alternate scrolling (private mode 1007). This is enabled by default in foot (but can be disabled in foot.ini with the [mouse].alternate-scroll-mode setting). In this mode, it makes more sense to apply the multiplier. And that’s what this patch changes - the multiplier is now applied, on the alt screen, when the application has not enabled mouse support, and alternate scrolling has been enabled in foot. Closes #859
| * term_mouse_grabbed(): make ‘seat’ argument constDaniel Eklöf2021-12-28-3/+4
|/
* changelog: irc+ircs added to default value of url.protocolsDaniel Eklöf2021-12-27-0/+2
|
* Merge branch 'irc-url'Daniel Eklöf2021-12-27-1/+3
|\
| * Add irc:// to default URL schemesSimon Ser2021-12-27-1/+3
|/
* term: print: erase existing OSC-8 URIDaniel Eklöf2021-12-26-1/+4
| | | | | | | | | | If we have an “active” OSC-8 URI, term_print() would correctly replace an existing URI with the new one. But, if we don’t have an active URI, an existing URI was not erased. This can be reproduced with e.g echo -e '\e]8;;http://foo.bar\e\\foobar\e]8;;\e\\\b\b\b\b\b😀\n'
* test: config: fix format specifier: uint32_t needs %u, not %huDaniel Eklöf2021-12-26-1/+1
|
* Merge branch 'term-erase-refactor'Daniel Eklöf2021-12-26-49/+52
|\
| * term_erase(): replace coord-typed arguments with regular intsDaniel Eklöf2021-12-26-49/+52
|/
* Merge branch 'cell-colors-use-index'Daniel Eklöf2021-12-26-79/+61
|\
| * sixel: VT state’s bg color may now be an index, rather than an actual color valueDaniel Eklöf2021-12-26-3/+18
| |
| * csi: store color index, not actual color, in cell’s fg/bg attributesDaniel Eklöf2021-12-26-74/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using indexed colors (i.e. SGR 30/40/90/100), store the index into the cell’s fg/bg attributes, not the actual color value. This has a couple of consequences: Color table lookup is now done when rendering. This means a rendered cell will always reflect the *current* color table, not the color table that was in use when the cell was printed to. This simplifies the OSC-4/104 logic, since we no longer need to update the grid - we just have to damage it to trigger rendering. Furthermore, this change simplifies the VT parsing, since we no longer need to do any memory loads (except loading the SGR parameter values), only writes.
| * csi: no need to set VT state’s fg/bg to the default ones on SGR resetDaniel Eklöf2021-12-26-2/+0
|/
* test: config: test ‘scrollback’ sectionDaniel Eklöf2021-12-26-0/+20
|
* test: config: add test_double() utility functionDaniel Eklöf2021-12-26-0/+37
|
* test: config: add test_uint32() utility functionDaniel Eklöf2021-12-26-0/+37
|
* 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.
* test: config: bindings: verify pipe argvDaniel Eklöf2021-12-25-3/+39
|
* test: config: test [bell].command (spawn template)Daniel Eklöf2021-12-25-2/+2
|
* test: config: test [main].notify (spawn template)Daniel Eklöf2021-12-25-1/+2
|
* test: config: add test_spawn_template() utility functionDaniel Eklöf2021-12-25-0/+42
|
* tokenize: free content of argv on failure, and reset the argv pointerDaniel Eklöf2021-12-25-3/+4
| | | | | This fixes a memory leak when we failed to parse a command line (for example, because it contained an unclosed quote).
* test: config: ‘bell’ sectionDaniel Eklöf2021-12-25-0/+19
|
* changelog: grammarDaniel Eklöf2021-12-23-2/+2
|
* Merge branch 'crash-on-csd-size-1'Daniel Eklöf2021-12-23-6/+20
|\ | | | | | | Closes #857
| * render: make sure ‘maximized’ button doesn’t use negative coordinatesDaniel Eklöf2021-12-22-1/+7
| |
| * config: csd.border_width now always reflects the full/total widthDaniel Eklöf2021-12-22-5/+13
|/
* meson: generate-version: use CURRENT_SOURCE_DIR instead of SOURCE_ROOTDaniel Eklöf2021-12-21-1/+1
|
* slave: re-use ‘struct sigaction’ variable when resetting SIGHUP+SIGPIPEDaniel Eklöf2021-12-18-2/+4
|
* slave: restore SIGPIPEDaniel Eklöf2021-12-18-1/+2
|
* Merge branch 'error-on-empty-key-or-mouse-binding'Daniel Eklöf2021-12-18-4/+18
|\ | | | | | | Closes #851
| * test: config: verify setting an empty key/mouse binding failsDaniel Eklöf2021-12-18-4/+10
| |
| * config: error out on empty key- or mouse bindingDaniel Eklöf2021-12-18-0/+8
|/ | | | Closes #851
* Merge branch 'shm-buffer-busy-sometimes-not-set'Daniel Eklöf2021-12-18-10/+21
|\ | | | | | | Closes #844
| * shm: get_buffer(): make sure buffer->busy is setDaniel Eklöf2021-12-18-10/+21
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | When going through the cached buffers, we only set buffer->busy on the *first* re-usable buffer we found. In some cases, we will find more than one re-usable buffer. In this case, we select the “youngest” one (i.e the one most recently used, in the hopes that we can use damage tracking instead of re-rendering the entire buffer). If the “current” buffer is younger than the previously detected, re-usable, buffer, then we unref:ed the previously selected buffer, and replaced it with the current one. But, we did not sanitize it. That is, we did not: * set buffer->busy * clear its dirty region * clear its scroll damage That buffer would eventually get rendered to, and committed to the compositor. Later, the compositor would free it. And there, in our buffer_release() callback, we’d assert that buffer->busy was set. And fail. Closes #844
* Merge branch 'lower-case-all-theme-names'Daniel Eklöf2021-12-18-0/+6
|\
| * themes: consistently use snake-case in theme namesDaniel Eklöf2021-12-18-0/+6
|/
* Merge branch 'apprentice-theme'Daniel Eklöf2021-12-18-0/+26
|\
| * Add Apprentice themeOğuz Ersen2021-12-17-0/+26
|/
* Merge branch 'kitty-kbd-dont-fallback-to-xkb-symbol'Daniel Eklöf2021-12-16-4/+6
|\
| * input: kitty: don’t fallback to the XKB symbolDaniel Eklöf2021-12-16-4/+6
|/ | | | | | | | | | | When handling “generic” keys (i.e. keys not in the Kitty keymap), we use the pressed key’s Unicode codepoint as “key” in the kitty CSI. If we failed to convert the XKB symbol to a Unicode codepoint, we used to (before this patch), fallback to using the XKB symbol as is. This can never be correct... and it caused us to emit a meaningless CSI for XKB_KEY_ISO_Next_Group, which confused e.g. Kakoune.
* Merge branch 'zooming-with-dpi-aware-no'Daniel Eklöf2021-12-14-8/+14
|\ | | | | | | Closes #842
| * term: font_size_adjust: use DPI=96 when font is *not* scaled by DPIDaniel Eklöf2021-12-14-8/+14
|/ | | | Closes #842
* Merge branch 'wl-output-name-description'Daniel Eklöf2021-12-14-6/+39
|\
| * wayland: add wl_output.name() and wl_output.description()Daniel Eklöf2021-12-13-1/+28
| | | | | | | | | | | | | | | | These are new in version 4 of the wl_output interface (first included in wayland-1.20). This allows us to get the name and description of the outputs, also on compositors without the XDG output interface.
| * wayland: estimate scaled (logical) width/height, if not providedDaniel Eklöf2021-12-13-5/+11
|/ | | | | | | | | | | This makes us slightly more resilient against a missing XDG output interface. We use the “real” (the physical) dimensions, combined with the scaling factor, to estimate the logical dimensions. This works out correctly with non-fractional scaling, but not otherwise.
* input: kitty: return the result of term_to_slave()Daniel Eklöf2021-12-12-2/+1
| | | | If term_to_slave() fails, then the key wasn’t ‘handled’...
* Merge branch 'kitty-static-keymap'Daniel Eklöf2021-12-11-142/+172
|\