aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
* .desktop: remove StartupWMClass from server, use distinct StartupWMClass for foot and footclientjdevdevdev2023-05-22-13/+19
| | | | | | | | | | | | | | | For this to work, the default app-id of footclient has been changed from ‘foot’ to ‘footclient’. By using distinct StartupWMClasses, the compositor can connect a running foot/footclient instance to the correct .desktop-file. This ensures the correct icon is being used in e.g. docks, and that actions like “open another window” works correctly. Note that the user can override the app-id, either by setting app-id in foot.ini, or with the -a,--app-id command line option. Closes #1355
* test: config: add test for main.utmp-helper optionDaniel Eklöf2023-05-22-0/+1
|
* utmp: rewrite utmp loggingDaniel Eklöf2023-05-22-58/+159
| | | | | | | | | | | | | | | | | | | | | | | This patch generalizes the utmp support, to not only support libutempter, but also ulog (and in the future, even more interfaces). * Rename config option main.utempter to main.utmp-helper * Add meson option -Dutmp-backend=none|libutempter|ulog|auto * Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path * utmp is no longer detected at compile time, but at runtime instead. Meson will configure the following pre-processor macros, based on the selected utmp backend: * UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot) * UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot) * UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY) * UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary The documentation has been updated to mention which arguments are passed to the helper binary. Closes #1314
* slave: unset TERM_PROGRAM{,_VERSION}Daniel Eklöf2023-05-18-27/+4
| | | | | | | | | | | | | | | | | | | | | Foot’s policy is to not set environment variables that identifies it (except the well-known and established `TERM` variable). We encourage applications to use terminfo to determine capabilities, or terminal queries, when available. Or, at least use terminal queries to detect the terminal and its version. Setting environment variables is a bad idea since they are inherited by all applications started by the terminal (which is the whole point). But, this includes other terminal emulators, making it very possible a terminal emulator gets mis-detected just because it was started from another terminal. Since there are a couple of terminal emulators that _do_ set TERM_PROGRAM and TERM_PROGRAM_VERSION, unset these environment variables to avoid being misdetected. Closes #1349
* customized gnome-like csd buttonslocture2023-05-18-72/+107
|
* search: regression: refresh current view when canceling a scrollback searchDaniel Eklöf2023-05-15-0/+1
| | | | | | | | | | | | | | | | | | | | 3b41379be43a21a00a776d0d136c5d1b2fe4007e introduced a regression, where canceling a scrollback search didn’t refresh the viewport correctly; the viewport was changed, but the screen content was not refreshed. This worked before, because the workaround for https://github.com/swaywm/sway/issues/6960 always called term_damage_view() when exiting scrollback search mode. 3b41379be43a21a00a776d0d136c5d1b2fe4007e removed that call since it’s no longer required. *Except* when executing the BIND_ACTION_SEARCH_CANCEL binding, since then the viewport may be moved. Note that this regression affected *all* compositors, not just Sway. Closes #1354
* quirks: sway does not damage surface beneath sub-surface, when unmappedDaniel Eklöf2023-05-12-11/+43
| | | | | | | | | | | | | | | | | | | | | When unmapping a sub-surface, Sway <= 1.8 does not damage the surface beneath the sub-surface. https://github.com/swaywm/sway/issues/6960 The workaround is to manually damage the main surface. Previously, this was done when exiting scrollback search, and after the ‘flash’ OSC. But other sub-surfaces, that may also be unmapped, did not. This patch adds a quirk handler that does this, and calls it when: * Exiting scrollback search * Ending the ‘flash’ OSC * Exiting unicode input mode * Clearing URL labels * Removing the scrollback position indicator Closes #1335
* term: reset: switch modifyOtherKeys back to level 1Daniel Eklöf2023-05-12-0/+2
|
* kitty: F3 is no longer allowed to emit CSI RDaniel Eklöf2023-04-26-1/+8
| | | | | | | | The original kitty keyboard specification allowed F3 to emit either CSI R, or CSI 13~. Support for CSI R was removed in later revisions of the protocol, since it collides with "Cursor Position Report" sequences.
* csi: implement "CSI ? m"Daniel Eklöf2023-04-26-1/+42
|
* render: regression: keep empty bottom scroll margin empty after resizeDaniel Eklöf2023-04-12-1/+4
|
* render: ensure scroll region’s endpoint is valid after a window resizeDaniel Eklöf2023-04-12-5/+6
| | | | | | | | | If we had a non-empty bottom scroll region, and the window was resized to a smaller size, the scroll region was not reset correctly. This led to a crash when scrolling the screen content. Fix by making sure the scroll region’s endpoint is within range.
* meson: bump tllist dependency version to 1.1.0Vivian Szczepanski2023-04-09-1/+1
| | | | | The tll_sort() macro was added to tllist in version 1.1.0, and so building with a previous version causes a linking error.
* *.desktop: add StartupWMClass=footDaniel Eklöf2023-04-05-0/+9
| | | | | | | | At least Gnome needs this in order to link running instances of foot to their corresponding .desktop file, used e.g. when determining which icon to display for running applications. Closes #1317
* changelog: add a new ‘unreleased’ sectionDaniel Eklöf2023-04-03-0/+11
|
* Merge branch 'releases/1.14'Daniel Eklöf2023-04-03-6/+19
|\
| * meson: bump version to 1.14.01.14.0releases/1.14Daniel Eklöf2023-04-03-1/+1
| |
| * changelog: prepare for 1.14.0Daniel Eklöf2023-04-03-5/+18
|/
* terminfo: remove DECRST of DECCOLM+DECSCLMDaniel Eklöf2023-04-02-2/+3
| | | | | | | | We’ve never supported neither 132-column mode, nor smooth scrolling. But we _did_ recognize the escape sequences. We don’t, anymore. Thus it makes very little sense to include these escapes in any of our terminfo capabilities. So, remove them.
* csi: DECCOLM+DECSCLM: remove all supportDaniel Eklöf2023-03-31-21/+2
| | | | | | | | | | | We don’t support neither 132 column mode, nor smooth scrolling. Thus it makes little sense to recognize these control condes. Note that while XTerm does support 132 columns, it is disabled by default. In this mode, XTerm also doesn’t trigger the side-effects (i.e. clearing the screen). Closes #1265
* ci (woodpecker): do a second release build, using clang instead of gccDaniel Eklöf2023-03-31-4/+24
|
* input: kitty: don’t treat zero-length utf8/utf32 strings as textDaniel Eklöf2023-03-31-1/+1
| | | | | | This is a regression introduced in 3215d54f31c9e339598a34c9fa43f3dc3c5d1e42 Symptoms: e.g. arrow keys not working in vim/neovim
* changelog: typo: now -> notDaniel Eklöf2023-03-31-1/+1
|
* changeloge: remove bad escape charDaniel Eklöf2023-03-31-1/+1
|
* changelog: remove trailing back-tickDaniel Eklöf2023-03-31-1/+1
|
* test: config: call FcIni() + FcFini()Daniel Eklöf2023-03-31-0/+2
| | | | | | | | | | | | | | | | | Some of the config options we’re testing result in calls to FontConfig APIs. Without calling FcIni()+FcFini(), we leak memory: Direct leak of 768 byte(s) in 3 object(s) allocated from: #0 0x7f7e95cbfa89 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7f7e95bd1fe5 (/usr/lib/libfontconfig.so.1+0x20fe5) Indirect leak of 96 byte(s) in 3 object(s) allocated from: #0 0x7f7e95cbf411 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:77 #1 0x7f7e95bd63fd (/usr/lib/libfontconfig.so.1+0x253fd) Indirect leak of 19 byte(s) in 2 object(s) allocated from: #0 0x7f7e95c72faa in __interceptor_strdup /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cpp:439 #1 0x7f7e95bd1898 in FcValueSave (/usr/lib/libfontconfig.so.1+0x20898)
* term: protect against integer overflow when accumulating scroll damageDaniel Eklöf2023-03-30-7/+13
| | | | | | | | | | | | | | | | | | | When accumulating scroll damage, we check if the last scroll damage’s scrolling region, and type, matches the new/current scroll damage. If so, the number of lines in the last scroll damage is increased, instead of adding a new scroll damage instance to the list. If the scroll damage list isn’t consumed, this build up of scroll damage would eventually overflow. And, even if it didn’t overflow, it could become large enough, that when later used to calculate e.g. the affected surface area, while rendering a frame, would cause an overflow there instead. This patch fixes both issues by: a) do an overflow check before increasing the line count b) limit the line count to UINT16_MAX
* render: protect against integer underflow when calculating scroll areaDaniel Eklöf2023-03-30-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | When applying scroll damage, we calculate the affected region’s height (in pixels), by subtracting the number of rows to scroll, from the scrolling region, and finally multiply by the cell height. If the number of rows to scroll is very large, the subtraction may underflow, resulting in a very large height value instead of a negative one. This caused the check for "scrolling too many lines" to fail. That in turn resulted in an integer overflow when calculating the source offset into the rendered surface buffer, which typically triggered a segfault. This bug happened when there was continuous output in the terminal without any new frames being rendered. This caused a buildup of scroll damage, that triggered the underflow+overflow when we finally did render a new frame. For example, a compositor that doesn’t send any frame callbacks (for example because the terminal window is minimized, or on a different workspace/tag) would cause this. Closes #1305
* input: (kitty kbd): the resulting UTF-8 string may translate to multiple UTF-32 codepointsDaniel Eklöf2023-03-30-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | When this happened (for example, by specifying a custom compose sequence), the kitty keyboard protocol didn’t emit any text at all. This was caused by the utf32 codepoint being -1. This in turned was caused by us trying to convert the utf8 sequence to a *single* utf32 codepoint. This patch replaces the use of mbrtoc32() with a call to ambstoc32(), and the utf32 codepoint with an utf32 string. The kitty keyboard protocol is updated: * When determining if we’re dealing with text, check *all* codepoints in the utf32 string. * Add support for multiple codepoints when reporting "associated text". The first codepoint is the actual parameter in the emitted sequence, and the remaining codepoints are sub-parameters. I.e. the codepoints are colon separated. Closes #1288
* fix typosHarri Nieminen2023-03-28-10/+10
|
* render: fix glitchy selection while resizing the ‘normal’ screenDaniel Eklöf2023-03-27-0/+7
| | | | | | | | | | | The selection coordinates are in absolute row numbers. As such, selection breaks when interactively resizing the normal grid, since we then instantiate a temporary grid mapping directly to the current viewport (for performance reason, to avoid reflowing the entire grid over and over again). Fix by stashing the actual selection coordinates, and ajusting the "active" ones to the temporary grid.
* slave: set $TERM_PROGRAM and $TERM_PROGRAM_VERSION environment variablesCraig Barnes2023-03-20-0/+28
| | | | | | | | | | | | | These are already being set by iTerm2, WezTerm, tmux and likely some others. Even though using yet more environment variables seems rather questionable, if we don't set these we run the risk of inheriting them from other terminals. See also: * https://gitlab.com/gnachman/iterm2/-/blob/97a6078df8e822da165e91737a01c0b9e115dd16/sources/PTYSession.m#L2568-2570 * https://github.com/tmux/tmux/blob/1d0f68dee9f71c504e03616fa472a408a6caa49b/environ.c#L263-L264 * https://github.com/search?q=TERM_PROGRAM&type=code
* config: apply fontconfig rules if user didn’t set an explicit font sizeDaniel Eklöf2023-03-06-6/+38
| | | | | | | | | | | | | | | | | | | | | | | If the user didn’t explicitly set the font size (e.g. font=monospace, instead of font=monospace:size=12), our initial attempt to read the FC_SIZE and FC_PIXEL_SIZE attributes will fail, and we used to fallback to setting the size to 8pt. Change this slightly, so that when we fail to read the FC_*_SIZE attributes, apply the fontconfig rules, but *without expanding* them (i.e. without calling FcDefaultSubstitute()). Then try reading FC_*_SIZE again. If that too fails, _then_ set size to 8pt. This allows us to pick up rules that set a default {pixel}size: <fontconfig> <match> <edit name="pixelsize" mode="append"><double>14</double></edit> </fontconfig> Closes #1287
* themes: add Material Amberjaroeichler2023-03-03-0/+40
|
* key-binding: sort binding listsDaniel Eklöf2023-03-03-0/+59
| | | | | | | | | | | | | | | | | | | | Sort bindings such that bindings with the same symbol are sorted with the binding having the most modifiers comes first. This fixes an issue where the “wrong” key binding are triggered when used with “consumed” modifiers. For example: if Control+BackSpace is bound before Control+Shift+BackSpace, then the latter binding is never triggered. Why? Because Shift is a consumed modifier. This means Control+BackSpace is “the same” as Control+Shift+BackSpace. By sorting bindings with more modifiers first, we work around the problem. But note that it is *just* a workaround, and I’m not confident there aren’t cases where it doesn’t work. Closes #1280
* render: resize: call xdg_toplevel_set_min_size()Daniel Eklöf2023-03-02-9/+9
| | | | This is a hint to the compositor, not to set a smaller size than this.
* render: fix inversed cursor fg color when alpha != 1.0, take #2Daniel Eklöf2023-02-28-6/+5
| | | | | | | | No need to check if terminal colors have been reversed - this is done by the cell rendering logic. This hopefully fixes all remaining issues with invisible text when background alpha < 1.0
* render: fix selected cursor cell being ‘invisble’ when background alpha is usedDaniel Eklöf2023-02-27-1/+1
| | | | | ... by taking the cell ‘selected’ state into account when determining whether to use the default fg or bg as the ‘text’ color.
* wayland: ignore configure events for unmapped surfacesDaniel Eklöf2023-02-25-0/+15
| | | | | | | | | | | | Closes #1249 Note that it is still unclear whether ack:ing a configure event for an unmapped surface is a protocol violation, or something that should be handled by the compositor. According to https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/108, Kwin, Mutter and Weston handles it, while wlroots does not.
* doc: foot.ini: fix spelling mistake in [bell].urgent descriptionCraig Barnes2023-02-16-1/+1
|
* doc: ctlseq: fix capitalization in description of DA3 sequenceCraig Barnes2023-02-16-1/+1
|
* Tag a couple variables with UNUSED, to fix warnings with clang-15Daniel Eklöf2023-02-12-2/+2
| | | | Closes #1278
* completions: bash: simplify awk command used to filter terminfo namesCraig Barnes2023-01-27-1/+1
|
* render: fix incorrect indent introduced by previous commitCraig Barnes2023-01-17-1/+1
|
* render: fix double-width glyphs glitching when surrounding cells overflow into itDaniel Eklöf2023-01-17-6/+13
| | | | | | | | | | | | | | | | | | | | | | | If cells overflowed (for example, by using an italic font that isn’t truly monospaced) into a double-width glyph (that itself is *not* overflowing), then the double-width glyph would glitch when being rendered; typically the second half of it would occasionally disappear. This happened because we tried to rasterize the second cell of the double-width glyph. This cell contains a special “spacer” value. Rasterizing that typically results the font’s “not available” glyph. If _that_ glyph overflows, things broke; we’d later end up forcing a re-render of it (thus erasing half the double-width glyph). But since the double-width glyph _itself_ doesn’t overflow, _it_ wouldn’t be re-rendered, leaving it half erased. Fix by recognizing spacer cells, and not trying to rasterize them (set glyph count to 0, and cell count to 1). Closes #1256
* terminfo: sync with ncurses 2023-01-14Daniel Eklöf2023-01-15-3/+11
| | | | | | * RV/rv: report DA2 * XR/xr: report version (XTVERSION) * XF: boolean, focus in/out events available
* config: don’t double-free key binding auxiliary dataDaniel Eklöf2023-01-15-0/+6
| | | | | | | | | | | | | | | | Key bindings with multiple key mappings share auxiliary data (e.g. the command to execute in pipe-* bindings, or the escape sequence in text-bindings). The first one is the designated “master” copy. Only that one should be freed. This fixed a double-free on exit, with e.g. [text-bindings] \x1b\x23=Mod4+space Mod4+equal Closes #1259
* config: remove unused structDaniel Eklöf2023-01-15-5/+0
|
* add rose-pine themeEuCaue2023-01-13-0/+26
|
* completions: bash: complete option arguments for short optionsCraig Barnes2023-01-10-13/+13
|
* completions: bash: use "case" instead of long if/elif/else chainCraig Barnes2023-01-10-43/+52
|
* Use "command -v" instead of "which" in bash completion scriptsCraig Barnes2023-01-10-3/+3
| | | | | The former is a built-in command in bash, whereas the latter is an external command and isn't always necessarily available.
* doc: fix a typoGrigory Kirillov2023-01-07-1/+1
|
* wayland: avoid passing NULL to log_msg() in wayl_reload_xcursor_theme()Craig Barnes2023-01-06-1/+2
| | | | | | This pointer ends up being passed to various printf-family functions, where passing a NULL pointer for an "%s" format specifier invokes undefined behaviour.
* themes: add Onedarkwoojiq2023-01-06-0/+27
|
* ci: drop gitlab CIDaniel Eklöf2023-01-02-112/+0
| | | | We’re no longer mirroring to gitlab.
* changelog: amend terminfo names, in accordance with previous commitCraig Barnes2023-01-01-1/+1
|
* terminfo: PD/PE -> PE/PSDaniel Eklöf2023-01-01-2/+2
| | | | | Ncurses 2022-12-24 had the names wrong. It was corrected on 2022-12-29.
* terminfo: add entries for bracketed pasteDaniel Eklöf2023-01-01-0/+6
| | | | | | | | | | Ncurses added these in 2022-12-24, but they have been used/supported by vim since 2017. * BE - Bracketed paste Enable * BD - Bracketed paste Disable * PE - Paste Enable (i.e. "begin") * PD - Paste Disable (i.e. "end")
* config: change default grapheme-width-method from wcswidth to double-widthDaniel Eklöf2023-01-01-2/+3
| | | | | | | | | | | | | | | | | | The old default, wcswidth, simply calls wcswidth() on the grapheme cluster. This was supposedly the implementation with the highest application compatibility. Except we never even tried to measure it. It was just assumed. A lot of modern applications have better implementations. Let’s try to push support for better emoji support by changing our default method from wcswith to double-width. While far from correct (it’s not based on the Unicode tables), the ‘double-width’ method produces accurate results anyway. double-width is like wcswidth(), in that it adds together the individual wcwidths of all codepoints in the grapheme cluster. But, it limits the maximum width to 2.
* themes: comment out selection-{foreground,background}Daniel Eklöf2022-12-26-46/+49
| | | | That is, mouse selections should default to inverse fg/bg
* themes: add ‘conf’ modelineDaniel Eklöf2022-12-26-0/+55
|
* themes: remove alphaDaniel Eklöf2022-12-26-54/+45
| | | | | Alpha isn’t really part of the theme. Leave it up to the user to set alpha.
* Add Deus theme.argosatcore2022-12-26-0/+32
| | | | New color palette based on: https://github.com/ajmwagar/vim-deus
* config: font-size-adjustment: don’t allow empty %-values (key=%)Daniel Eklöf2022-12-17-1/+1
|
* config: value_to_pt_or_px(): don’t allow empty px values (key=px)Daniel Eklöf2022-12-17-1/+1
|
* foot.ini: add font-size-adjustmentDaniel Eklöf2022-12-17-0/+1
|
* config: add ‘font-size-adjustment=N[px|%]’ optionDaniel Eklöf2022-12-17-18/+119
| | | | | | | | | | | This patch adds a new config option, font-size-adjustment. It lets you configure how much the font size should be incremented/decremented when zooming in or out (ctrl-+, ctrl+-). Values can be specified in points, pixels or percent. Closes #1188
* 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
|