aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* meson/pkgbuild: bump version to 1.8.11.8.1Daniel Eklöf2021-07-01-2/+2
|
* changelog: prepare for 1.8.1Daniel Eklöf2021-07-01-5/+2
|
* Merge branch 'master' into releases/1.8Daniel Eklöf2021-07-01-193/+1509
|\
| * changelog: move grapheme cluster width entry to ‘changed’, and rewrite itDaniel Eklöf2021-07-01-2/+7
| |
| * Merge branch 'max-grapheme-width-is-2'Daniel Eklöf2021-07-01-7/+46
| |\
| | * config: rename at-most-2 (value for grapheme-width-method) to double-widthDaniel Eklöf2021-07-01-10/+10
| | |
| | * config: add tweak.grapheme-width-method=wcswidth|at-most-2Daniel Eklöf2021-07-01-5/+46
| | |
| | * vt: limit grapheme width to 2 cellsDaniel Eklöf2021-07-01-5/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | All emoji graphemes are double-width. Foot doesn’t support non-latin scripts. Ergo, this should result in the Right Thing, even though we’re not doing it the Right Way. Note that we’re now breaking cursor synchronization with nearly all applications. But the way I see it, the applications need to be updated.
| * config: add unit test for config_clone()Daniel Eklöf2021-06-30-0/+21
| | | | | | | | | | | | | | | | We’re mainly interested in seeing that we don’t leak memory, or double free heap allocated data. Valgrind and/or gcc/clang sanitizers are best at this, hence the very few asserts in the test itself.
| * config: NOINLINE a couple of functions doing tll operationsDaniel Eklöf2021-06-30-4/+4
| |
| * Merge branch 'remove-unused-key-bindings'Daniel Eklöf2021-06-30-32/+134
| |\ | | | | | | | | | Closes #614
| | * config: remove replaced/removed key bindings, instead of marking as ‘unused’Daniel Eklöf2021-06-30-32/+134
| |/ | | | | | | | | | | | | | | | | | | | | | | Instead of keeping removed/replaced key bindings in the key binding array (marked as ‘unused’), remove them, by compacting the array. The invariant is thus that there should be *no* entries in the key binding list with the `BIND_ACTION_NONE` for action. Add code to debug builds that verifies this, plus a unit test. Closes #614
| * render: don’t look at glyphs[0]->cols when determining if overflow should be allowedDaniel Eklöf2021-06-30-1/+1
| | | | | | | | | | Use ‘cell_cols’ instead, which is the number of cells we’ll actually be using.
| * terminfo: add Tc, setrgbf and setrgbb capabilitiesCraig Barnes2021-06-29-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These extensions are used by tmux and neovim, in order to make use of 24-bit colors without facing the problems that plague the `RGB` capability. This should allow 24-bit colors to work "out of the box" in tmux, without the usual workaround of adding: set-option -ga terminal-overrides ",foot*:Tc" ...to ~/.tmux.conf. See also: * https://github.com/kovidgoyal/kitty/commit/18fe2e8dfa34038aabd5c3a2fdb3624e2b27932a#commitcomment-31373962 * https://github.com/neovim/neovim/blob/f83c25942dd8b94ad5218ce78b9e6fb86d2f0358/runtime/doc/term.txt#L123-L139 * https://github.com/tmux/tmux/blob/b1a8c0fe022e99cffb0fb4f321740464f35bc6b9/CHANGES#L988-L989 Closes #615
| * input: ignore ‘unused’ URL key bindings when mapping bindings to current keymapDaniel Eklöf2021-06-28-2/+0
| | | | | | | | | | This is a temporary fix for #614. Long term fix is to remove the ‘replaced’ bindings from the array at config time.
| * term: destroy: free URLs before free:ing the gridsDaniel Eklöf2021-06-28-3/+5
| | | | | | | | | | Fixes use-after-free when destroying a terminal with “live” URLs (i.e. when URL mode is active).
| * log: add LOG_CLASS_NONE and use as initializer for log_levelCraig Barnes2021-06-26-93/+113
| | | | | | | | | | | | | | | | | | | | | | | | This means that logging will be completely disabled until log_init() has been called, which is useful to prevent log spam when running UNITTEST{} blocks in debug builds. Note that this doesn't change the default log level at runtime, which was already being set to LOG_CLASS_INFO in main.c and client.c. The new log level is also exposed to the command-line interface as `--log-level=none`, which allows disabling logging entirely.
| * vt: don’t reset utf8proc grapheme state when we’re not at a grapheme breakDaniel Eklöf2021-06-25-5/+12
| |
| * doc: benchark: laptop results for 1.8.0Daniel Eklöf2021-06-25-28/+585
| |
| * doc: benchmark: add --dat to vtebench command lineDaniel Eklöf2021-06-25-1/+1
| |
| * doc: benchmarks: update desktop results with 1.8.0Daniel Eklöf2021-06-25-19/+566
| |
| * changelog: add new ‘unreleased’ sectionDaniel Eklöf2021-06-25-0/+11
| |
| * Merge branch 'releases/1.8'Daniel Eklöf2021-06-25-9/+9
| |\ | |/ |/|
* | generate-version: fix regression where a tagged version was parsed wrong1.8.0Daniel Eklöf2021-06-25-4/+5
| | | | | | | | | | The regexps didn’t work when the “extra” portion of “git describe” was missing.
* | meson/pkgbuild: bump version to 1.8.0Daniel Eklöf2021-06-25-2/+2
| |
* | changelog: prepare for 1.8.0Daniel Eklöf2021-06-25-3/+2
|/
* wayland: regression: properly instantiate CSDs when there’s no decoration managerDaniel Eklöf2021-06-24-2/+1
| | | | | | | | | | * Set win->configure.csd_mode, not win->csd_mode. Otherwise our ‘configure’ handler will swap out the CSD_YES we set, for CSD_UNKNOWN(?), resulting in no CSDs at all. * Don’t instantiate the CSDs in wayl_win_init(), let the ‘configure’ event handler do that. Just like it does when we have a decoration manager emitting decoration configure events.
* changelog: spelling; add missing ‘l’ in ‘experimental’Daniel Eklöf2021-06-24-1/+1
|
* pkgbuild: add libutf8proc dependencyDaniel Eklöf2021-06-24-1/+1
|
* meson: add utf8proc dep to all libraries pulling in terminal.hDaniel Eklöf2021-06-24-3/+3
|
* vt: utf8: rotate instead of just shifting when updating compose keyDaniel Eklöf2021-06-24-4/+7
| | | | This reduces the number of collisions in even more workloads.
* vt: improved key hash algorithm -> reduces number of key collisionsDaniel Eklöf2021-06-24-3/+10
|
* term: CELL_COMB_CHARS chars are keys, not indices -> more range is betterDaniel Eklöf2021-06-24-3/+4
| | | | | Bump the available key range to 30 bits. This helps reduce key collisions when handling a large amount of grapheme clusters.
* composed: insert: require key to be uniqueDaniel Eklöf2021-06-24-15/+9
|
* install: add -Dgrapheme-clustering to the list of custom meson optionsDaniel Eklöf2021-06-24-0/+1
|
* Merge branch 'harfbuzz'Daniel Eklöf2021-06-24-182/+518
|\
| * client: add +/-graphemes to version outputDaniel Eklöf2021-06-24-2/+3
| |
| * foot: add +/-graphemes to version outputDaniel Eklöf2021-06-24-2/+3
| |
| * features: add feature_graphemes()Daniel Eklöf2021-06-24-0/+9
| | | | | | | | | | Returns true if we’re compiled with grapheme shaping support, false otherwise.
| * changelog: describe what (does not) happens when grapheme-shaping=noDaniel Eklöf2021-06-24-0/+5
| |
| * changelog: composed -> combiningDaniel Eklöf2021-06-24-2/+2
| |
| * changelog: put emphasis on ‘opt-in’ as wellDaniel Eklöf2021-06-24-1/+1
| |
| * changelog: updates to “grapheme shaping”Daniel Eklöf2021-06-24-4/+9
| |
| * vt: codespell: bumb -> bumpDaniel Eklöf2021-06-24-1/+1
| |
| * composed: store compose chains in a binary search treeDaniel Eklöf2021-06-24-84/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation stored compose chains in a dynamically allocated array. Adding a chain was easy: resize the array and append the new chain at the end. Looking up a compose chain given a compose chain key/index was also easy: just index into the array. However, searching for a pre-existing chain given a codepoint sequence was very slow. Since the array wasn’t sorted, we typically had to scan through the entire array, just to realize that there is no pre-existing chain, and that we need to add a new one. Since this happens for *each* codepoint in a grapheme cluster, things quickly became really slow. Things were ok:ish as long as the compose chain struct was small, as that made it possible to hold all the chains in the cache. Once the number of chains reached a certain point, or when we were forced to bump maximum number of allowed codepoints in a chain, we started thrashing the cache and things got much much worse. So what can we do? We can’t sort the array, because a) that would invalidate all existing chain keys in the grid (and iterating the entire scrollback and updating compose keys is *not* an option). b) inserting a chain becomes slow as we need to first find _where_ to insert it, and then memmove() the rest of the array. This patch uses a binary search tree to store the chains instead of a simple array. The tree is sorted on a “key”, which is the XOR of all codepoints, truncated to the CELL_COMB_CHARS_HI-CELL_COMB_CHARS_LO range. The grid now stores CELL_COMB_CHARS_LO+key, instead of CELL_COMB_CHARS_LO+index. Since the key is truncated, collisions may occur. This is handled by incrementing the key by 1. Lookup is of course slower than before, O(log n) instead of O(1). Insertion is slightly slower as well: technically it’s O(log n) instead of O(1). However, we also need to take into account the re-allocating the array will occasionally force a full copy of the array when it cannot simply be growed. But finding a pre-existing chain is now *much* faster: O(log n) instead of O(n). In most cases, the first lookup will either succeed (return a true match), or fail (return NULL). However, since key collisions are possible, it may also return false matches. This means we need to verify the contents of the chain before deciding to use it instead of inserting a new chain. But remember that this comparison was being done for each and every chain in the previous implementation. With lookups being much faster, and in particular, no longer requiring us to check the chain contents for every singlec chain, we can now use a dynamically allocated ‘chars’ array in the chain. This was previously a hardcoded array of 10 chars. Using a dynamic allocated array means looking in the array is slower, since we now need two loads: one to load the pointer, and a second to load _from_ the pointer. As a result, the base size of a compose chain (i.e. an “empty” chain) has now been reduced from 48 bytes to 32. A chain with two codepoints is 40 bytes. This means we have up to 4 codepoints while still using less, or the same amount, of memory as before. Furthermore, the Unicode random test (i.e. write random “unicode” chars) is now **faster** than current master (i.e. before text-shaping support was added), **with** test-shaping enabled. With text-shaping disabled, we’re _even_ faster.
| * term: bump compose chain char array to 10 charsDaniel Eklöf2021-06-24-1/+1
| | | | | | | | There are some very long sequences out there... e.g. 👩🏼‍❤️‍💋‍👨🏽
| * changelog: add a “grapheme shaping” sectionDaniel Eklöf2021-06-24-0/+53
| |
| * doc: foot.ini: grapheme-shaping: mention regular compose charactersDaniel Eklöf2021-06-24-2/+4
| |
| * render: use cell cols from compose chain, not graphemeDaniel Eklöf2021-06-24-1/+2
| | | | | | | | | | | | fcft’s view of how many columns a grapheme cluster is may differ from our own. Make sure the rendered glyph matches the number of columns that were allocated when the cluster was printed.
| * scripts: generate-alt-random: add emoji sequencesDaniel Eklöf2021-06-24-1/+1
| |
| * vt: utf8: don’t scan *all* previous chainsDaniel Eklöf2021-06-24-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking if we already have a compose chain for the current sequence of characters, don’t search the list from the beginning, unless we have to. Taking the following things into consideration: * New compose chains are always appended at the end of the list * If the current sequence is 3 or more characters, it *must* consist of an existing compose chain, plus the new character. Thus, when searching, start at index 0 if we only have two characters, since then the base cell originally contained a regular base character, and not a compose chain. I.e. the new chain may be _anywhere_ in the chain list. If however we have a sequence of three or more characters, start at the index the *base* chain was at. If the chain we’re searching for exists, it *must* have been added *after* the base chain, and thus it *must* be located *after* the base chain in the chain list.
| * vt: utf8: de-duplicate; jump to end of function to print to gridDaniel Eklöf2021-06-24-26/+25
| |
| * render: don’t modify the cell’s x position. Fixes broken underlinesDaniel Eklöf2021-06-24-6/+7
| |
| * vt: utf8-print: don’t build a compose chain on a zero-width base characterDaniel Eklöf2021-06-24-87/+89
| |
| * term: lower maximum number of characters in a compose chainDaniel Eklöf2021-06-24-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the grapheme cluster segmentation work, we limited the number of combining characters to base+5. I.e. 6 in total. For a while now, we’ve had it bumped all the way up to 20. This was the reason the unicode-random benchmark ran so much slower (i.e. cache contention). Looking at emoji’s, there are a couple that need 6 code points, and *three* that needs 7. Now, with the limit at 7 chars, and the new ‘width’ member, the composed struct is 8 bytes larger than before.
| * vt: utf8-print: check base character before count when looking for existing compose chainDaniel Eklöf2021-06-24-2/+2
| | | | | | | | | | Count is more likely to be the same for many chains. Thus we’re likely to fail sooner by checking the base character first.
| * render: we’ve already assigned ‘base’ a couple of lines higher upDaniel Eklöf2021-06-24-2/+1
| |
| * vt: don’t call wcwidth() on all combining characters every time we addDaniel Eklöf2021-06-24-11/+7
| | | | | | | | | | | | | | We already have all the widths needed to calculate the new one; it’s the base characters width (base_width), or the previous combining chain’s width (composed->width) plus the new characters’s width (width).
| * vt: presentation selectors may be anywhere in the clusterDaniel Eklöf2021-06-24-8/+10
| |
| * render: repair parenthesis after rebaseDaniel Eklöf2021-06-24-5/+5
| |
| * render: ensure ‘cell_cols’ have been initializedDaniel Eklöf2021-06-24-1/+1
| |
| * render: handle fcft_glyph_rasterize() failure correctlyDaniel Eklöf2021-06-24-3/+8
| |
| * render: use column count from grapheme instead of first glyph, when we have oneDaniel Eklöf2021-06-24-2/+8
| |
| * vt: don’t force cols=2 when we see an emoji variant selectorDaniel Eklöf2021-06-24-1/+3
| | | | | | | | | | Fish appears to be the only shell expecting this. The rest probably just does wcswidth(), like usual.
| * vt: cache grapheme cluster width in composed structDaniel Eklöf2021-06-24-12/+11
| | | | | | | | | | | | * Use regular wcswidth() to calculate the width * Explicitly set to ‘2’ if we see a emoji variant selector * Cache the result in the composed struct
| * wip: grapheme shapingDaniel Eklöf2021-06-24-175/+337
|/
* Merge branch 'sixel-heap-user-after-free-after-blending'Daniel Eklöf2021-06-24-12/+10
|\
| * sixel: fix crash when splitting up an image across the scrollbackDaniel Eklöf2021-06-24-12/+10
|/ | | | | | | | | | | | | | | If an image was split up across the scrollback, and the first image chunk was resized due to it being blended with an already existing sixel, we crashed. The reason being the second chunk, emitted *after* the scrollback, tried to memcpy() image data from a now-free:d image buffer. The fix is pretty simple: create copies for *all* chunks when an image has to be split up across the scrollback. Previously, the first chunk re-used the source image buffer. Closes #608
* Merge branch 'custom-terminfo-install-location'Daniel Eklöf2021-06-24-7/+45
|\ | | | | | | Closes #569
| * changelog: -Dterminfo-install-location meson command line optionDaniel Eklöf2021-06-23-0/+2
| |
| * install: add the new ‘terminfo-install-location’ optionDaniel Eklöf2021-06-23-4/+28
| | | | | | | | | | | | | | And flesh out the description of the ‘terminfo’ option, and how it relates to the new ‘terminfo-install-location’. Also add instructions on how to manually generate the terminfo files.
| * meson: add -Dterminfo-install-location=disabled|custom-pathDaniel Eklöf2021-06-23-3/+15
|/ | | | | | | | | | | | | | | | Add a new meson option, ‘terminfo-install-location’, that allows you to customize _where_ the terminfo files are installed, relative to the installation prefix. It also recognizes the special value ‘disabled’, in which case the terminfo files are not installed at all. The terminfo files _are_ however built (allowing us to catch build errors), and foot still defaults to the ‘foot’ terminfo. It defaults to $datadir/terminfo If (the other option) ‘terminfo’ is set to disabled (or tic cannot be found), terminfo-install-location is automatically set to ‘disabled’.
* server: make sure ‘overrides’ have been initialized in all error pathsDaniel Eklöf2021-06-23-1/+1
|
* client: make sure ‘fd’ is initialized in all error pathsDaniel Eklöf2021-06-23-1/+2
|
* Merge branch 'footclient-override'Daniel Eklöf2021-06-23-131/+155
|\ | | | | | | Closes #600
| * client: add and use function push_override()Daniel Eklöf2021-06-23-48/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now track override data (length + malloc:ed string) in a struct, and push this struct to our overrides linked list. There’s a new function, push_override() that takes a string, calculates its length, strdup() it and pushes it to the linked list. This function also length-checks the string, to ensure we don’t overflow. This way, we don’t have to loop the overrides list twice; once when calculating the total length of all overrides, and once when sending the overrides to the server. Now, we can update the total length as we add overrides (i.e while parsing the command line, instead of afterwards). This means we only have to loop the list once, and that’s when sending it. This also means there’s no longer any need to malloc an array holding the lengths of each override.
| * changelog: add ref to #600 (-o,--override for footclient)Daniel Eklöf2021-06-23-1/+2
| |
| * completions: add -o,--override to footclientDaniel Eklöf2021-06-23-1/+4
| |
| * doc: footclient.1: document -o,--overrideDaniel Eklöf2021-06-23-0/+4
| |
| * doc: foot.1: remove trailing space, add ‘=’ between option name and its valueDaniel Eklöf2021-06-23-2/+2
| |
| * client: implement -o,--overrideDaniel Eklöf2021-06-23-1/+7
| |
| * main: usage: add ‘=’ between --override and its valueDaniel Eklöf2021-06-23-1/+1
| | | | | | | | This is how all other long options are documented in the usage.
| * server: avoid “member access within misaligned address” ASAN warningDaniel Eklöf2021-06-23-7/+6
| |
| * client: send overrides for everything that is publicly visible in the confDaniel Eklöf2021-06-23-141/+109
| | | | | | | | | | | | | | | | | | Send a generic “overrides” list to the server, containing options in text, on the format “section.key=value”. This reduces the size of the base client/server protocol packet, as well as opens up for a generic -o,--override command line option (not yet implemented).
| * server: use config_clone() + config_override_apply()Daniel Eklöf2021-06-23-22/+50
|/ | | | | | | | | When the connecting client overrides config options, clone the server’s configuration, and then convert the overridden options to config overrides, and apply them using config_override_apply(). When destroying the client, free the cloned config using the regular config_free().
* Merge branch 'refresh-on-csd-ssd-change'Daniel Eklöf2021-06-23-52/+43
|\
| * wayland: apply CSD/SSD changes in the surface configure eventDaniel Eklöf2021-06-23-52/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The configure event asks the client to change its decoration mode. The configured state should not be applied immediately. Clients must send an ack_configure in response to this event. See xdg_surface.configure and xdg_surface.ack_configure for details. In particular, ”the configured state should *not* be applied immediately”. Instead, treat CSD/SSD changes like all other window dimension related changes: store the to-be mode in win->configure, and apply it in the surface configure event. This fixes an issue where foot incorrectly resized the window when the server switched between CSD/SSD at run-time.
* | config: clone: fix font-list cloningDaniel Eklöf2021-06-23-1/+4
| | | | | | | | Need to copy over *all* members...
* | Merge branch 'config-clone'Daniel Eklöf2021-06-23-120/+246
|\ \ | |/ |/|
| * config: add new function config_clone()Daniel Eklöf2021-06-23-106/+214
| |
| * tokenize: strdup() each individual argvDaniel Eklöf2021-06-20-38/+56
|/ | | | | Instead of referencing the un-tokenized “raw” command string, strdup() each argv. This way, the input string can be ‘const’.
* config: remove duplicated error logs for invalid colorsDaniel Eklöf2021-06-20-18/+6
|
* Merge branch 'csd-button-fg-color'Daniel Eklöf2021-06-20-10/+43
|\
| * config: add csd.button-color optionDaniel Eklöf2021-06-20-10/+43
|/ | | | | | | | This option controls the foreground color of the minimize/maximize/close buttons. I.e. the color used to draw the minimize/maximize/close glyphs. It defaults to default background color.
* uri: hostname_is_localhost(): don’t crash if hostname == NULLDaniel Eklöf2021-06-19-3/+5
|
* term: fix regression after merging #599Daniel Eklöf2021-06-18-3/+3
| | | | | Don’t increment ‘j’ twice in each loop iteration, and fix typo in loop condition (check ‘j’, not ‘i’).
* Merge branch 'title-update'Daniel Eklöf2021-06-18-24/+78
|\ | | | | | | Closes #591
| * render: don’t create/destroy the title update timer each timeDaniel Eklöf2021-06-18-37/+45
| | | | | | | | | | Create it once when instantiating the terminal. Add a boolean to track whether the timer is running or not.
| * render: use a timer instead of relying on the frame callback for title update throttlingDaniel Eklöf2021-06-18-18/+64
|/ | | | | | | | | | | | | | | | | | | | | Using the frame callback works most of the time, but e.g. Sway doesn’t call it while the window is hidden, and thus prevents us from updating the title in e.g. stacked views. This patch uses a timer FD instead. We store a timestamp from when the title was last updated. When the application wants to update the title, we first check if we already have a timer running, and if so, does nothing. If no timer is running, check the timestamp. If enough time has passed, update the title immediately. If not, instantiate a timer and wait for it to trigger. Set the minimum time between two updates to ~8ms (twice per frame, for a 60Hz output, and ~once per frame on a 120Hz output). Closes #591
* Merge branch 'reduce-tllist-usage'Daniel Eklöf2021-06-18-276/+380
|\