aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
* main: Graceful fallback if user has configured an invalid localeJoakim Nohlgård2022-12-16-2/+7
|
* doc: foot-ctlseq: expand last column to fill screen in all tablesDaniel Eklöf2022-12-14-9/+9
|
* slave: unsetenv() env vars that have been set to the empty stringDaniel Eklöf2022-12-06-13/+24
| | | | | | | | | | | That is, users can now *clear* environment variables by doing: [environment] VAR=”” Note that the quotes are required. Closes #1225
* doc: foot.ini: add example, and mention string options can be quotedDaniel Eklöf2022-12-06-0/+9
|
* foot.ini: use a quoted, empty string for “indicator-format”Daniel Eklöf2022-12-06-1/+1
| | | | We don’t allow empty values, but we do allow quoted, empty values.
* config: allow string values to be quotedDaniel Eklöf2022-12-06-1/+43
| | | | | | | | | | | * Both double and single quotes are recognized. There’s no difference in how they are handled. * The entire string must be quoted: - “a quoted string” - OK - quotes “in the middle” of a string - NOT ok * Two escape characters are regonized: - Backslash - The quote character itself
* doc: foot: add PWD to list of env vars set in child processDaniel Eklöf2022-12-04-0/+3
|
* log: don’t default to syslog enabledDaniel Eklöf2022-12-02-2/+7
| | | | | | | | | | | | Initialize the global ‘do_syslog’ variable to false. This ensures any log calls done before log_init() has been called (e.g. unit tests) doesn’t syslog anything. As a side effect, such log calls no longer open an implicit syslog file descriptor; this is how this “bug” was found: valgrind detected an unclosed file descriptor at exit. Finally, completely disable syslogging if log-level is “none”.
* url-mode: tag cells after snapshot:ing the gridDaniel Eklöf2022-11-30-15/+18
| | | | | | | | | | | | | | | | | | | Before this patch, hyperlinked cells were tagged with the “URL” attribute (thus instructing the renderer to draw an underline) *before* the grid was snapshot. When exiting URL mode, the cells were once again updated, this time removing the URL attribute. But what if an escape sequence had modified the grid _while we were in URL mode_? Depending on the sequence, it could move cells around in such a way, that when exiting URL mode, the affected cells weren’t updated correctly. I.e. we left some cells with the URL attribute still set. The fix is simple: tag cells in the snapshot:ed grid only (which isn’t affected by any escape sequence received while in URL mode). Not in the *actual* grid (which _is_ affected).
* doc: ctlseq: add trailing space to fix XTGETTCAP entry in DCS tableCraig Barnes2022-11-24-1/+1
| | | | | Without the trailing space, both the sequence and the description were getting packed into a single table column.
* selection: selection_on_rows(): typo: row_start -> row_endDaniel Eklöf2022-11-24-3/+4
| | | | | | | This fixes an issue where selections in the scroll margins were not detected correctly. This meant they weren’t canceled as they should have been, which in turn caused a visual glitch where text appeared to be selected, but were in fact not.
* Merge branch 'line-height-adjust'Daniel Eklöf2022-11-24-12/+39
|\ | | | | | | Closes #1218
| * changelog: scaling factor not being applied when converting px-to-ptDaniel Eklöf2022-11-24-0/+2
| |
| * term: apply scale factor when converting a px value to ptDaniel Eklöf2022-11-24-1/+1
| |
| * term: initialize term->font_line_height when there’s no user-set line-heightDaniel Eklöf2022-11-24-1/+4
| |
| * term: update user-set line-height just before calculating the cell dimensionsDaniel Eklöf2022-11-24-19/+30
| | | | | | | | | | This ensures *all* font-size affecting changes (DPI, output scaling, font size increment/decrement) also updates the line-height.
| * changelog: line-height adjustment with user-set line-heightDaniel Eklöf2022-11-23-0/+3
| |
| * term: adjust user-set line-height by the same percentage as the primary fontDaniel Eklöf2022-11-23-4/+12
|/ | | | | | | | | | | | | | | | | Before this patch, a user-set line-height was increased/decreased by the exact same amount of pt’s as the font(s). This means, that when there’s a large discrepancy between the line-height and the font size, the proportion between the line’s height and the font size will change as we increase or decrease the font size. This patch changes how the line height is adjusted when the font size is incremented or decremented. We calculate the difference, in percent, between the primary font’s original (default) size, and its current size, and then apply that to the configured line-height. Closes #1218
* readme/foot.1: mention that we now need “-d info” to get log outputDaniel Eklöf2022-11-23-2/+2
|
* change default log level to WARNINGAntoine Beaupré2022-11-22-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default foot output looks like this, in Debian testing "bookworm" at the time of writing: anarcat@angela:pubpaste$ foot true info: main.c:421: version: 1.13.1 +pgo +ime +graphemes -assertions info: main.c:428: arch: Linux x86_64/64-bit info: main.c:440: locale: fr_CA.UTF-8 info: config.c:3003: loading configuration from /home/anarcat/.config/foot/foot.ini info: fcft.c:338: fcft: 3.1.5 +graphemes -runs +svg(nanosvg) -assertions info: fcft.c:377: fontconfig: 2.13.1, freetype: 2.12.1, harfbuzz: 5.2.0 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=8.00pt/8px, dpi=75.00 info: wayland.c:1353: eDP-1: 2256x1504+0x0@60Hz 0x095F 13.32" scale=2 PPI=205x214 (physical) PPI=136x143 (logical), DPI=271.31 info: wayland.c:1509: requesting SSD decorations info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00 info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00 info: terminal.c:700: cell width=19, height=39 info: terminal.c:588: using 16 rendering threads info: wayland.c:859: using SSD decorations info: main.c:680: goodbye anarcat@angela:pubpaste$ That's 17 lines of output that are *mostly* useless for most use cases. I might understand having this output during the project's startup, when it's helpful for diagnostics, but now Foot just mostly works everywhere, and I've never had a use for any of that stuff in the (arguably short) time I've been using Foot so far. And if I do, there's the `--log-level` commandline option to tweak this. At first, I looked at tweaking the log level through the config file. But as explained in this issue: https://codeberg.org/dnkl/foot/issues/1142 ... there's a chicken and egg problem there that makes it hard to implement and possibly confusing for users as well. There's also the possibility for users to change the shortcut with which they start foot, for example a `.desktop` file so that menu systems that support those start foot properly. But that only works in that environment, and not through the so many things that will just call `foot` and hope it will do the right thing. In my case, I have `foot` hardcoded in a lot of places now, between sway and waybar, and this is only going to grow. Others have suggested adding the flag to a $TERMINAL global variable, but that won't help .desktop users. So, instead of playing whack-a-mole with the log levels, just make it so that, by default, foot is silent. This is actually one of the [basics of UNIX philosophy][1]: > Rule of Silence: When a program has nothing surprising to say, it > should say nothing. And yes, I am aware I am severely violating that principle by writing a way too long commit log for a one-line patch, but there you go, I figured it was good to document the why of this properly. [1]: https://web.archive.org/web/20031102053334/http://www.faqs.org/docs/artu/ch01s06.html
* Merge branch 'fp-calc-dpi'Daniel Eklöf2022-11-22-3/+14
|\ | | | | | | Closes #1209
| * wayland: force monitor DPI to 96 when it’s unreasonably highDaniel Eklöf2022-11-04-0/+9
| | | | | | | | | | | | | | | | | | If an output has a bogus physical width or height, the DPI can become so high that the cell width/height is too large for pixman_image_fill_rectangles(), resulting in a crash in pixman_fill(). Since it doesn’t make any sense to use a DPI that is obviously bogus, don’t. Force it 96 instead.
| * wayland: use fp math all the way when calculating DPIDaniel Eklöf2022-11-04-3/+5
|/ | | | | This fixes an FPE when the monitor’s physical width/height is so small that the conversion from mm to inch resulted in inches being zero.
* added modus themesSoren A D2022-11-02-0/+49
|
* wayland: use BUG() instead of xassert(false)Craig Barnes2022-11-01-1/+1
| | | | | The latter will expand to the former anyway, so we may as well provide an explicit error message instead of "assertion failed: 'false'".
* render: maybe_resize(): remove debug assertDaniel Eklöf2022-11-01-1/+0
| | | | | This, depending on which compiler being used, caused issues not only in debug builds, but release builds as well (with NDEBUG defined).
* render: never apply alpha to text colorDaniel Eklöf2022-10-30-1/+12
| | | | | | | | | | | | | | | | | | | | | | When drawing a block cursor using inversed fg/bg colors, we didn’t strip the alpha from the background color. This meant that the text "behind" the cursor was rendered with transparency. If alpha was set to 0, the text was completely invisible. We should never apply alpha to the text color. So, detect this, and force alpha to 1.0. Normally, when selecting the cursor’s color, we don’t really know _where_ the background color is coming from (or more accurately, _what_ it is). However, the *only* background color that can have a non-1.0 alpha is the *default* background color. This is why we can ignore the bg parameter, and use term->colors.fg/bg instead. Closes #1205
* chore: use MIT license for appstream metadataAndrea Pappacoda2022-10-27-1/+1
| | | | | | | | | | | | | | | | | | The Appstream metadata file introduced in commit 335612cfa4ea090874354c7080f492b2b28a136b has been submitted as licensed under the CC0-1.0 license. People generally use the CC0-1.0 to put the file in the "public domain", but this isn't actually possible in lots of countries, so the file ends up being licensed under CC0's fallback permissive license; unfortunately, the fallback license contains some terms that are seen as problematic to some (notably, Fedora has recently decided to consider the license pretty much non-free). As foot is already MIT-licensed, and since this license is in the list of allowed [metadata licenses], this patch changes the license of the metadata file from CC0-1.0 to MIT. [metadata licenses]: https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-metadata_license
* build: fix GCC detection in pgo.shAndrea Pappacoda2022-10-23-1/+1
| | | | | | | | | | | | | | | On my system, GCC doesn't output its name when passing the --version flag: $ cc --version cc (Debian 12.2.0-3) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. As the Free Software Foundation is unlikely to write another compiler, I think that searching for the foundation's name instead of GCC is a good enough fix (and I'm almost sure we wouldn't be the first ones to do so).
* render: resize: do full text reflow immediately if resize-delay-ms == 0Daniel Eklöf2022-10-23-2/+3
| | | | | That is, skip all custom grid handling when doing an interactive resize, if resize-delay-ms == 0.
* pgo: don’t re-use the rows between the ‘normal’ and ‘alt’ gridsDaniel Eklöf2022-10-18-10/+20
| | | | | | | | This used to work because we never free:d any of the rows. Now however, we do free (some of) them when reverse scrolling. This means we can no longer re-use the rows between the two screens. Closes #1196
* grid_free(): allow being called with grid == NULLDaniel Eklöf2022-10-18-0/+3
|
* term_destroy(): free interactive_resizing.gridDaniel Eklöf2022-10-18-0/+2
| | | | | This grid is normally unallocated, but may be allocated if we are exiting (for whatever reason) in the middle of an interactive resize.
* fdm_ptmx(): regression: don’t return false when an interactive resize is in progressDaniel Eklöf2022-10-18-1/+1
|
* doc: foot.ini: improve documentation of cursor.colorDaniel Eklöf2022-10-17-7/+6
|
* interactive resize: improve user experienceDaniel Eklöf2022-10-17-60/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-initialize the temporary ‘normal’ grid instance each time we receive a configure event while doing an interactive resize. This way, window content will not be "erased" when the window is first made smaller, then larger again. And, if the viewport is up in the scrollback history, increasing the window size will reveal more of the scrollback, instead of just being black. The last issue is the cursor; it’s currently not "stuck" where it should be. Instead, it follows the window around. This is due to two things: 1) the temporary grid we create is large enough to contain the current viewport, but not more than that. That means we can’t "scroll up", to hide the cursor. 2) grid_resize_without_reflow() doesn’t know anything about "interactive resizing". As such, it will ensure the cursor is bound to the new grid dimensions. I don’t yet have a solution for this. This patch implements a workaround to at least reduce the impact, by simply hiding the cursor while we’re doing an interactive resize.
* changelog: crash after reverse-scrolling in the normal screenDaniel Eklöf2022-10-16-0/+3
|
* selection: scroll down: handle non-full scrollback correctlyDaniel Eklöf2022-10-16-3/+8
| | | | | | | | | When determining whether or not to cancel a selection (due to it, or part of it, being "scrolled out"), we assumed the scrollback was full. This patch changes the implementation to compare the scrollback relative selection coordinates with the scrollback relative end-of-the-scrollback coordinates.
* term: reverse scroll: free scrolled out linesDaniel Eklöf2022-10-16-0/+12
| | | | | | | | | | | | This ensures *everything* in the circular scrollback history, after the bottom of the screen, is either NULL rows, or belong to the scrollback *history* (as opposed to the future history). This fixes an issue when calculating the scrollback start, which for example would trigger a crash when moving the viewport (i.e. scrolling with the mouse, or PgUp/PgDown). Closes #1190
* sixel: don’t crash when sixel image exceeds current sixel max heightDaniel Eklöf2022-10-13-1/+2
| | | | | | | | | | | | When we try to resize a sixel past the current max height, we set col > image-width to signal this. This means ‘width’ could be smaller than ‘col’. When calculating how many sixels to emit in sixel_add_many(), we didnt’ account for this. The resulting value was -1, converted to ‘unsigned’. I.e. a very large value. This resulted in an assert triggering in sixel_add() in debug builds, and a crash in release builds.
* Merge branch 'delayed-reflow'Daniel Eklöf2022-10-10-84/+279
|\
| * render: rename term->render.resizing -> term->interactive_resizingDaniel Eklöf2022-10-10-34/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | But also, more importantly, logical fixes: * Stash the number of new scrollback lines the stashed ‘normal’ grid should be resized *to*. There’s also a couple of performance changes here: * When doing a delayed reflow (tiocswinsz timer), call sixel_reflow_grid(term, &term->normal) - there’s no need to reflow sixels in the ‘alt’ screen. * When doing a delayed reflow, free all scroll damage. It’s not needed, since we’re damaging the entire window anyway. * Use minimum size for the temporary ‘normal’ grid (that contains the current viewport). We just need it to be large enough to fit the current viewport, and be a valid grid row count (power of 2). This just so happens to be the current ‘alt’ grid’s row count...
| * render: resize: do delayed reflow immediately when failing to arm tiocswinsz timerDaniel Eklöf2022-10-10-1/+3
| |
| * term_ptmx_{pause,resume}: return success/failDaniel Eklöf2022-10-10-14/+14
| |
| * term: ptmx: don’t consume anything while doing an interactive resizeDaniel Eklöf2022-10-10-0/+11
| | | | | | | | | | The ‘normal’ grid in use during an interactive resize is temporary; all changes done to it will be lost when the resize is finished.
| * term: use SIZE_MAX instead of (size_t)-1llDaniel Eklöf2022-10-10-1/+2
| |
| * grid: resize: assert grid->cur_row is not NULL after a grid resizeDaniel Eklöf2022-10-10-0/+4
| |
| * render: delayed reflow: not enough to damage current view; need to refresh tooDaniel Eklöf2022-10-10-1/+3
| |
| * sixel: add sixel_reflow_grid()Daniel Eklöf2022-10-10-62/+70
| | | | | | | | | | | | | | | | | | This function reflows all sixels in the specified grid. The pre-existing sixel_reflow() function is a shortcut for sixel_reflow_grid(term, &term->normal) sixel_reflow_grid(term, &term->alt);
| * changelog: fixed crash when resizing window with a very large scrollbackDaniel Eklöf2022-10-10-0/+2
| |
| * render: resize: ignore ptmx read events during interactive resizeDaniel Eklöf2022-10-10-0/+19
| |
| * render: performance improvements during interactive resizeDaniel Eklöf2022-10-10-5/+37
| | | | | | | | | | | | | | | | | | | | | | Instead of copying the entire grid when an interactive resize is started, stash the complete grid (to be used in the final reflow). Copy the current viewport only, to be used during the interactive resize. This gets rid of the initial "pause" when snapshotting the grid when an interactive resize is started.
| * render: delay reflow for ‘resize-delay-ms’ millisecondsDaniel Eklöf2022-10-10-20/+123
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reflowing a large scrollback is *slow*. During an interactive resize, it can easily take long enough that the compositor fills the Wayland socket with configure events. Eventually, the socket becomes full and the compositor terminates the connection, causing foot to exit. This patch is work-in-progress, and the first step towards alleviating this. It delays the reflow by: * Snapshotting (copying) the original grid when an interactive resize is started. * While resizing, we apply a simple truncation resize of the grid (like we handle the alt screen). * When the resize is done, or paused for ‘resize-delay-ms’, the grid is reflowed. TODO: we *must* not allow any changes to the temporary (truncated) grid during the resize. Any changes to the grid would be lost when the final reflow is applied. That is, we must completely pause the ptmx pipe while a resize is in progress. Future improvements: The initial copy can be slow. We should be able to avoid it by rewriting the reflow algorithm to not free anything. This is complicated by the fact that some resources (e.g. sixel images) are currently *moved* to the new grid. They’d instead have to be copied.
* pgo: run xtgettcap without any argumentsDaniel Eklöf2022-10-10-5/+5
| | | | | | | | We execute xtgettcap in the parent terminal. Thus we don’t know if it implements XTGETTCAP, and thus it’s not guaranteed to exit - it may hang indefinitely waiting for a reply. Fix by not actually quering anything.
* xtgettcap: exit immediately when there are no capabilities to query forDaniel Eklöf2022-10-10-2/+5
|
* install.md: add `./utils/xtgettcap name` to "full PGO" instructions tooDaniel Eklöf2022-10-09-3/+5
|
* install.md: add xtgettcap to PGO build instructionsDaniel Eklöf2022-10-08-3/+5
|
* pgo: execute xtgettcap utility, to get profiling dataDaniel Eklöf2022-10-07-0/+2
| | | | | | Fixes: ../utils/xtgettcap.c:175:1: error: ‘/home/daniel/src/foot/src/utils/xtgettcap.p/xtgettcap.c.gcda’ profile count data file not found [-Werror=missing-profile]
* utils: xtgettcap: new utility, to send XTGETTCAP queriesDaniel Eklöf2022-10-07-0/+177
|
* scripts: generate-builtin-terminfo: escape fixesDaniel Eklöf2022-10-05-7/+14
| | | | | * Remove ‘:’ escaping only in raw (non-parameterized) sequences * Double-escape *all* escape characters in parameterized sequences
* scripts: generate-builtin-terminfo: double-escape backslash in STDaniel Eklöf2022-10-05-0/+6
| | | | | Fixes an issue with XTGETTCAP, where escape sequences terminated with ST, and containing parameters were missing a trailing backslash.
* render: fix nanosec "overflow" when calculating timeout valueAlexey Sakovets2022-10-05-1/+6
|
* Add zenburn themeHugo Osvaldo Barrera2022-10-04-0/+23
| | | | This is the one included by default in previous releases.
* doc: fix tiny typoNick Hastings2022-10-04-1/+1
|
* spawn: set $PWD, in addition to calling chdir(cwd)Daniel Eklöf2022-10-02-3/+6
|
* main/client: use $PWD for cwd, when $PWD is validDaniel Eklöf2022-10-02-0/+44
| | | | | | | | | If $PWD is set, and its resolved path matches the *actual* working directory, use $PWD for cwd when instantiating the terminal. This makes a difference when $PWD refers to a symlink; before this patch, we’d instantiate the terminal in the *resolved* path. Now it’ll use the symlink instead.
* slave: spawn: set PWD environment variableDaniel Eklöf2022-10-02-0/+3
| | | | | | | | This improves handling of symlinks (in CWD) when launching a new terminal instance, either through ctrl+shift+n, or using the --working-directory command line option. Closes #1179
* scripts: generate-builtin-terminfo: add synthetic ‘name’ capabilityDaniel Eklöf2022-09-28-0/+2
| | | | Same as ‘TN’; reports the terminfo name.
* terminfo: add kxIN + kxOUT (focus in/out events)Daniel Eklöf2022-09-26-1/+3
| | | | | | | | | | | | | | | These capabilities are not included in the standard ‘xterm’ or ‘xterm-256color’ terminfos. They’re used in ‘xterm+focus’ -> ‘xterm+sm+1002’ -> ‘xterm-1002|xterm+sm+1003’ -> ‘xterm-1003’ (https://invisible-island.net/ncurses/terminfo.ti.html#tic-xterm_focus) However, as far as I can tell, ncurses doesn’t use these capabilities at all.
* term: utmp: set ‘host’ to WAYLAND_DISPLAYDaniel Eklöf2022-09-23-2/+2
| | | | This is similar to what XTerm does (setting it to DISPLAY)
* Add support for creating utmp recordsDaniel Eklöf2022-09-23-11/+105
| | | | | | | | | | | | | | | | | This patch adds support for creating utmp records using the ‘utempter’ helper binary from the ‘libutempter’ package. * New config option ‘main.utempter’ * New meson command line option, -Ddefault-utempter-path. Defaults to auto-detecting the path. The default value of the new ‘main.utempter’ config option depends on the meson command line option ‘-Ddefault-utempter-path’. If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute the utempter helper binary to create utmp records when a new terminal is instantiated. The record is removed when the terminal instance is destroyed.
* Merge branch 'nightfly-and-moonfly'Daniel Eklöf2022-09-23-0/+58
|\
| * Add the moonfly themeTorsten Trautwein2022-09-22-0/+29
| |
| * Add the nightfly themeTorsten Trautwein2022-09-22-0/+29
| |
* | render: overlay: fix visual glitches when double bufferingDaniel Eklöf2022-09-23-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rendering the overlay for scrollback search, the logic assumed buffer re-use. On some compositors this isn’t happening (on e.g. KDE/plasma we’re forced to double buffer). This resulted in matches not being highlighted correctly. The problem is in how we calculated the region for which areas to clear ("un-dim"). It uses the "previous frame’s see-through area" minus the current frame’s see-through area. However, when we’ve detected that the current buffer isn’t the same as the last one, we set the last frame’s see-through region to "the entire buffer". Thus, when calculating the diff, we end up with an empty region, and nothing is highlighted. Fix by simply using the current frame’s see-through region as-is when we’ve detected we’re not re-using the last frame’s buffer.
* | render: fix application of old scroll damage when double bufferingDaniel Eklöf2022-09-23-67/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On compositors that forces us to double buffer, we need to re-apply the last frame’s damage to the current frame (which uses the buffer from the next-to-last frame). General cell updates are handled by simply copying from the last frame’s pixman buffer to the current frame’s. In an attempt to improve performance, scroll damage were up until now handled by re-playing the last frame’s scroll damage (on the current frame’s buffer). This does not work, and resulted in glitches when scrolling in the scrollback. This patch does the following: * grid_render_scroll{,_reverse}() now update the buffer’s "dirty" region. This means the generic copy-old-frames-buffer handles the scroll damage (albeit in, potentially, a less efficient way). * Tracking of, and re-applying old scroll damage is completely removed. Closes #1173
* | wayland: don’t crash with a division-by-zero when monitor dimensions are negativeDaniel Eklöf2022-09-23-1/+1
| | | | | | | | Some compositors set the physical dimensions to -1...
* | render: timer: print/log *total* rendering timeDaniel Eklöf2022-09-23-7/+13
| |
* | misc: add timespec_add()Daniel Eklöf2022-09-23-1/+19
| |
* | install.md: add ‘utf8proc’Daniel Eklöf2022-09-23-0/+1
|/
* chore: rename desktop filesVladimír Magyar2022-09-18-1/+1
|
* chore: add appstream fileVladimír Magyar2022-09-18-0/+45
| | | | | | | | Appstream file is usefull for many package management tools to show additional metadata and screenshots. Also it would solve the packaging for flathub. References: https://codeberg.org/dnkl/foot/issues/1129#issuecomment-602089
* csi: reply with 4 instead of 2 for DECRQM queries of unsupported modesCraig Barnes2022-09-18-44/+61
| | | | | | | | The status value 4 means "permanently reset", as opposed to 2, which means "reset". The former implies that there's no way to enable the mode because it's unsupported (but recognized). Note: this commit also fixes an unrelated typo in CHANGELOG.md.
* config: fix "maybe-uninitialized" error when compiling with CFLAGS=-OgCraig Barnes2022-09-17-0/+3
| | | | | | | | | | | | | | | Using GCC 12.2.0 with the following build steps: CFLAGS=-Og meson bld ninja -C bld ...produces the compiler error: ../config.c:2000:18: error: ‘sym_equal’ may be used uninitialized [-Werror=maybe-uninitialized] This commit fixes that by using BUG() to assert that all possible values are accounted for in the offending switch statement.
* input: pipe-*: set current CWD when spawning the sub-processDaniel Eklöf2022-09-10-1/+5
| | | | Closes #1166
* terminal: don’t unref a not-yet-referenced key-binding setDaniel Eklöf2022-09-06-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Key-binding sets are bound to a seat/configuration pair. The conf reference is done when a new terminal instance is created. When that same terminal instance is destroyed, the key binding set is unref:ed. If the terminal instance is destroyed *before* the key binding set has been referenced, we’ll still unref it. This creates an imbalance. In particular, when the there is exactly one other terminal instance referencing that same key binding set, that terminal instance will trigger a foot server crash as soon as it receives a key press/release event. This happens because the next-to-last terminal instance brought the reference count of the binding set down to 0, causing it to be free:d. Thus, we *must* reference the binding set *before* we can error out (when instantiating a new terminal instance). At this point, we don’t yet have a valid terminal instance. But, that’s ok, because all the key_binding_new_for_term() did with the terminal instance was get the "struct wayland" and "struct config" pointers. So, rename the function and simply pass these pointers explicitly. Similarly, change key_binding_for() to take a "struct config" pointer, rather than a "struct terminal" pointer. Also rename key_binding_unref_term() -> key_binding_unref().
* csi: damage *viewport* when exiting the alt screenDaniel Eklöf2022-09-06-1/+1
| | | | | This fixes a redraw issue when the normal screen were somewhere in the scrollback history when exiting the alt screen.
* config: change default ‘pad’ to 0x0 (i.e. no padding)Daniel Eklöf2022-09-03-4/+5
|
* Merge branch 'releases/1.13'Daniel Eklöf2022-08-31-6/+15
|\
| * meson: bump version to 1.13.11.13.1releases/1.13Daniel Eklöf2022-08-31-1/+1
| |
| * changelog: prepare for 1.13.1Daniel Eklöf2022-08-31-9/+3
| |
| * url-mode: connect osc-8 links only when both ID and URI matchesDaniel Eklöf2022-08-31-6/+12
| | | | | | | | | | | | | | | | | | | | | | Before this, two OSC-8 links with a matching ID would be connected even if their URIs weren’t the same. This is against the spec: The same id is only used for connecting character cells whose URIs is also the same. Character cells pointing to different URIs should never be underlined together when hovering over. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter
| * changelog: crash when resizing window, or scrollingDaniel Eklöf2022-08-31-0/+4
| |
| * grid: reflow: assert there aren’t any open URIs on the last rowDaniel Eklöf2022-08-31-0/+15
| |
| * grid: reflow: don’t line-wrap the last rowDaniel Eklöf2022-08-31-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we would line-wrap the last row, just like any other row, and then afterwards try to reverse this, by adjusting the offset and free:ing and NULL:ing the "last row". The problem with this is if the scrollback is full. In this case, the row we’re freeing is the first row in the scrollback history. This means we’ll crash as soon as the viewport is moved to the top of the scrollback. The fix is fairly, simple. Skip the post-processing logic, and instead detect when we’re line-wrapping the last row, and skip the call to line_wrap(). This way, the last row in the new grid corresponds to the last row in the old grid.
| * grid: when setting the new viewport, ensure it’s correctly boundedDaniel Eklöf2022-08-31-17/+11
| | | | | | | | | | | | Do this by using scrollback relative coordinates, and ensure the new viewport is not larger than (grid_rows - screen_rows), as that would mean the viewport crosses the scrollback wrap-around.
| * selection: mark_selected_region(): use an enum to encode how the cells are to be updatedDaniel Eklöf2022-08-31-7/+20
| |
| * selection: restore <= 1.12 behavior in block selection wrt empty cellsDaniel Eklöf2022-08-31-1/+3
| | | | | | | | | | That is, highlight empty cells, regardless of whether they’re trailing or not.
| * ci (sr.ht): pull directly from git.sr.htDaniel Eklöf2022-08-31-3/+3
| |
| * selection: once again highlight non-trailing empty cellsDaniel Eklöf2022-08-31-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foot 1.13.0 introduced a regression where non-trailing empty cells were highlighted inconsistently (cells that shouldn’t be highlighted, were, seemingly at random). 86663522d5915c0fdb2b8b132bacc247fcfd1fb8 “fixed” this by never highlighting *any* empty cells. This meant the behavior, compared to foot 1.12 and earlier, changed. In foot 1.12 and older versions, non-trailing empty cells were highlighted, as long as the selection covered at least one of the trailing non-empty cells. This patch restores that behavior. To understand how this works, lets first take a look at how selection works: When a selection is made, and updated (i.e. the mouse is dragged, or the selection is extended through RMB etc), we need to (un)tag and dirty the cells that are a) newly selected, or b) newly deselected. That is, we look at the diff between the “old” and the “new” selection, and only update those cells. This is for performance reasons: iterating the entire selection is not feasible with large selections. However, it also means we cannot reason about empty cells; we simply don’t know if an empty cells is a trailing empty cell, or a non-trailing one. Then, when we render a frame, we iterate all the *visible* and *selected* cells, once again tagging them as selected (this is needed since a selected cell might have lost its selected tag if the cell was written to, by the client application, after the selection was made). At this point, we *can* reason about empty cells. So, to restore the highlighting behavior to that of foot 1.12, we do this: When working with the selection diffs when a selection is updated, we don’t special case empty cells at all. Thus, all empty cells covered by the selection is highlighted, and dirtied. But, when rendering the frame, we _do_ special case them. The only difference (compared to foot 1.12) is that we *must* explicitly *clear* the selection tag, and dirty the empty cells. This is to ensure the empty cells that were incorrectly highlighted by the selection update algorithm, isn’t rendered as that. This does have a slight performance impact, as empty cells are now always re-rendered. The impact should however be small.