aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
| * render: draw_styled_underline(): respect main.underline-thicknessDaniel Eklöf2024-06-27-4/+19
| | | | | | | | | | Also refactor a bit, and break out early to draw_underline() for legacy underlines.
| * render: underlines: improve the appearance of the 'dotted' styleDaniel Eklöf2024-06-27-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Try to make the 'dotted' style appear more even, and less like each cell is rendered separately (even though they are). Algorithm: Each dot is a square; it's sides are that of the font's line thickness. The spacing (gaps) between the dots is initially the same width as the dots themselves. This means the number of dots per cell is the cell width divided by the dots' length/width, divided by two. At this point, there may be "left-over" pixels.I.e. the widths of the dots and the gaps between them may not add up to the width of the cell. These pixels are evenly (as possible) across the gaps. There are still visual inaccuracies at small font sizes. This is impossible to fix without changing the way underlines are rendered, to render an entire line in one go. This is not something we want to do, since it'll make styled underlines, for a specific cell/character, look differently, depending on the surrounding context.
| * grid: refactor: replace {uri,curly}_range_append() with range_append()Daniel Eklöf2024-06-26-49/+70
| | | | | | | | | | Also add range_append_by_ref(), with replaces uri_range_append_no_strdup().
| * grid: row_range_put(): use correct type in call to range_delete()Daniel Eklöf2024-06-26-1/+1
| |
| * grid: refactor: remove union range_data_for_insertionDaniel Eklöf2024-06-26-51/+33
| | | | | | | | | | | | | | | | | | This union is identical to row_range_data, except the URI char pointer is const. Let's ignore that, and re-use row_range_data, casting the URI pointer when necessary. Also remove uri_range_insert() and curly_range_insert(), and use the generic version of range_insert() everywhere.
| * grid: grid_row_{uri,curly}_range_put(): share codeDaniel Eklöf2024-06-26-130/+114
| | | | | | | | | | | | | | | | grid_row_uri_range_put() and grid_row_curly_range_put() now share the same base logic. Range specific data is passed through a union, and range specific checks are done through switched functions.
| * foot.info: add 'Setulc' (set underline color) capabilityDaniel Eklöf2024-06-26-0/+1
| |
| * foot.info: add 'Su' (Styled Underlines) boolean capabilityDaniel Eklöf2024-06-26-0/+1
| |
| * csi: sgr_reset(): avoid using memset()Daniel Eklöf2024-06-26-3/+2
| | | | | | | | | | This _should_ be what the compiler does anyway (i.e. it _should_ replace the memset() with inline MOVs). But let's be sure.
| * render: underlines: minor perf-tweak: early break outDaniel Eklöf2024-06-26-0/+3
| | | | | | | | | | When looking up the extender underline range, break out early if we see that there can't possibly be any ranges matching the current column.
| * changelog: styled + colored underlinesDaniel Eklöf2024-06-26-1/+2
| |
| * doc: foot-ctlseq: add 58/59 (styled + colored underlines)Daniel Eklöf2024-06-26-3/+7
| |
| * term: performance: use a bitfield to track which ascii printer to useDaniel Eklöf2024-06-26-13/+63
| | | | | | | | | | | | | | | | | | | | | | The things affecting which ASCII printer we use have grown... Instead of checking everything inside term_update_ascii_printer(), use a bitfield. Anything affecting the printer used, must now set a bit in this bitfield. This makes term_update_ascii_printer() much faster, since all it needs to do is check if the bitfield is zero or not.
| * term: term_fill(): only set OSC-8 + styled hyperlinks when use_sgr_attrs is setDaniel Eklöf2024-06-26-3/+4
| |
| * terminal: term_fill(): fix osc8 erase bug + handle styled underlinesDaniel Eklöf2024-06-26-2/+16
| | | | | | | | | | | | | | | | Only clear OSC-8 hyperlinks at the target columns if we don't have an active OSC-8 URI. This corresponds to normal VT attributes; the currently active attributes are set, and all others are cleared. Handle styled underlines in the same way
| * render: resize: copy styled underlines to temporary gridDaniel Eklöf2024-06-26-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | When doing an interactive resize, we create a small grid copy of the current viewport, and then do a non-reflow resize. When the interactive resize is done, we do a proper reflow. This is for performance reasons. When creating the viewport copy, we also need to copy the styled underlines. Otherwise, styled underlines will be rendered as plain underlines *while resizing*.
| * grid: reflow: handle styled underlinesDaniel Eklöf2024-06-26-38/+128
| |
| * render: styled underlinesDaniel Eklöf2024-06-26-1/+118
| | | | | | | | | | | | | | | | This was originally contributed by @kraftwerk28 in https://codeberg.org/dnkl/foot/pulls/1099 Here, we re-use the rendering logic only, as attribute tracking has been completely rewritten.
| * csi: remove debug logDaniel Eklöf2024-06-26-1/+0
| |
| * foot.info: add smulx (styled underlines)Daniel Eklöf2024-06-26-0/+1
| |
| * csi: wip: styled underlinesDaniel Eklöf2024-06-26-66/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | This is work in progress, and fairly untested. This adds initial tracking of styled underlines. Setting attributes seems to work (both color and underline style). Grid reflow has *not* been tested. When rendering, style is currently ignored (all styles are rendered as a plain, legacy underline). Color however, *is* applied.
| * grid: refactor: first step towards a more generic range handlingDaniel Eklöf2024-06-26-81/+135
|/
* Merge branch 'vs15-16'Daniel Eklöf2024-06-26-8/+930
|\ | | | | | | Closes #1742
| * scripts: generate-emoji-variation-sequences: don't assume single codepoint sequencesDaniel Eklöf2024-06-26-4/+11
| | | | | | | | | | | | | | | | | | | | Right now (Unicode 15.1), all valid variation sequences consist of a single Unicode codepoint (followed by either VS-15 or VS-16). Don't assume this is the case. We don't actually handle longer sequences. But now we at least catch such escapes, and error out.
| * scripts: generate-emoji-variation-sequences: compact the C structDaniel Eklöf2024-06-26-3/+3
| | | | | | | | | | | | | | | | | | | | Lookups in this table is not performance critical at all. Thus, let's compact it to bring down the binary size of foot. This brings the size of each entry down from 9 bytes to 6, bringing the size of the whole thing down from 1647 bytes to 1098 bytes, saving us 549 bytes.
| * vt: unittest: verify emoji_vs list is sortedDaniel Eklöf2024-06-25-0/+14
| |
| * scripts: generate-emoji-variation-sequences: don't assume input is sortedDaniel Eklöf2024-06-25-15/+16
| |
| * vt: only apply VS-15/16 to valid sequencesDaniel Eklöf2024-06-25-6/+903
| | | | | | | | | | | | | | | | | | | | At compile time, build a lookup table from the Unicode data file 'emoji-variation-sequences.txt'. At run-time, when we detect a VS-15/16 sequence, do a lookup in this table, and enforce the variation selector iff the sequence is valid. Closes #1742
| * vt: don't ignore VS-15 (text presentation)Daniel Eklöf2024-06-25-3/+6
|/ | | | | When we encounter either VS-15 or VS-16, set the grapheme width to 1 or 2 explicitly.
* doc: foot.ini: fix typosDaniel Eklöf2024-06-25-3/+3
|
* doc: foot.ini: document issues with fractional scaling and initial-window-size-*Daniel Eklöf2024-06-25-1/+12
| | | | | | Since most compositors don't report the correct scaling factor until *after* the window has been mapped, these options often do not work.
* shm: discard shm buffers with mis-matching alpha-settingDaniel Eklöf2024-06-24-1/+5
|
* input: don't reset the XKB compose state in keymap()Daniel Eklöf2024-06-22-27/+22
| | | | | | | | | | | | | When the compositor sends a new keymap, don't reset the XKB compose state. This is done by initializing the XKB context, along with the compose state, when binding the seat, instead of in keymap(). Then, in keymap(), simply stop destroying the old xkb state. Only destroy, and re-create the keymap state. Closes #1744
* input: implement wl_pointer::axis_value120()Daniel Eklöf2024-06-18-13/+69
| | | | | | | | | | | | | | | | | | | This implements high resolution mouse wheel scroll events. A "normal" scroll step corresponds to the value 120. Anything less than that is a partial scroll step. This event replaces axis_discrete(), when we bind wl_seat v8 (which we now do, when available). We calculate the number of degrees that is required to scroll a single line, based off of the scrollback.multiplier value. Each high-res event accumulates, until we have at least the number of degress required to scroll one, or more lines. The remaining degrees are kept, and added to in the next scroll event. Closes #1738
* osc: 52: treat OSC-52 replies as paste data (after all, they are)Daniel Eklöf2024-06-09-8/+34
| | | | | | | | | | | | | | | | | This fixes an issue where other data (such as replies to other requests) being interleaved with the OSC-52 reply. The patch piggy backs on the already existing mechanism for handling regular pastes, where other data is queued up until the paste is done. There's one corner case that won't work; if the user *just* did a normal paste (i.e. at virtually the same time the application requested OSC-52 data), the OSC-52 request will return an empty reply. Likewise, if there are multiple OSC-52 requests at the same time, only the first will return data. Closes #1734
* foot.ini: add missing option resize-by-cellsDaniel Eklöf2024-06-08-0/+1
| | | | Closes #1731
* config: codespell: varios -> variousDaniel Eklöf2024-06-08-1/+1
|
* ime: codespell: surroundin -> surroundingDaniel Eklöf2024-06-08-1/+1
|
* issue-template: let's see if we can disable the default templateDaniel Eklöf2024-06-08-1/+1
|
* meson: auto-detect execvpe on FreeBSDJan Beich2024-06-07-3/+8
| | | | https://github.com/freebsd/freebsd-src/commit/0667d0e0e365
* doc: foot.ini: document pixelsizeDaniel Eklöf2024-06-07-3/+9
| | | | | People are apparently too lazy to read fontconfig's documentation, and don't understand how to configure font sizes in foot.
* sixel: comment: document the P1 parameterDaniel Eklöf2024-05-22-1/+7
| | | | (and no, it's no longer unimplemented)
* issue-template: link "debug build", not just "build"Daniel Eklöf2024-05-22-2/+2
|
* issue-template: formatting; hopefully makes it easier to readDaniel Eklöf2024-05-22-5/+13
|
* issue-template: ask user to provide info on tmux, zellij, IMEs etcDaniel Eklöf2024-05-22-0/+5
|
* issue-template: add input-field for TERMDaniel Eklöf2024-05-22-0/+8
|
* shm: minor optimizationDaniel Eklöf2024-05-22-1/+1
| | | | | | | | | | | | | | | Don't retry memfd_create() without MFD_NOEXEC_SEAL is 0. The overall logic is this: * Try memfd_create() with MFD_NOEXEC_SEAL * If that fails (which it does, on older kernels), try without the flag If compiling against an older kernel, or on a system that doesn't support the noexec seal, MFD_NOEXEC_SEAL is 0. In this case, there's little point in retrying memfd_create a second time, with the exact same set of flags.
* changelog: wp-single-pixel-buffer-v1Daniel Eklöf2024-05-22-0/+3
|
* render: single-pixel: minor optimizationDaniel Eklöf2024-05-22-15/+32
| | | | | | | | | | | | | | Don't re-create the single-pixel buffer, unless necessary. The buffer itself doesn't have a size. That means we can re-use the buffer if the last frame's overlay style matches the current frame's style. What we *do not* know is whether the current frame's size is the same as the last frame's. This means we still have to set the viewport destination, and commit the surface.
* render: use single-pixel buffers for overlays, when possibleDaniel Eklöf2024-05-22-11/+92
| | | | | | | | | | | | | | | | | | | The unicode-mode, and flash overlays are single color buffers. This means we can use the single-pixel buffer protocol. It's undefined whether the compositor will release the buffer or not; to make things easier, simply destroy the buffer as soon as we've committed it. Note that since compositors don't necessarily release single-pixel buffers, we can't plug them into our own buffer interface. This means we can't use buffer pointers to check if we can re-use the previous buffer (i.e. we can skip comitting a new buffer), or if we have to create a new one. It's _almost_ enough to just check if the last overlay style is the same as the current one. Except that that doesn't take window resizes into account...
* issue-template: fix typoCraig Barnes2024-05-21-1/+1
|
* url-mode: disable IME mode while URL-mode is activeDaniel Eklöf2024-05-21-1/+18
| | | | | | | This prevents the IME from stealing "our" key-presses, and thus preventing the user from opening URLs. Closes #1718, hopefully.
* unicode-mode: move state from seat to termDaniel Eklöf2024-05-21-49/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an issue where entering unicode-mode in one foot client, also enabled unicode-mode on other foot clients. Both visually (although glitchy), and in effect. The reason the state was originally in the seat objects, was to fully support multi-seat. That is, one seat/keyboard entering unicode-mode should not affect other seats/keyboards. The issue with this is that seat objects are Wayland global. Thus, in server mode, all seat objects are shared between the foot clients. There is a similarity with IME, which also keeps state in the seat. There's one big difference, however, and that is IME has Wayland native enter/leave events, that the compositor emits when windows are focused/unfocused. These events allow us to reset IME state. For our own Unicode mode, there is nothing similar. This patch moves the Unicode state from seats, to the terminal struct. This does mean that if one seat/keyboard enters Unicode mode, then *all* seats/keyboards will affect the unicode state. This potential downside is outweighed by the fact that different foot clients no longer affect each other. Closes #1717
* issue-template: feature: use yaml insteadDaniel Eklöf2024-05-21-19/+26
|
* issue-template: try to add another template, for feature requests.Daniel Eklöf2024-05-21-0/+19
|
* issue-template: it's validation*s*Daniel Eklöf2024-05-21-1/+1
|
* issue-template: try to fix link to INSTALL.md, attempt 3Daniel Eklöf2024-05-21-3/+4
|
* issue-template: try to fix link to INSTALL.md, attempt 2Daniel Eklöf2024-05-21-1/+1
|
* issue-template: try to fix link to INSTALL.mdDaniel Eklöf2024-05-21-1/+1
|
* forgejo: issue report templatesDaniel Eklöf2024-05-21-0/+74
|
* foot.ini: add commented out 'blink-rate'Daniel Eklöf2024-05-20-0/+1
|
* config: add cursor.blink-rate optionDaniel Eklöf2024-05-20-11/+37
| | | | | | The default is 500ms, which corresponds to the old, hardcoded default. Closes #1707
* themes: add onehalf-darkMariusz Bialonczyk2024-05-17-0/+39
|
* scripts: generate-builtin-terminfo: fix syntax errorArtturin2024-05-01-1/+1
|
* scripts: generate-builtin-terminfo: use \xNN for control charactersDaniel Eklöf2024-04-30-3/+3
| | | | | Instead of emitting raw control characters (for e.g. bel, cub1 and kbs), use \xNN C string escapes.
* dcs: xtgettcap: always reply with tigetstr(3) formatted "strings"Daniel Eklöf2024-04-27-21/+60
| | | | | | | | | | | That is, instead of sometimes replying with a "source" encoded string (where e.g. '\E' are returned just like that, and not as an actual ESC), always unescape all string values. This also includes \n \r \t \b \f \s, \^ \\ \ \:, as well as ^x-styled escapes. Closes #1701
* dcs: XTGETTCAP: handle empty requestDaniel Eklöf2024-04-20-0/+9
| | | | | | | If the XTGETTCAP request is empty (no capabilities in it), reply with an empty error reply. Closes #1694
* term: default to DPI 96, if the monitor's DPI is 0Daniel Eklöf2024-04-20-4/+13
| | | | | This can happen in virtualized environments, or when running a nested Wayland session.
* char32: mbsntoc32() returns a size_t, not a char32_tDaniel Eklöf2024-04-20-1/+1
|
* doc: foot: simplify example where we run a non-default commandDaniel Eklöf2024-04-20-1/+1
| | | | | To reduce the risk of people mistakenly believing you have to/should use "sh -c".
* changelog: add new 'unreleased' sectionDaniel Eklöf2024-04-17-0/+11
|
* Merge branch 'releases/1.17'Daniel Eklöf2024-04-17-10/+4
|\
| * meson: bump version to 1.17.21.17.2releases/1.17Daniel Eklöf2024-04-17-1/+1
| |
| * changelog: prepare for 1.17.2Daniel Eklöf2024-04-17-9/+3
| |
| * Merge branch 'master' into releases/1.17Daniel Eklöf2024-04-17-25/+110
| |\ | |/ |/|
* | term: stash last known DPI, and use after a unmapped/mapped sequenceDaniel Eklöf2024-04-17-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A compositor may unmap, and then remap the window, for example when the window is minimized, or if the user switches workspace. With DPI aware rendering, we *need* to know on which output we're mapped, in order to use the correct DPI. This means the first frame we render, before being mapped, always guesses the DPI. In an unmap/map sequence, guessing the wrong DPI means the window will flicker. Fix by stashing the last used DPI value, and use that instead of guessing. This means the *only* time we _actually_ guess the DPI, is the very first frame, when starting up foot.
* | ci: set explicit 'event' filters an all 'when'-statementsDaniel Eklöf2024-04-17-12/+12
| | | | | | | | | | | | This should fix the CI warnings we've started to see lately: [bad_habit] Please set an event filter on all when branches
* | ci: explicitly install opensslDaniel Eklöf2024-04-17-0/+3
| | | | | | | | Let's see if this fixes the missing SSL module in Python...
* | sixel: don't allow pan/pad changes after sixel data has been emittedDaniel Eklöf2024-04-15-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing pan/pad changes the sixel's aspect ratio. While I don't know for certain what a real VT340 would do, I suspect it would change the aspect ratio of all subsequent sixels, but not those already emitted. The way we implement sixels in foot, makes this behavior hard to implement. We currently don't resize the image properly if the aspect ratio is changed, but not the RA area. We have code that assumes all sixel lines have the same aspect ratio, etc. Since no "normal" applications change the aspect ratio in the middle of a sixel, simply disallow it, and print a warning. This also fixes a crash, when writing sixels after having modified the aspect ratio.
* | sixel: also set 'alloc_height', when short-cutting a resize operationDaniel Eklöf2024-04-15-2/+8
| | | | | | | | | | | | | | | | | | | | In some cases, a sixel may be resized vertically, while still having a zero-width. In this case, the resize operations are short-cutted, and no actual allocations are done. However, we forgot to set 'alloc_height' when doing so. As a result, the trimming code (when the sixel is "done"), trimmed away the entire sixel.
* | term: don't print outside grid when printing multi-column charactersDaniel Eklöf2024-04-15-1/+7
| | | | | | | | | | | | | | | | | | | | When auto-wrap is disabled, a multi-column character may be printed on a line that doesn't fit the entire character. That is, the "spacers" we print, as place holders in the columns after the first one, may reach outside the grid. We did (try to) check for this, but the check was off by one. Meaning, we could, in some cases, print outside the grid.
* | osc: reject notifications with invalid UTF-8 stringsDaniel Eklöf2024-04-15-0/+17
| |
* | wayland: remove has_wl_compositor_v6Daniel Eklöf2024-04-12-4/+1
| | | | | | | | | | | | | | | | | | We deviate slightly from the specification, in that we don't assume a preferred buffer scale of 1. Instead, we "guess" the scale *until we receive a surface_preferred_buffer_scale event. Because of this, we don't need the has_wl_compositor_v6 member, as it's enough to check if we have a non-zero 'preferred buffer scale'.
* | changelog: add a new 'unreleased' sectionDaniel Eklöf2024-04-11-0/+11
| |
* | Merge branch 'releases/1.17'Daniel Eklöf2024-04-11-7/+9
|\|
| * meson: bump version to 1.17.11.17.1Daniel Eklöf2024-04-11-1/+1
| |
| * changelog: prepare for 1.17.1Daniel Eklöf2024-04-11-6/+8
| |
| * Merge branch 'master' into releases/1.17Daniel Eklöf2024-04-11-29/+341
| |\ | |/ |/|
* | config: add new key-binding 'quit', unbound by defaultDaniel Eklöf2024-04-11-1/+13
| | | | | | | | Closes #1475
* | Typo fixizmyname2024-04-11-1/+1
| |
* | Add noirblaze themeizmyname2024-04-10-0/+31
| |
* | code of conduct: initial code-of-conductDaniel Eklöf2024-04-10-0/+89
| | | | | | | | | | | | | | | | Based on [River's](https://codeberg.org/river/river) code of conduct, which is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
* | config: add cursor.unfocused-styleDaniel Eklöf2024-04-10-7/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option controls how we render the cursor when the terminal window is unfocused. Possible values are: * hollow: the default, and how we rendered the cursor before this patch. * unchanged: render the cursor exactly the same way as when the window is focused. * none: do not render any cursor at all Closes #1582
* | dcs: DECRQSS: fix off-by-one when checking for space in the DCS bufferDaniel Eklöf2024-04-10-1/+3
| |
* | themes: add dracula-itermMarcin Puc2024-04-07-0/+25
| |
* | themes: add xterm themeHolger Weiß2024-04-06-0/+22
| | | | | | | | | | Include a theme for using xterm’s default palette (based on the XTerm-col.ad file included with the xterm source code, version 390).
* | term: send SIGHUP before SIGTERM when shutting downDaniel Eklöf2024-04-05-13/+61
| | | | | | | | | | | | | | | | If we're the ones initiating shutdown, start by sending SIGHUP. Only if the client application does not terminate, send SIGTERM (and if it still refuses to terminate, send SIGKILL). Also reduce the timeout between the signals from 60s to 30s.
* | term: don't shutdown terminal when PTY is closed, unless --pty was usedDaniel Eklöf2024-04-05-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unless --pty has been used, we do *not* want to shutdown the terminal when the PTY is closed by the client application; we want to wait for the client application to actually terminate. This was the behavior before the --pty patch. This was changed in the --pty patch, since then, we don't *have* a client application. That is, foot has not forked+exec:ed anything. The only way to trigger a shutdown (from the client side) is to close the PTY. This patch restores the old behavior, when --pty is *not* used. Closes #1666
* | wayland: only use the surface preferred scale if set by the compositorDaniel Eklöf2024-04-05-5/+1
| | | | | | | | | | | | | | | | Before this patch, we would, in some cases, fallback to the surface preferred (not fractional) scaling, even though the compositor hadn't actually published a preferred buffer scale; the presence of a v6 compositor interface doesn't mean we've actually received a preferred scale yet.
* | log: fix syslog not respecting the configured log levelDaniel Eklöf2024-04-05-0/+7
| |