aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
* | Merge branch 'sixel-dont-blend-opaque-images'Daniel Eklöf2021-04-14-1/+1
|\ \
| * | render: no need to blend fully opaque sixel images - just blit themDaniel Eklöf2021-04-14-1/+1
|/ /
* | Merge branch 'dont-let-jump-labels-extend-outside-window-geometry'Daniel Eklöf2021-04-10-27/+60
|\ \ | | | | | | | | | Closes #443
| * | render: don’t let URL jump label sub-surfaces extend outside window geometryDaniel Eklöf2021-04-10-27/+60
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have no guarantee that sub-surfaces extending outside the window geometry are rendered correctly (if at all). For example, both Sway and River will render the window border on top of the sub-surface. Future versions of Sway may clip the sub-surface. Since jump-labels are positioned slightly above, and to the left of the URLs first character, having a label on either the top row, or on the first column, will likely position it outside the window. This is handled by simply setting x/y to 0 (or, to -margin, since the label coordinate is later offsetted with the window margins). Second, if the label is very long, it may extend outside the window. This is very unusual for labels only showing the key, and not the URL itself, but could happen in this case too, if e.g. the user has configured double-width key characters. This is handled by calculating its maximum width, and then truncating the label. Although very unlikely, it is possible for a label to also extend outside the window’s vertical size. This could happen for very small font sizes, where the label’s own margins are large, relative to the font size. This case is currently not handled. Closes #443
* | doc: foot.ini: re-phrase the box-drawings-uses-font-glyphs sectionDaniel Eklöf2021-04-10-2/+3
| |
* | Merge branch 'optionally-render-box-drawing-characters-using-font-glyphs'Daniel Eklöf2021-04-10-1/+30
|\ \ | | | | | | | | | Closes #430
| * | doc: foot.ini: codespell: antaliasing -> antialiasingDaniel Eklöf2021-04-09-1/+1
| | |
| * | config: add box-drawings-uses-font-glyphs=no|yes optionDaniel Eklöf2021-04-09-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | When disabled, we render box drawing characters ourselves. This is the default. When enabled, we instead use font glyphs. I.e. no special treatment. Closes #430
* | | Merge branch 'underline-cursor-below-text-underline'Daniel Eklöf2021-04-10-2/+8
|\ \ \ | |/ / |/| | | | | Closes #415
| * | render: draw underline cursor below text underlineDaniel Eklöf2021-04-09-2/+8
|/ / | | | | | | | | | | | | This ensures the cursor is visible on cells where the text is underlined. Closes #415
* | changelog: rewrite entry for OSC 17/117/19/119Daniel Eklöf2021-04-08-2/+2
| |
* | Merge branch 'auto-left-margin-on-cub1-only'Daniel Eklöf2021-04-08-40/+20
|\ \ | | | | | | | | | Closes #441
| * | changelog: auto_left_margin on cub1 onlyDaniel Eklöf2021-04-08-0/+2
| | |
| * | term/vt: only do reverse-wrapping (‘bw’) on cub1Daniel Eklöf2021-04-08-40/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Foot currently does reverse-wrapping (‘auto_left_margin’, or ’bw’) on everything that calls ‘term_cursor_left()’. This is wrong; it should only be done for cub1. From man terminfo: auto_left_margin | bw | bw | cub1 wraps from column 0 to last column This patch moves the reverse-wrapping logic from term_cursor_left() to the handling of BS (backspace). Closes #441
* | Merge branch 'osc-17-19'Daniel Eklöf2021-04-08-13/+67
|\ \
| * | osc: implement OSC 17+19: change selection background/foreground colorsDaniel Eklöf2021-04-08-13/+67
|/ / | | | | | | | | And of course, we also implement the corresponding reset sequences, OSC 117+119.
* | Merge branch 'osc-11-alpha'Daniel Eklöf2021-04-08-26/+110
|\ \ | | | | | | | | | Closes #436
| * | osc: reset background alpha when resetting the background colorDaniel Eklöf2021-04-08-0/+2
| | |
| * | doc: foot-ctlseq: mention that we support transparency in OSC 11Daniel Eklöf2021-04-08-1/+3
| | |
| * | changelog: don’t use a hyphen between ‘OSC’ and the numberDaniel Eklöf2021-04-08-1/+1
| | |
| * | changelog: tweak wording for URxvt’s XParseColor extensionDaniel Eklöf2021-04-08-1/+1
| | |
| * | osc: parse_legacy_color(): the alpha component is not a floating point numberDaniel Eklöf2021-04-08-8/+7
| | | | | | | | | | | | | | | | | | When using the urxvt extension of the XParseColor format, the alpha component is not a floating point number, but a decimal number in the range 0-100.
| * | osc: parse_rgb(): ensure ‘alpha’ has been initializedDaniel Eklöf2021-04-08-1/+1
| | |
| * | osc: add support for URxvt extension to include alpha in OSC-11Daniel Eklöf2021-04-08-24/+105
|/ / | | | | | | | | | | | | There are two variants, either using a ‘[percent]’ prefix for legacy colors, or using ‘rgba:r/g/b/a’ instead of ‘rgb:r/g/b’. Closes #436
* | Merge branch 'drain-pty-when-client-terminates'Daniel Eklöf2021-04-08-4/+10
|\ \
| * | terminal: drain PTY when client terminatesDaniel Eklöf2021-04-07-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done by: * Not limiting the number of times we try to read from the PTY when we’ve have POLLHUP * Not requiring the entire the previous read to have filled our buffer. * Not erroring out on EIO.
* | | ci: build on alpine/latest, not edgeDaniel Eklöf2021-04-07-8/+6
|/ /
* | sixel: unhook: tighten up the condition needed for us to free image data pre-maturelyDaniel Eklöf2021-04-07-5/+5
| |
* | sixel: sixel_fini(): free image dataDaniel Eklöf2021-04-07-0/+1
| | | | | | | | | | Normally, this data is always free:d indirectly, when the sixel image that took over ownership is destroyed. But let’s play it safe.
* | Merge pull request 'Don't copy default colors from config to each terminal instance' (#438) from ↵dnkl2021-04-07-86/+61
|\ \ | | | | | | | | | | | | | | | refactor-colors into master Reviewed-on: https://codeberg.org/dnkl/foot/pulls/438
| * | config/terminal: refactor: remove “default_*” color members from terminal structDaniel Eklöf2021-04-07-86/+61
|/ / | | | | | | Access the original colors in the configuration instead.
* | wayland: {xdg_,}output_*(): free old strings before assigning new onesDaniel Eklöf2021-04-07-0/+7
| | | | | | | | | | | | Defensive programming; output_geometry() etc are typically only called once for an output instance. But let’s ensure we’re not leaking memory if it’s called more than once.
* | changelog: move OSC-4/104 fix from 1.7.1 to ‘unreleased’Daniel Eklöf2021-04-05-3/+3
| |
* | Merge branch 'osc-4-check-index-is-within-bounds'Daniel Eklöf2021-04-05-1/+14
|\ \ | | | | | | | | | Closes #434
| * | osc: verify OSC 4/104 color index is validDaniel Eklöf2021-04-05-1/+14
|/ / | | | | | | Closes #434
* | Merge branch 'fix-error-message-for-key-binding-collisions'Daniel Eklöf2021-04-05-36/+38
|\ \ | | | | | | | | | Closes #432
| * | config: make {search,url}_binding_action_map[] function localDaniel Eklöf2021-04-05-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures we don’t accidentally reference them from places we shouldn’t. Unfortunately, binding_action_map[] (for “normal” key bindings) cannot easily be made function local since it is used when parsing both key- and mouse bindings (i.e. it’s used in multiple functions).
| * | doc: foot.ini: fix default value for delete-next-wordDaniel Eklöf2021-04-05-1/+1
| | |
| * | config: parse_key_binding_section(): use provided action-mapDaniel Eklöf2021-04-05-1/+3
|/ / | | | | | | | | | | | | | | Don’t call has_key_binding_collisions() with ‘binding_action_map’ unconditionally; use the provided ‘action_map’ instead. This fixes wrong error messages for key combo collisions in key binding sections other than the regular “key-bindings”.
* | Merge branch 'sixel-fix-double-free-in-set-palette-size'Daniel Eklöf2021-03-30-2/+7
|\ \ | | | | | | | | | Closes #427
| * | sixel: fix double free caused by bad free() in sixel_colors_set()Daniel Eklöf2021-03-30-2/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sixel_color_set() is called when the number of (sixel) color registers is changed. It frees the current palette, and changes the “palette size” variable. Originally, we only had a single palette. This is the one free:d by sixel_color_set(). Later, we added support for private vs. shared palettes. With this change, we now have one palette that is “never” free:d (the shared one), and a private palette that is always free:d after a sixel has been emitted. ‘sixel.palette’ is a pointer to the palette currently in use, and should only be accessed **while emitting a sixel**. This is the pointer sixel_color_set() free:d. So for example, if ‘sixel.palette’ pointed to the shared palette, we’d free the shared palette. But, we didn’t reset ‘sixel.shared_palette’, causing a double free later on. Closes #427
* | Merge branch 'revert-remove-consumed-modifiers-from-set-sent-to-client'Daniel Eklöf2021-03-30-5/+10
|\ \ | | | | | | | | | Closes #425
| * | revert: input: do not include consumed modifiers in the set sent to the clientDaniel Eklöf2021-03-29-5/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two issues with it: * Not all applications decode the sequence into a set of modifiers + key, but use a fixed sequence -> combo mapping, that we broke. * There were unforeseen issues with e.g. F1-12, where the modifier were removed from combos like Ctrl+F12, or Alt+F12. The reason is simple; XKB tells us that Ctrl, or Alt, is a consumed modifier. Now, _why_ it thinks that is a different story. This reverts 6cd72bdee6c2b11f7cab15df9afb0ed92a7f8ba0 Closes #425
* | term: free vt.osc8.uri when destroying a terminalDaniel Eklöf2021-03-28-0/+2
| | | | | | | | | | Free vt.osc8.uri in term_destroy(), in the off chance, that the client application emitted an un-terminated OSC-8 URI.
* | install: add ‘ninja test’ to all build typesDaniel Eklöf2021-03-28-0/+3
| | | | | | | | | | | | | | While we don’t (yet) have any unit tests for foot, users can build foot with e.g. fcft and/or tllist as sub-projects. *They* have tests, and when doing PGO builds, those test binaries *must* be executed, or we get link failures in the final build.
* | changelog: add new ‘unreleased’ sectionDaniel Eklöf2021-03-28-0/+11
| |
* | Merge branch 'releases/1.7'Daniel Eklöf2021-03-28-11/+5
|\|
| * meson/pkgbuild: bump version to 1.7.11.7.1Daniel Eklöf2021-03-28-2/+2
| |
| * changelog: prepare for 1.7.1Daniel Eklöf2021-03-28-9/+3
| |
| * Merge branch 'master' into releases/1.7Daniel Eklöf2021-03-28-262/+463
| |\ | |/ |/|
* | Merge branch 'search-treat-empty-cells-as-spaces'Daniel Eklöf2021-03-28-0/+4
|\ \
| * | changelog: spaces matches empty cells in scrollback search modeDaniel Eklöf2021-03-28-0/+1
| | |
| * | search: when matching cell content, treat empty cells as spacesDaniel Eklöf2021-03-28-0/+3
| | |
* | | Merge branch 'sixel-trimming'Daniel Eklöf2021-03-28-3/+13
|\ \ \ | |/ / |/| |
| * | changelog: empty sixels resulted in non-empty imagesDaniel Eklöf2021-03-28-0/+1
| | |
| * | sixel: free backing buffer if final image size is zeroDaniel Eklöf2021-03-28-0/+5
| | |
| * | sixel: initialize max_non_empty_row_no to -1, not 0Daniel Eklöf2021-03-28-3/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | 0 is a perfectly valid row number, and if max_non_empty_row_no==0, that means we have *1* sixel row, and after trimming the image, the image will have a height of 6 pixels. If the sixel sequence is empty (or at least doesn’t emit any non-empty pixels), then trimming the image should result in an image height of 0. When max_non_empty_row_no is initialized to -1, it will still have that value in unhook(), which makes the final image height 0.
* | Merge branch 'pgo-clang-11'Daniel Eklöf2021-03-28-54/+118
|\ \ | | | | | | | | | Closes #418
| * | meson: replace log+debug+xmalloc static libraries with a single ‘common’ libraryDaniel Eklöf2021-03-27-7/+9
| | | | | | | | | | | | | | | | | | | | | There are cyclic dependencies between the log, debug and xmalloc libraries. While having them as separate static libraries work, as long as consumers of them link against all of them, having them in a single library feels slightly better.
| * | changelog: updated PGO build instructionsDaniel Eklöf2021-03-26-0/+5
| | |
| * | install: clang-11.x compatible PGO instructionsDaniel Eklöf2021-03-26-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM/Clang 11.x throws errors for _files_ without any profiling data: error: ../../async.c: Function control flow change detected (hash mismatch) async_write Hash = 72057641800614222 [-Werror,-Wbackend-plugin] This caused multiple issues with the current PGO instructions: * The `pgo` binary failed to link with `meson configure -Db_pgo=use` when doing a full PGO build (since it isn't used in this case); * `footclient` fails to link for the same reason. * `foot` fails to link for the same reason in **partial** PGO builds. The solution is to make sure all binaries that are built in the final phase (`-Db_pgo=use`) have been executed in the _generate_ phase. Doing this also means we can drop `-Wno-missing-profile` and friends. Also add `--sixel` to the `generate-alt-random-writes` command line in the description for a full PGO build. Closes #418
| * | install: add ‘llvm’ as an optional build dependencyDaniel Eklöf2021-03-26-0/+1
| | | | | | | | | | | | It is needed for PGO builds with Clang.
| * | PKGBUILD: do PGO with either gcc or clang, but nothing elseDaniel Eklöf2021-03-26-22/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this, we assumed gcc was being used. The build would fail if clang (or something else) was used. Now, we check whether we’re compiling with gcc or clang, and disable PGO if it’s neither of them. Furthermore, we’re now adding the necessary flags needed to do PGO with clang. Note that ‘llvm-profdata’, from the ‘llvm’ package is needed for PGO:ing with clang. PGO is disabled if it isn’t available. It would be nice to have ‘llvm’ as an optional make dependency, but PKGBUILDs doesn’t appear to support such a thing. Finally, the -Wno-missing-profile flag, and its friends, have been removed; instead we execute “footclient --version” (and “foot --version”, in partial PGO builds) to ensure all generated binaries have been executed before we do the final build (with -Db_pgo=use). This fixes build failures with clang >= 11.x.
| * | meson: only build the pgo helper binary when -Db_pgo=generateDaniel Eklöf2021-03-26-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the only time it’s needed. In non-PGO builds, it is completely unnecessary, and we’re only wasting CPU cycles building it. In full PGO builds, with -Db_pgo=use, we get link warnings and/or failures, depending on compiler, since the pgo binary hasn’t been executed.
| * | meson: build source files common to both foot and footclient as librariesDaniel Eklöf2021-03-26-10/+9
| | | | | | | | | | | | | | | Source files used by both foot and footclient are now compiled as static libraries, which foot and footclient links against.
| * | features: --version now logs +/-pgoDaniel Eklöf2021-03-26-4/+20
| | | | | | | | | | | | That is, whether the binary was compiled with PGO or not.
* | | readme: dpi & fonts: focus on *current* behaviorDaniel Eklöf2021-03-27-13/+14
|/ / | | | | | | | | | | | | | | | | The text was describing the original behavior, where output scaling was completely ignored, and tacked on a “btw, starting with foot-1.6...”. Now, simply describe the current behavior, and be more clear about _how_ dpi-aware can be changed.
* | Merge branch 'buffer-size-multiple-of-scale-factor'Daniel Eklöf2021-03-25-19/+53
|\ \ | | | | | | | | | Closes #409
| * | changelog: sub-surface sizes not a multiple of the scaling factorDaniel Eklöf2021-03-25-0/+4
| | |
| * | render: make sure surface buffer sizes are a multiple of the scaling factorDaniel Eklöf2021-03-25-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The buffer attached to a surface with wl_surface_attach() must have a width and height that both are a multiple of the scale configured for that buffer: The new size of the surface is calculated based on the buffer size transformed by the inverse buffer_transform and the inverse buffer_scale. This means that at commit time the supplied buffer size must be an integer multiple of the buffer_scale. If that's not the case, an invalid_size error is sent. Due to a libwayland bug[^1], this is currently *not* being reported as an error. However, recent versions of Sway have started enforcing this, and is e.g. dropping (not rendering) sub-surfaces that does not adhere to this. [^1]: https://gitlab.freedesktop.org/wayland/wayland/-/issues/194 Closes #409
| * | render: render_osd(): no need to pass width/height as parametersDaniel Eklöf2021-03-25-8/+8
|/ / | | | | | | | | | | All uses of render_osd() passes buf->width/buf->height as width/height. Thus, we can simply remove the width/height parameters and have render_osd() use buf->width and buf->height directly.
* | Merge branch 'sixel-deadlock'Daniel Eklöf2021-03-25-2/+3
|\ \
| * | render: draw sixels before taking the render worker lockDaniel Eklöf2021-03-25-2/+3
|/ / | | | | | | | | | | | | This fixes a possible deadlock; render_sixels_images() may call render_cell(), which may need to take the worker lock (when rendering either a blinking cell, or a box drawing glyph that isn’t yet in the glyph cache).
* | Merge branch 'per-seat-ime-state'Daniel Eklöf2021-03-25-146/+199
|\ \ | | | | | | | | | | | | Closes #411 Closes #324
| * | ime: set ‘have_warned = true’ to avoid warning over and over againDaniel Eklöf2021-03-25-0/+1
| | |
| * | changelog: don’t crash upon receiving text-input::enter without keyboard focusDaniel Eklöf2021-03-25-0/+3
| | |
| * | ime: log warning on text-input::done() received without keyboard focusDaniel Eklöf2021-03-25-0/+9
| | |
| * | ime: don’t enable IME if we don’t have keyboard focusDaniel Eklöf2021-03-25-8/+4
| | | | | | | | | | | | Closes #411
| * | ime: don’t pass ‘term’ to ime_update_cursor_rect()Daniel Eklöf2021-03-25-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | In all instances where we call ime_update_cursor_rect(), the ‘term’ argument is the same as seat->kbd_focus. So, let ime_update_cursor_rect() use that directly instead. Also make ime_send_cursor_rect() static (i.e. local to ime.c).
| * | ime: codespell: actaually -> actuallyDaniel Eklöf2021-03-25-1/+1
| | |
| * | ime: move preedit state from terminal struct to the seat structDaniel Eklöf2021-03-25-135/+177
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures different seat’s don’t step on each others IME pre-edit state. It also removes most dependencies on having a valid term pointer for many IME operations. We’re still not all the way, since we support disabling IME with a private mode, which is per terminal, not seat. Thus, we still require the seat to have keyboard focus on one of our windows. Closes #324. But note that *rendering* of multiple seat’s IME pre-edit strings is still broken.
* | Merge branch 'clear-linebreak-flag-when-printing'Daniel Eklöf2021-03-25-0/+4
|\ \ | | | | | | | | | Closes #410
| * | changelog: newlines incorrectly inserted into copied textDaniel Eklöf2021-03-23-0/+2
| | |
| * | term: term_print(): clear line break flagDaniel Eklöf2021-03-23-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The line break flag is used by the text reflow and text extraction (i.e. copy-paste) logic, to determine whether or not to insert a newline between two lines. There’s some amount of heuristics involved in this. For example, the client application could emit a newline, move the cursor back up, and print text. What does that mean for us? Foot’s behavior up until now has been this: The line break flag is set on the row, when the application emits an explicit linefeed. The flag is cleared when the line is erased. But otherwise not. This meant that emitting a linefeed and then moving the cursor back up and printing text, did not clear the line break flag. This in turn meant that text copied always had newlines inserted, even though that was not the client applications intention. By clearing the line break flag whenever _anything_ is printed to a row, the new behavior is, in practice, that the line break flag is only set on a row if a linefeed was that *last* thing printed to that row. Closes #410
* | Merge branch 'zoom-line-height'Daniel Eklöf2021-03-21-8/+22
|\ \
| * | term: increase/decrease custom line-height with font size changesDaniel Eklöf2021-03-21-8/+22
|/ / | | | | | | | | | | | | | | When the user has set a custom line-height, we now adjust it when increasing/decreasing (“zooming”) the font size at run-time. Previously, the line-height was fixed at the size specified in foot.ini.
* | Merge branch 'match-all-required-modifiers-before-unshifting-symbol'Daniel Eklöf2021-03-21-1/+6
|\ \ | | | | | | | | | Closes #407
| * | input: must have all required modifiers to un-shift a symbolDaniel Eklöf2021-03-21-1/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When detecting, and repairing, “broken” key bindings (where the key binding itself explicitly lists a modifier that is consumed by the final symbol - e.g “Shift+W”), don’t just look for an intersection between the set of modifiers needed to produce the final symbol, and the modifiers listed in the key combo. Instead, check if the key combo has *all* the required modifiers. Example: Shift+AltGr+w produces Page_Down. I.e. Page_Down is the _shifted_ symbol, ‘w’ is the un-shifted symbol, and Shift+AltGr are the modifiers required to shift ‘w’ to Page_Down. If we have the key combo Shift+Page_Down, foot would, correctly, determine that Page_Down is a shifted symbol. It would find the Shift+AltGr modifier set, and since the intersection of “Shift+AltGr” and “Shift” (from our key combo) is non-empty, foot would (incorrectly) determine that we can, and should, replace Page_Down with its un-shifted symbol ‘w’. This is completely wrong, since Shift+w does _not_ produce Page_Down. Closes #407
* | doc: benchmark: update "workstation" benchmarks with 1.7.0 resultsDaniel Eklöf2021-03-20-8/+8
| |
* | doc: benchmark: updated “laptop” benchmark with 1.7.0 resultsDaniel Eklöf2021-03-20-8/+8
| |
* | changelog: add new ‘unreleased’ sectionDaniel Eklöf2021-03-20-0/+11
| |
* | Merge branch 'releases/1.7'Daniel Eklöf2021-03-20-6/+5
|\|
| * changelog: 1.7.01.7.0Daniel Eklöf2021-03-20-4/+3
| |
| * meson/pkgbuild: bump version to 1.7.0Daniel Eklöf2021-03-20-2/+2
|/
* Merge branch 'add-bash-completions'Daniel Eklöf2021-03-17-0/+164
|\ | | | | | | Closes #10
| * Add: Bash completion for foot and footclientSimon Schricker2021-03-17-0/+164
|/ | | | | | | * use toe for terminfo, thanks Craig. * adds optional dependency on bash-completion for positional arguments Co-authored-by: Craig Barnes <craigbarnes@protonmail.com>
* Merge branch 'optimized-print-function'Daniel Eklöf2021-03-16-16/+95
|\
| * csi: update ASCII printer function pointer when switching to/from alt screenDaniel Eklöf2021-03-16-0/+1
| | | | | | | | | | This is necessary since switching screen may change how many sixels we have in the scrollback.
| * term: update_ascii_printer(): log when we (actually) switch printerDaniel Eklöf2021-03-16-1/+11
| |
| * term: runtime switch between a ‘fast’ and a ‘generic’ ASCII print functionDaniel Eklöf2021-03-16-16/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | term_print() is called whenever the client application “prints” something to the grid. It is called for both ASCII and UTF-8 characters, and needs to handle sixels, insert mode and ASCII vs. graphical charsets. Since it’s on the hot path, this becomes unnecessarily slow. This patch adds a “fast” version of term_print(), tailored for the common case: ASCII characters in non-insert mode, without any sixels and non-graphical charsets. A new function, term_update_ascii_printer(), has been added, and must be called whenever: * The currently selected charset *index* changes * The currently selected charset changes (from ASCII to graphical, or vice verse) * Sixels are added to the grid * Sixels are removed from the grid * Insert mode is enabled/disabled