aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
* readme: add suggested cflags for a release buildDaniel Eklöf2020-05-18-3/+10
|
* term: erase_cell_range: set row->dirty before calling memset()Daniel Eklöf2020-05-17-2/+2
|
* term: scrolling: mark selection top if-statement as 'unlikely'Daniel Eklöf2020-05-17-4/+4
|
* term: scrolling: hopefully fix all selection/scrolling related crashesDaniel Eklöf2020-05-17-17/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When scrolling, there are a couple of cases where an existing selection must be canceled because we cannot meaningfully represent it after scrolling. These are when the selection is (partly) inside: * The top scrolling region * The bottom scrolling region * The new lines scrolled in. I.e. re-used lines For the scrolling regions, the real problem is when the selection crosses the scrolling region boundary; a selection that is completely inside a scrolling regions _might_ be possible to keep, but we would need to translate the selection coordinates to the new scrolling region lines. For simplicity, we cancel the selection if it touches the scrolling region. Period. The last item, newly scrolled in lines is when the selection covers very old lines and we're now wrapping around the scrollback history. Then there's a fourth problem case: when the user has started a selection, but hasn't yet moved the cursor. In this case, we have no end point. What's more problematic is that when the user (after scrolling) moves the cursor, we try to create a huge selection that covers mostly empty (NULL) rows, causing us to crash. This can happen e.g. when reverse scrolling in such a way that we wrap around the scrollback history. The actual viewport in this case is something like `-n - m`. But the selection we'll end up trying to create will be `m - (rows - n)`. This range may very well contain NULL rows. To deal with this, we simply cancel the selection.
* selection: on_rows_in_view: fix range checkDaniel Eklöf2020-05-17-7/+5
|
* term: scrolling: sixel: simplify now that row count is clampedDaniel Eklöf2020-05-17-2/+2
|
* term: scrolling: in debug builds, verify all rows are allocatedDaniel Eklöf2020-05-16-0/+10
|
* term: scrolling: simplify, now that scroll row count is clampedDaniel Eklöf2020-05-16-11/+5
|
* term: scrolling: clamp number of rows to number of rows in scrolling regionDaniel Eklöf2020-05-16-13/+6
|
* grid: swap_row: remove unused parameter 'initialize'Daniel Eklöf2020-05-16-6/+6
|
* selection: copy: insert line break if either cell is emptyDaniel Eklöf2020-05-16-1/+5
|
* selection/render: sync cells' 'selected' bit before renderingDaniel Eklöf2020-05-16-0/+31
| | | | | | | | | | | | | | | | | | | | | | | For performance reasons, we track whether a cell is selected or not using a bit in a cell's attributes. This makes it easy for the renderer to determine if the cells should be rendered as selected or not - it just have to look at the 'selected' bit instead of doing a complex range check against the current selection. This works nicely in most cases. But, if the cell is updated, the 'selected' bit is cleared. This results in the renderer rendering the cell normally, i.e. _not_ selected. Checking for this, and re-setting the 'selected' bit when the cell is updated (printed to) is way too expensive as it is in the hot path. Instead, sync the 'selected' bits just before rendering. This isn't so bad as it may sound; if there is no selection this is a no-op. Even if there is a selection, only those cells whose 'selected' bit have been cleared are dirtied (and thus re-rendered) - these cells would have been re-rendered anyway.
* term: scrolling: clear selection *before* scrollingDaniel Eklöf2020-05-16-12/+15
| | | | | | | | | | | | We normally don't clear the selection when scrolling. The exception is when the selection covers re-used rows. I.e. rows that we scroll in and clear. In this case we cancel the selection (we _could_ modify it and keep as much as possible and only remove the re-used rows...). We must do this *before* scrolling, since scrolling will swap rows (when there's a scrolling region). When this happens, the selection is "corrupted", and canceling it afterwards will not work.
* selection: update: don't assert on 'start' being setDaniel Eklöf2020-05-16-0/+1
|
* selection: don't automatically no-op operations if selection isn't enabledDaniel Eklöf2020-05-16-29/+25
| | | | | | | | | | | | | | | | | | When the client is capturing the mouse, selection can only be done by holding done shift. This is why a lot of selection functions are no-ops if selection isn't currently enabled. However, there are many cases where we actually need to modify the selection. In particular, selection_cancel(). Thus, only check for enabled selection when we're dealing with user input. Bonus: this also fixes a bug where an ongoing selection were finalized as soon as the user released shift, even if he was still holding down the mouse button.
* selection: on_row_in_view() -> on_rows_in_view(), and now takes a rangeDaniel Eklöf2020-05-16-15/+37
| | | | | This allows us to check the selection once when scrolling, instead of once for each scrolled in line.
* render: only apply transparency to the default background colorDaniel Eklöf2020-05-16-2/+9
|
* readme: add 'synchronized updates' to feature listDaniel Eklöf2020-05-16-0/+1
| | | | The support in foot isn't new, but let's make it more visible.
* terminfo: add tmux extension 'Sync' - indicates 'Synchronized Updates' supportDaniel Eklöf2020-05-16-0/+5
|
* changelog: prepare for the next, unreleased versionDaniel Eklöf2020-05-13-0/+11
|
* Merge branch 'releases/1.3'Daniel Eklöf2020-05-13-8/+5
|\
| * meson/PKGBUILD: bump version to 1.3.01.3.0releases/1.3Daniel Eklöf2020-05-13-2/+2
| |
| * changelog 1.3.0Daniel Eklöf2020-05-13-6/+3
|/
* slave: configure pts to be the controlling terminal of the forked processDaniel Eklöf2020-05-13-0/+8
|
* Merge branch 'fcft-precompose'Daniel Eklöf2020-05-13-33920/+37
|\
| * unicode-combine: simplify - remove -Dunicode-precompose optionDaniel Eklöf2020-05-10-44/+7
| | | | | | | | | | | | | | | | | | | | Since the pre-composing functionality is now part of fcft, it makes little sense to have a compile time option - there's no size benefit to be had. Furthermore, virtually all terminal emulators do pre-composing (alacritty being an exception), this really isn't that controversial.
| * readme: unicode-combining: mention when we render the decomposed versionDaniel Eklöf2020-05-09-0/+5
| |
| * meson/PKGBUILD: we now require fcft-2.1.0Daniel Eklöf2020-05-09-2/+2
| |
| * meson: explicitly define _POSIX_C_SOURCEDaniel Eklöf2020-05-09-1/+2
| |
| * unicode-precompose: use fcft's precompose functionalityDaniel Eklöf2020-05-09-33878/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows us more options when determining whether to use a pre-composed character or not: We now only use the pre-composed character if it's from the primary font, or if at least one of the base or combining characters are from a fallback font. I.e. use glyphs from the primary font if possible. But, if one or more of the decomposed glyphs are from a fallback font, use the pre-composed character anyway.
* | wayland: force-trigger a resize on 'configured' eventDaniel Eklöf2020-05-12-1/+2
| | | | | | | | | | | | | | | | | | This ensures we _always_ commit a **new** buffer in response to a configured event. This fixes an issue in Gnome where e.g. tiling the window (on the left/right side) only worked if that caused the windows size to change.
* | readme: use unicode RIGHT ARROW instead of '->'Daniel Eklöf2020-05-10-1/+1
| |
* | readme: short section describing the origins of the name 'foot'Daniel Eklöf2020-05-10-0/+18
| |
* | generate-unicode-precompose: /bin/sh is more standard than /usr/bin/shDaniel Eklöf2020-05-09-2/+2
|/ | | | | | | At the same time, fix `cut` command to pass filename last, as this is also more portable. Fixes build issues on e.g. Alpine Linux
* Revert "term: print: line-wrap multi-column characters instead of cutting them in half"Daniel Eklöf2020-05-09-6/+4
| | | | | | | This reverts commit 8448296bb3c0fa96f5af5cb7ec563bb0c7e99093. Applications need to be multi-column character aware anyway, and they should deal with this.
* term: print: line-wrap multi-column characters instead of cutting them in halfDaniel Eklöf2020-05-09-4/+6
|
* completions: zsh: complete command/shell, and its argumentsDaniel Eklöf2020-05-08-4/+8
|
* main/client: be POSIXLY_CORRECT when parsing command lineDaniel Eklöf2020-05-08-12/+15
| | | | | | | | | | | | | | | | | | | | This means command line parsing stops when it encounters the first nonoption argument. The result is that one no longer need to use '--' to ensure arguments are passed to the shell/command, instead of parsed by foot. That is, instead of foot -- sh -c true one can now do foot sh -c true Arguments to foot *must* go before the command: foot --fullscreen sh -c true
* term: don't register ptmx with FDM if we're shutting downDaniel Eklöf2020-05-04-2/+4
| | | | | This can happen when there's an error instantiating the terminal *after* we've spawned the slave process.
* term: set 'is_shutting_down' before calling term_destroy() on errorDaniel Eklöf2020-05-04-0/+1
|
* csi: ignore invalid parameters in 'CSI Ps <space> q'Daniel Eklöf2020-05-04-4/+10
| | | | | Before this patch, an invalid parameter would not change the cursor style, but could cause the cursor to start (or stop) blinking.
* term: check return value when instantiating thread synchronization primitivesDaniel Eklöf2020-05-04-4/+25
|
* meson: use find_program() to find 'tic'Daniel Eklöf2020-05-03-1/+2
|
* term: thrd_success isn't necessarily 0Daniel Eklöf2020-05-03-3/+3
|
* util: thrd_err_as_string: fix alignmentDaniel Eklöf2020-05-03-1/+1
|
* thrd_create(): handle errors correctlyDaniel Eklöf2020-05-03-13/+31
| | | | | | * Detect thrd_create() failures in all places where we instantiate threads * Log error correctl; thrd_create() does not return an errno value
* util: thrd_err_as_string(): new function, returns a thrd_*() error stringDaniel Eklöf2020-05-03-0/+18
|
* Merge branch 'space-optimize-combining-chars'Daniel Eklöf2020-05-03-115/+137
|\
| * unicode-combining: limit maximum number of allowed composed chainsDaniel Eklöf2020-05-03-5/+13
| |
| * unicode-combining: detect when we've reached the chain limitDaniel Eklöf2020-05-03-0/+14
| | | | | | | | | | | | | | | | | | | | | | We currently store up to 5 combining characters in any given base+combining chain. This adds a check for when that limit is about to be exceeded. When this happens, we log the chain + the new combining character. Since things will break anyway, we simply overwrite the last combining character.
| * changelog: update 'unicode comining' entry - only parts of the feature are optionalDaniel Eklöf2020-05-03-2/+3
| |
| * readme: update 'Unicode combining'Daniel Eklöf2020-05-03-21/+15
| |
| * unicode-combining: store seen combining chains "globally" in the term structDaniel Eklöf2020-05-03-92/+97
|/ | | | | | | | | | | | | | | | | | | | Instead of storing combining data per cell, realize that most combinations are re-occurring and that there's lots of available space left in the unicode range, and store seen base+combining combinations chains in a per-terminal array. When we encounter a combining character, we first try to pre-compose, like before. If that fails, we then search for the current base+combining combo in the list of previously seen combinations. If not found there either, we allocate a new combo and add it to the list. Regardless, the result is an index into this array. We store this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell. When rendering, we need to check if the cell character is a plain character, or if it's a composed character (identified by checking if the cell character is >= COMB_CHARS_LO). Then we render the grapheme pretty much like before.
* osc: fix scaling of RGB formatted color specifiersDaniel Eklöf2020-05-02-4/+4
|
* osc: OSC 12: mimic xterm - a color value of 0 means use inverted fg/bgDaniel Eklöf2020-05-02-1/+6
|
* osc: fix 'OSC 12 ?' to return the cursor color, not the cursor text colorDaniel Eklöf2020-05-02-3/+5
|
* osc: fix scaling of legacy formatted color specifiersDaniel Eklöf2020-05-02-4/+4
|
* render: don't re-instantiate the foreground pixman sourceDaniel Eklöf2020-05-02-6/+5
|
* vt: use signed integers to correctly detect when we're doneDaniel Eklöf2020-05-02-2/+2
|
* readme: sligh re-wording of the "Unicode combining" chapterDaniel Eklöf2020-05-02-8/+9
|
* meson: don't generate pre-compose table when -Dunicode-precompose=falseDaniel Eklöf2020-05-02-6/+12
|
* meson: only define FOOT_UNICODE_PRECOMPOSE if combining chars > 0Daniel Eklöf2020-05-02-2/+3
|
* meson: generate unicode compose tableDaniel Eklöf2020-05-02-1037/+8
| | | | This replaces the pre-generated table used up until now.
* script: generate-unicode-precompose: generate a complete header fileDaniel Eklöf2020-05-02-2/+27
|
* readme: utf8proc is no longer a dependencyDaniel Eklöf2020-05-02-2/+0
|
* changelog: try to fix link for Codebergs markdown parserDaniel Eklöf2020-05-02-1/+1
|
* changelog: remove bad ']' in linkDaniel Eklöf2020-05-02-1/+1
|
* unicode-combine: remove utf8proc dependencyDaniel Eklöf2020-05-02-40/+34934
| | | | | | | | | | | | We only used utf8proc to try to pre-compose a glyph from a base and combining character. We can do this ourselves by using a pre-compiled table of valid pre-compositions. This table isn't _that_ big, and binary searching it is fast. That is, for a very small amount of code, and not too much extra RO data, we can get rid of the utf8proc dependency.
* unicode-combining: don't limit ourselves to the (western) diacritics blocksDaniel Eklöf2020-05-02-13/+19
|
* render: de-indent #if statementDaniel Eklöf2020-05-01-1/+1
|
* unicode-combining: pack structDaniel Eklöf2020-05-01-1/+1
|
* unicode-combine: leave a note saying we might need more than 2 combining charsDaniel Eklöf2020-05-01-1/+1
|
* unicode-combine: only compose if we don't have any other combining charactersDaniel Eklöf2020-05-01-16/+24
| | | | | | | | | If the client sent the sequence SAB, where SA does NOT have a composed representation, but SB does, the old code would compose SB and throw away A. This patch fixes this by only allowing a compose if there aren't any pre-existing combining characters.
* meson: emit a 'summary()' at the endDaniel Eklöf2020-05-01-0/+7
|
* Merge branch 'unicode-combining-for-real'Daniel Eklöf2020-05-01-89/+164
|\
| * unicode-combining: completely remove unicode combining characters when feature is disabledDaniel Eklöf2020-05-01-2/+26
| |
| * term: combining characters: reduce max number of combining charactersDaniel Eklöf2020-05-01-1/+1
| |
| * changelog: rewrite entry for combining charactersDaniel Eklöf2020-05-01-8/+6
| |
| * selection: extract text: also copy combining charactersDaniel Eklöf2020-05-01-14/+23
| |
| * render: render combining charactersDaniel Eklöf2020-05-01-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is basically just a loop that renders additional glyphs on top off the base glyph. Since we now need access to the row struct, for the combining characters, the function prototype for 'render_cell()' has changed. When rendering the combining characters we also need to deal with broken fonts; some fonts use positive offsets (as if the combining character was a regular character), while others use a negative offset (to be used as if you had already advanced the pen position). We handle both - a positive offset is rendered just like a regular glyph. When we see a negative offset we simply add the width of a cell first.
| * grid: reflow: copy combining charactersDaniel Eklöf2020-05-01-0/+9
| |
| * vt: utf8: track combining characters that we failed to composeDaniel Eklöf2020-05-01-15/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we detect a combining character, we first try to compose it with the base character (like before). When this fails, we instead add the combining character to the base cell's combining characters array. The reason for using a composed character when possible is twofold: one, the rendered glyph will look better since it will be a single glyph instead of two separate glyphs (possibly from different fonts(!)). And two, for performance. A composed glyph is a single glyph to render, while a decomposed glyph sequence means the renderer has to render multiple glyphs for a single cell.
| * term: print: reset combining characters for this cellDaniel Eklöf2020-05-01-0/+1
| | | | | | | | | | | | | | | | | | | | | | This is the *only* place combining characters are reset. In particular, we do *not* reset them in a normal cell erase. This is a performance design decision - clearing the combining characters in erase is way too slow. This way, we clear it only when we *have* to. Anything looking at the combining characters must first ensure the base character is not 0.
| * grid: add per-cell combining charactersDaniel Eklöf2020-05-01-1/+11
| | | | | | | | | | | | | | | | | | | | The data is *not* added to the cell struct, since that one is too performance critical. Instead, the data is added as a separate array in the row struct. This allows our performance critical code paths that e.g. clear cells to perform as before.
| * util.h: new header file defining commonly used macrosDaniel Eklöf2020-05-01-39/+18
|/
* term: don't enable ptmx FDM callback until Wayland window has been configuredDaniel Eklöf2020-04-30-4/+26
| | | | | | | | | | | | | The way things works right now, we cannot enable the ptmx FDM callback right away. We need to wait for the Wayland window to have been configured. Before the window is configured, we don't have a size, and no grid. Thus, if we try to process ptmx data we'll crash since we have no where to write it to. So, registering the ptmx fd with the FDM is now delayed until we've received the first 'configure' event from Wayland.
* term: start slave before loading fonts and starting rendering threadsDaniel Eklöf2020-04-30-8/+9
| | | | | This allows the client to load in parallel with our font loading, which should improve startup time.
* main: only set LC_CTYPEDaniel Eklöf2020-04-29-1/+1
| | | | | | This is the only locale variable we need. This ensures LC_NUMERIC in particular remains as "C", which is needed by fcft when instantiating new fonts.
* term: font size adjust: re-load fonts in parallelDaniel Eklöf2020-04-29-9/+30
|
* term: destroy: handle rendering threads not being initializedDaniel Eklöf2020-04-29-11/+15
| | | | | We sort of already did this. However, we did not handle the case where the thread array itself hadn't yet been allocated.
* term: initialize rendering worker threads after instantiating fontsDaniel Eklöf2020-04-29-3/+2
| | | | | | This ensures the resources (e.g. stack) used by the transient threads used to load the primary fonts can be re-used by the rendering worker threads.
* csd: buttons: use default color table as default colorsDaniel Eklöf2020-04-29-6/+9
| | | | | If the user hasn't configured any CSD button colors, use the color scheme's default colors for blue/green/red.
* changelog: change -> changesDaniel Eklöf2020-04-28-1/+1
|
* term: load primary fonts in parallelDaniel Eklöf2020-04-28-8/+38
| | | | | | | | Use four threads to load the four primary font variants - normal, bold, italic and bold italic. This speeds up initial startup, and reloading of fonts on a DPI change.
* wayland: monitor unplug: call surface_leave() to handle terminal unmappingDaniel Eklöf2020-04-28-14/+7
|
* wayland: handle outputs disappearingDaniel Eklöf2020-04-27-11/+51
| | | | | | | | | That is, deal with monitors being unplugged. At least on Sway 1.4, surfaces are not unmapped before the output is removed. Thus, in addition to free:ing the monitor resources, we also need to update all terminals that are mapped on this output - remove the output from their "mapped on" list.
* wayland: group handle_global() together with handle_global_removed()Daniel Eklöf2020-04-27-131/+131
|
* Merge branch 'unicode-combining'Daniel Eklöf2020-04-27-22/+68
|\
| * vt: lazily reset utf8 in action_utf8_*_entryDaniel Eklöf2020-04-27-4/+3
| | | | | | | | | | | | | | | | action_clear() is in the super hot code path. Avoid resetting utf8 state there, as utf8 input is relatively uncommon. Instead, reset it when we explicitly enter any of the utf8 collecting states, as this is exactly the point where we need it.
| * vt: action_utf8_print: idx is cleared in action_clear()Daniel Eklöf2020-04-27-3/+0
| |