aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* render: delayed reflow: not enough to damage current view; need to refresh tooDaniel Eklöf2022-10-10-1/+3
|
* sixel: add sixel_reflow_grid()Daniel Eklöf2022-10-10-62/+70
| | | | | | | | | This function reflows all sixels in the specified grid. The pre-existing sixel_reflow() function is a shortcut for sixel_reflow_grid(term, &term->normal) sixel_reflow_grid(term, &term->alt);
* changelog: fixed crash when resizing window with a very large scrollbackDaniel Eklöf2022-10-10-0/+2
|
* render: resize: ignore ptmx read events during interactive resizeDaniel Eklöf2022-10-10-0/+19
|
* render: performance improvements during interactive resizeDaniel Eklöf2022-10-10-5/+37
| | | | | | | | | | | Instead of copying the entire grid when an interactive resize is started, stash the complete grid (to be used in the final reflow). Copy the current viewport only, to be used during the interactive resize. This gets rid of the initial "pause" when snapshotting the grid when an interactive resize is started.
* render: delay reflow for ‘resize-delay-ms’ millisecondsDaniel Eklöf2022-10-10-20/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reflowing a large scrollback is *slow*. During an interactive resize, it can easily take long enough that the compositor fills the Wayland socket with configure events. Eventually, the socket becomes full and the compositor terminates the connection, causing foot to exit. This patch is work-in-progress, and the first step towards alleviating this. It delays the reflow by: * Snapshotting (copying) the original grid when an interactive resize is started. * While resizing, we apply a simple truncation resize of the grid (like we handle the alt screen). * When the resize is done, or paused for ‘resize-delay-ms’, the grid is reflowed. TODO: we *must* not allow any changes to the temporary (truncated) grid during the resize. Any changes to the grid would be lost when the final reflow is applied. That is, we must completely pause the ptmx pipe while a resize is in progress. Future improvements: The initial copy can be slow. We should be able to avoid it by rewriting the reflow algorithm to not free anything. This is complicated by the fact that some resources (e.g. sixel images) are currently *moved* to the new grid. They’d instead have to be copied.
* pgo: run xtgettcap without any argumentsDaniel Eklöf2022-10-10-5/+5
| | | | | | | | We execute xtgettcap in the parent terminal. Thus we don’t know if it implements XTGETTCAP, and thus it’s not guaranteed to exit - it may hang indefinitely waiting for a reply. Fix by not actually quering anything.
* xtgettcap: exit immediately when there are no capabilities to query forDaniel Eklöf2022-10-10-2/+5
|
* install.md: add `./utils/xtgettcap name` to "full PGO" instructions tooDaniel Eklöf2022-10-09-3/+5
|
* install.md: add xtgettcap to PGO build instructionsDaniel Eklöf2022-10-08-3/+5
|
* pgo: execute xtgettcap utility, to get profiling dataDaniel Eklöf2022-10-07-0/+2
| | | | | | Fixes: ../utils/xtgettcap.c:175:1: error: ‘/home/daniel/src/foot/src/utils/xtgettcap.p/xtgettcap.c.gcda’ profile count data file not found [-Werror=missing-profile]
* utils: xtgettcap: new utility, to send XTGETTCAP queriesDaniel Eklöf2022-10-07-0/+177
|
* scripts: generate-builtin-terminfo: escape fixesDaniel Eklöf2022-10-05-7/+14
| | | | | * Remove ‘:’ escaping only in raw (non-parameterized) sequences * Double-escape *all* escape characters in parameterized sequences
* scripts: generate-builtin-terminfo: double-escape backslash in STDaniel Eklöf2022-10-05-0/+6
| | | | | Fixes an issue with XTGETTCAP, where escape sequences terminated with ST, and containing parameters were missing a trailing backslash.
* render: fix nanosec "overflow" when calculating timeout valueAlexey Sakovets2022-10-05-1/+6
|
* Add zenburn themeHugo Osvaldo Barrera2022-10-04-0/+23
| | | | This is the one included by default in previous releases.
* doc: fix tiny typoNick Hastings2022-10-04-1/+1
|
* spawn: set $PWD, in addition to calling chdir(cwd)Daniel Eklöf2022-10-02-3/+6
|
* main/client: use $PWD for cwd, when $PWD is validDaniel Eklöf2022-10-02-0/+44
| | | | | | | | | If $PWD is set, and its resolved path matches the *actual* working directory, use $PWD for cwd when instantiating the terminal. This makes a difference when $PWD refers to a symlink; before this patch, we’d instantiate the terminal in the *resolved* path. Now it’ll use the symlink instead.
* slave: spawn: set PWD environment variableDaniel Eklöf2022-10-02-0/+3
| | | | | | | | This improves handling of symlinks (in CWD) when launching a new terminal instance, either through ctrl+shift+n, or using the --working-directory command line option. Closes #1179
* scripts: generate-builtin-terminfo: add synthetic ‘name’ capabilityDaniel Eklöf2022-09-28-0/+2
| | | | Same as ‘TN’; reports the terminfo name.
* terminfo: add kxIN + kxOUT (focus in/out events)Daniel Eklöf2022-09-26-1/+3
| | | | | | | | | | | | | | | These capabilities are not included in the standard ‘xterm’ or ‘xterm-256color’ terminfos. They’re used in ‘xterm+focus’ -> ‘xterm+sm+1002’ -> ‘xterm-1002|xterm+sm+1003’ -> ‘xterm-1003’ (https://invisible-island.net/ncurses/terminfo.ti.html#tic-xterm_focus) However, as far as I can tell, ncurses doesn’t use these capabilities at all.
* term: utmp: set ‘host’ to WAYLAND_DISPLAYDaniel Eklöf2022-09-23-2/+2
| | | | This is similar to what XTerm does (setting it to DISPLAY)
* Add support for creating utmp recordsDaniel Eklöf2022-09-23-11/+105
| | | | | | | | | | | | | | | | | This patch adds support for creating utmp records using the ‘utempter’ helper binary from the ‘libutempter’ package. * New config option ‘main.utempter’ * New meson command line option, -Ddefault-utempter-path. Defaults to auto-detecting the path. The default value of the new ‘main.utempter’ config option depends on the meson command line option ‘-Ddefault-utempter-path’. If ‘main.utempter’ is *not* set to ‘none’, foot will try to execute the utempter helper binary to create utmp records when a new terminal is instantiated. The record is removed when the terminal instance is destroyed.
* Merge branch 'nightfly-and-moonfly'Daniel Eklöf2022-09-23-0/+58
|\
| * Add the moonfly themeTorsten Trautwein2022-09-22-0/+29
| |
| * Add the nightfly themeTorsten Trautwein2022-09-22-0/+29
| |
* | render: overlay: fix visual glitches when double bufferingDaniel Eklöf2022-09-23-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rendering the overlay for scrollback search, the logic assumed buffer re-use. On some compositors this isn’t happening (on e.g. KDE/plasma we’re forced to double buffer). This resulted in matches not being highlighted correctly. The problem is in how we calculated the region for which areas to clear ("un-dim"). It uses the "previous frame’s see-through area" minus the current frame’s see-through area. However, when we’ve detected that the current buffer isn’t the same as the last one, we set the last frame’s see-through region to "the entire buffer". Thus, when calculating the diff, we end up with an empty region, and nothing is highlighted. Fix by simply using the current frame’s see-through region as-is when we’ve detected we’re not re-using the last frame’s buffer.
* | render: fix application of old scroll damage when double bufferingDaniel Eklöf2022-09-23-67/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On compositors that forces us to double buffer, we need to re-apply the last frame’s damage to the current frame (which uses the buffer from the next-to-last frame). General cell updates are handled by simply copying from the last frame’s pixman buffer to the current frame’s. In an attempt to improve performance, scroll damage were up until now handled by re-playing the last frame’s scroll damage (on the current frame’s buffer). This does not work, and resulted in glitches when scrolling in the scrollback. This patch does the following: * grid_render_scroll{,_reverse}() now update the buffer’s "dirty" region. This means the generic copy-old-frames-buffer handles the scroll damage (albeit in, potentially, a less efficient way). * Tracking of, and re-applying old scroll damage is completely removed. Closes #1173
* | wayland: don’t crash with a division-by-zero when monitor dimensions are negativeDaniel Eklöf2022-09-23-1/+1
| | | | | | | | Some compositors set the physical dimensions to -1...
* | render: timer: print/log *total* rendering timeDaniel Eklöf2022-09-23-7/+13
| |
* | misc: add timespec_add()Daniel Eklöf2022-09-23-1/+19
| |
* | install.md: add ‘utf8proc’Daniel Eklöf2022-09-23-0/+1
|/
* chore: rename desktop filesVladimír Magyar2022-09-18-1/+1
|
* chore: add appstream fileVladimír Magyar2022-09-18-0/+45
| | | | | | | | Appstream file is usefull for many package management tools to show additional metadata and screenshots. Also it would solve the packaging for flathub. References: https://codeberg.org/dnkl/foot/issues/1129#issuecomment-602089
* csi: reply with 4 instead of 2 for DECRQM queries of unsupported modesCraig Barnes2022-09-18-44/+61
| | | | | | | | The status value 4 means "permanently reset", as opposed to 2, which means "reset". The former implies that there's no way to enable the mode because it's unsupported (but recognized). Note: this commit also fixes an unrelated typo in CHANGELOG.md.
* config: fix "maybe-uninitialized" error when compiling with CFLAGS=-OgCraig Barnes2022-09-17-0/+3
| | | | | | | | | | | | | | | Using GCC 12.2.0 with the following build steps: CFLAGS=-Og meson bld ninja -C bld ...produces the compiler error: ../config.c:2000:18: error: ‘sym_equal’ may be used uninitialized [-Werror=maybe-uninitialized] This commit fixes that by using BUG() to assert that all possible values are accounted for in the offending switch statement.
* input: pipe-*: set current CWD when spawning the sub-processDaniel Eklöf2022-09-10-1/+5
| | | | Closes #1166
* terminal: don’t unref a not-yet-referenced key-binding setDaniel Eklöf2022-09-06-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Key-binding sets are bound to a seat/configuration pair. The conf reference is done when a new terminal instance is created. When that same terminal instance is destroyed, the key binding set is unref:ed. If the terminal instance is destroyed *before* the key binding set has been referenced, we’ll still unref it. This creates an imbalance. In particular, when the there is exactly one other terminal instance referencing that same key binding set, that terminal instance will trigger a foot server crash as soon as it receives a key press/release event. This happens because the next-to-last terminal instance brought the reference count of the binding set down to 0, causing it to be free:d. Thus, we *must* reference the binding set *before* we can error out (when instantiating a new terminal instance). At this point, we don’t yet have a valid terminal instance. But, that’s ok, because all the key_binding_new_for_term() did with the terminal instance was get the "struct wayland" and "struct config" pointers. So, rename the function and simply pass these pointers explicitly. Similarly, change key_binding_for() to take a "struct config" pointer, rather than a "struct terminal" pointer. Also rename key_binding_unref_term() -> key_binding_unref().
* csi: damage *viewport* when exiting the alt screenDaniel Eklöf2022-09-06-1/+1
| | | | | This fixes a redraw issue when the normal screen were somewhere in the scrollback history when exiting the alt screen.
* config: change default ‘pad’ to 0x0 (i.e. no padding)Daniel Eklöf2022-09-03-4/+5
|
* Merge branch 'releases/1.13'Daniel Eklöf2022-08-31-6/+15
|\
| * meson: bump version to 1.13.11.13.1releases/1.13Daniel Eklöf2022-08-31-1/+1
| |
| * changelog: prepare for 1.13.1Daniel Eklöf2022-08-31-9/+3
| |
| * url-mode: connect osc-8 links only when both ID and URI matchesDaniel Eklöf2022-08-31-6/+12
| | | | | | | | | | | | | | | | | | | | | | Before this, two OSC-8 links with a matching ID would be connected even if their URIs weren’t the same. This is against the spec: The same id is only used for connecting character cells whose URIs is also the same. Character cells pointing to different URIs should never be underlined together when hovering over. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter
| * changelog: crash when resizing window, or scrollingDaniel Eklöf2022-08-31-0/+4
| |
| * grid: reflow: assert there aren’t any open URIs on the last rowDaniel Eklöf2022-08-31-0/+15
| |
| * grid: reflow: don’t line-wrap the last rowDaniel Eklöf2022-08-31-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we would line-wrap the last row, just like any other row, and then afterwards try to reverse this, by adjusting the offset and free:ing and NULL:ing the "last row". The problem with this is if the scrollback is full. In this case, the row we’re freeing is the first row in the scrollback history. This means we’ll crash as soon as the viewport is moved to the top of the scrollback. The fix is fairly, simple. Skip the post-processing logic, and instead detect when we’re line-wrapping the last row, and skip the call to line_wrap(). This way, the last row in the new grid corresponds to the last row in the old grid.
| * grid: when setting the new viewport, ensure it’s correctly boundedDaniel Eklöf2022-08-31-17/+11
| | | | | | | | | | | | Do this by using scrollback relative coordinates, and ensure the new viewport is not larger than (grid_rows - screen_rows), as that would mean the viewport crosses the scrollback wrap-around.
| * selection: mark_selected_region(): use an enum to encode how the cells are to be updatedDaniel Eklöf2022-08-31-7/+20
| |
| * selection: restore <= 1.12 behavior in block selection wrt empty cellsDaniel Eklöf2022-08-31-1/+3
| | | | | | | | | | That is, highlight empty cells, regardless of whether they’re trailing or not.
| * ci (sr.ht): pull directly from git.sr.htDaniel Eklöf2022-08-31-3/+3
| |
| * selection: once again highlight non-trailing empty cellsDaniel Eklöf2022-08-31-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foot 1.13.0 introduced a regression where non-trailing empty cells were highlighted inconsistently (cells that shouldn’t be highlighted, were, seemingly at random). 86663522d5915c0fdb2b8b132bacc247fcfd1fb8 “fixed” this by never highlighting *any* empty cells. This meant the behavior, compared to foot 1.12 and earlier, changed. In foot 1.12 and older versions, non-trailing empty cells were highlighted, as long as the selection covered at least one of the trailing non-empty cells. This patch restores that behavior. To understand how this works, lets first take a look at how selection works: When a selection is made, and updated (i.e. the mouse is dragged, or the selection is extended through RMB etc), we need to (un)tag and dirty the cells that are a) newly selected, or b) newly deselected. That is, we look at the diff between the “old” and the “new” selection, and only update those cells. This is for performance reasons: iterating the entire selection is not feasible with large selections. However, it also means we cannot reason about empty cells; we simply don’t know if an empty cells is a trailing empty cell, or a non-trailing one. Then, when we render a frame, we iterate all the *visible* and *selected* cells, once again tagging them as selected (this is needed since a selected cell might have lost its selected tag if the cell was written to, by the client application, after the selection was made). At this point, we *can* reason about empty cells. So, to restore the highlighting behavior to that of foot 1.12, we do this: When working with the selection diffs when a selection is updated, we don’t special case empty cells at all. Thus, all empty cells covered by the selection is highlighted, and dirtied. But, when rendering the frame, we _do_ special case them. The only difference (compared to foot 1.12) is that we *must* explicitly *clear* the selection tag, and dirty the empty cells. This is to ensure the empty cells that were incorrectly highlighted by the selection update algorithm, isn’t rendered as that. This does have a slight performance impact, as empty cells are now always re-rendered. The impact should however be small.
| * selection: never highlight selected, empty cellsDaniel Eklöf2022-08-31-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression, where empty cells "between" non-empty cells (i.e. non-trailing empty cells) sometimes were incorrectly highlighted. The idea has always been to highlight exactly those cells that will get extracted when they’re copied. This means we’ve not highlighted trailing empty cells, but we _have_ highlighted other empty cells, since they are converted to spaces when copied (whereas trailing empty cells are skipped). fa2d9f86996467ba33cc381f810ea966a4323381 changed how a selection is updated. That is, which cells gets marked as selected, and which ones gets unmarked. Since we no longer walk all the cells, but instead work with pixman regions representing selection diffs, we can no longer determine (with certainty) which empty cells should be selected and which shouldn’t. Before this patch (but after fa2d9f86996467ba33cc381f810ea966a4323381), we sometimes incorrectly highlighted empty cells that should not have been highlighted. This happened when we’ve first (correctly) highlighted a region of empty cells, but then shrink the selection such that all those empty cells should be de-selected. This patch changes the selection behavior to *never* highlight empty cells. This fixes the regression, but also means slightly different behavior, compared to pre-fa2d9f86996467ba33cc381f810ea966a4323381. The other alternative is to always highlight all empty cells. But, since I personally like the fact that we’re skipping trailing empty cells, I prefer the approach taken by this patch.
| * ci: codespell: ignore ‘zar’ (user who contributed)Daniel Eklöf2022-08-31-3/+3
| |
| * input: ignore pointer motion events on unknown surfacesDaniel Eklöf2022-08-12-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, the compositor sends a pointer enter event with a NULL surface. It’s unclear if this is a compositor bug, or a race (where the compositor sends an enter event on a CSD surface at the same time foot unmaps the CSDs). Regardless, this causes seat->mouse_focus to be unset, which triggers a crash in foot on the next pointer motion event. This patch does two things: a) log a warning when we receive a pointer event with a NULL surface b) ignore motion events where seat->mouse_focus is NULL
| * wayland: #ifdef on XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSIONDaniel Eklöf2022-08-12-0/+8
| | | | | | | | This enables us to compile against wayland-protocols < 1.25
| * render: apply a dimmed overlay while in Unicode input modeDaniel Eklöf2022-08-12-8/+36
| |
| * changelog: add new ‘unreleased’ sectionDaniel Eklöf2022-08-12-0/+11
| |
* | url-mode: connect osc-8 links only when both ID and URI matchesDaniel Eklöf2022-08-30-6/+12
| | | | | | | | | | | | | | | | | | | | | | Before this, two OSC-8 links with a matching ID would be connected even if their URIs weren’t the same. This is against the spec: The same id is only used for connecting character cells whose URIs is also the same. Character cells pointing to different URIs should never be underlined together when hovering over. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter
* | Merge branch 'grid-reflow-viewport-crash-regression'Daniel Eklöf2022-08-30-38/+33
|\ \ | | | | | | | | | Closes #1074
| * | changelog: crash when resizing window, or scrollingDaniel Eklöf2022-08-29-0/+4
| | |
| * | grid: reflow: assert there aren’t any open URIs on the last rowDaniel Eklöf2022-08-29-0/+15
| | |
| * | grid: reflow: don’t line-wrap the last rowDaniel Eklöf2022-08-29-21/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we would line-wrap the last row, just like any other row, and then afterwards try to reverse this, by adjusting the offset and free:ing and NULL:ing the "last row". The problem with this is if the scrollback is full. In this case, the row we’re freeing is the first row in the scrollback history. This means we’ll crash as soon as the viewport is moved to the top of the scrollback. The fix is fairly, simple. Skip the post-processing logic, and instead detect when we’re line-wrapping the last row, and skip the call to line_wrap(). This way, the last row in the new grid corresponds to the last row in the old grid.
| * | grid: when setting the new viewport, ensure it’s correctly boundedDaniel Eklöf2022-08-29-17/+11
|/ / | | | | | | | | | | Do this by using scrollback relative coordinates, and ensure the new viewport is not larger than (grid_rows - screen_rows), as that would mean the viewport crosses the scrollback wrap-around.
* | selection: mark_selected_region(): use an enum to encode how the cells are to be updatedDaniel Eklöf2022-08-26-7/+20
| |
* | selection: restore <= 1.12 behavior in block selection wrt empty cellsDaniel Eklöf2022-08-26-1/+3
| | | | | | | | | | That is, highlight empty cells, regardless of whether they’re trailing or not.
* | ci (sr.ht): pull directly from git.sr.htDaniel Eklöf2022-08-23-3/+3
| |
* | selection: once again highlight non-trailing empty cellsDaniel Eklöf2022-08-22-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foot 1.13.0 introduced a regression where non-trailing empty cells were highlighted inconsistently (cells that shouldn’t be highlighted, were, seemingly at random). 86663522d5915c0fdb2b8b132bacc247fcfd1fb8 “fixed” this by never highlighting *any* empty cells. This meant the behavior, compared to foot 1.12 and earlier, changed. In foot 1.12 and older versions, non-trailing empty cells were highlighted, as long as the selection covered at least one of the trailing non-empty cells. This patch restores that behavior. To understand how this works, lets first take a look at how selection works: When a selection is made, and updated (i.e. the mouse is dragged, or the selection is extended through RMB etc), we need to (un)tag and dirty the cells that are a) newly selected, or b) newly deselected. That is, we look at the diff between the “old” and the “new” selection, and only update those cells. This is for performance reasons: iterating the entire selection is not feasible with large selections. However, it also means we cannot reason about empty cells; we simply don’t know if an empty cells is a trailing empty cell, or a non-trailing one. Then, when we render a frame, we iterate all the *visible* and *selected* cells, once again tagging them as selected (this is needed since a selected cell might have lost its selected tag if the cell was written to, by the client application, after the selection was made). At this point, we *can* reason about empty cells. So, to restore the highlighting behavior to that of foot 1.12, we do this: When working with the selection diffs when a selection is updated, we don’t special case empty cells at all. Thus, all empty cells covered by the selection is highlighted, and dirtied. But, when rendering the frame, we _do_ special case them. The only difference (compared to foot 1.12) is that we *must* explicitly *clear* the selection tag, and dirty the empty cells. This is to ensure the empty cells that were incorrectly highlighted by the selection update algorithm, isn’t rendered as that. This does have a slight performance impact, as empty cells are now always re-rendered. The impact should however be small.
* | theme: change default color theme to solarized-dark-normal-brightsDaniel Eklöf2022-08-22-40/+44
| | | | | | | | | | | | | | | | | | This is my variant of the solarized theme, were only the first eight colors (i.e. the "normal") colors are from the solarized theme. The remaining eight (the "bright" colors) are brightened versions of the "normal" colors. This results in a theme that is usually in all applications, not just those that are "aware" that the terminal color theme is "solarized".
* | selection: never highlight selected, empty cellsDaniel Eklöf2022-08-22-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression, where empty cells "between" non-empty cells (i.e. non-trailing empty cells) sometimes were incorrectly highlighted. The idea has always been to highlight exactly those cells that will get extracted when they’re copied. This means we’ve not highlighted trailing empty cells, but we _have_ highlighted other empty cells, since they are converted to spaces when copied (whereas trailing empty cells are skipped). fa2d9f86996467ba33cc381f810ea966a4323381 changed how a selection is updated. That is, which cells gets marked as selected, and which ones gets unmarked. Since we no longer walk all the cells, but instead work with pixman regions representing selection diffs, we can no longer determine (with certainty) which empty cells should be selected and which shouldn’t. Before this patch (but after fa2d9f86996467ba33cc381f810ea966a4323381), we sometimes incorrectly highlighted empty cells that should not have been highlighted. This happened when we’ve first (correctly) highlighted a region of empty cells, but then shrink the selection such that all those empty cells should be de-selected. This patch changes the selection behavior to *never* highlight empty cells. This fixes the regression, but also means slightly different behavior, compared to pre-fa2d9f86996467ba33cc381f810ea966a4323381. The other alternative is to always highlight all empty cells. But, since I personally like the fact that we’re skipping trailing empty cells, I prefer the approach taken by this patch.
* | config: add setting for underline thicknessYorick Peterse2022-08-20-1/+29
| | | | | | | | | | | | | | | | This adds an "underline-thickness" setting to the "main" section, similar to the existing "underline-offset" setting. This setting is used to specify a custom height for regular (= non-cursor) underlines. Fixes #1136
* | ci: codespell: ignore ‘zar’ (user who contributed)Daniel Eklöf2022-08-20-3/+3
| |
* | input: ignore pointer motion events on unknown surfacesDaniel Eklöf2022-08-12-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, the compositor sends a pointer enter event with a NULL surface. It’s unclear if this is a compositor bug, or a race (where the compositor sends an enter event on a CSD surface at the same time foot unmaps the CSDs). Regardless, this causes seat->mouse_focus to be unset, which triggers a crash in foot on the next pointer motion event. This patch does two things: a) log a warning when we receive a pointer event with a NULL surface b) ignore motion events where seat->mouse_focus is NULL
* | wayland: #ifdef on XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSIONDaniel Eklöf2022-08-12-0/+8
| | | | | | | | This enables us to compile against wayland-protocols < 1.25
* | render: apply a dimmed overlay while in Unicode input modeDaniel Eklöf2022-08-08-8/+36
| |
* | changelog: add new ‘unreleased’ sectionDaniel Eklöf2022-08-07-0/+11
| |
* | Merge branch 'releases/1.13'Daniel Eklöf2022-08-07-6/+9
|\|
| * meson: bump version to 1.13.01.13.0Daniel Eklöf2022-08-07-1/+1
| |
| * changelog: prepare for 1.13.0Daniel Eklöf2022-08-07-5/+8
|/
* grid: get rid of empty row at the bottom after reflowingDaniel Eklöf2022-08-05-0/+22
| | | | | | | | | | | | | | | | | | | | | | | When the window is resized and we reflow the text, we ended up inserting an empty row at the bottom. This happens whenever the actual last row has a hard linebreak (which almost always is the case); we then end the reflow with a line break, causing an extra, empty, row to be allocated and inserted. This patch fixes this by detecting when: 1) the last row is empty 2) the next to last row has a hard line break In this case, we roll back the last line break, by adjusting the new offset we just calculated, and free:ing the empty row. TODO: it would be nice if we could detect this in the reflow loop instead, and avoid doing the last line break all together. I haven’t yet been able to find a way to do this correctly. Closes #1108
* Add support for xdg_toplevel.wm_capabilitiesSimon Ser2022-08-04-5/+55
| | | | See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/122
* Add no-op xdg_toplevel.configure_bounds handlerSimon Ser2022-08-03-1/+10
| | | | Next commit uses v5.
* server: Use "normal" socket activation, not inetdMax Gautier2022-07-30-2/+5
| | | | | | | | | | | | | | | | | Systemd, when doing socket activation, pass file descriptors in a non-stable order when there is multiples ones. But we only use one, so we don't need to identify it, and the file descriptors always start at 3. So use 3 for the systemd service. Source : sd_listen_fds (systemd man pages) We also need to unset variables systemd pass to socket activated process, since we don't need them and sub-process (footclient and theirs forks) could be confused by those. Closes #1107
* config: reset errno before calling getline() againDaniel Eklöf2022-07-29-0/+3
| | | | Related to #1107
* unicode-mode: ‘q’ aborts Unicode input modeDaniel Eklöf2022-07-29-1/+2
|
* unicode-input: move input (key press) handling to unicode_mode_input()Daniel Eklöf2022-07-29-58/+72
|
* input: add new Unicode input modeDaniel Eklöf2022-07-29-2/+167
| | | | | | | | | | | | | | This mode is activated through the new key-bindings.unicode-input and search-bindings.unicode-input key bindings. When active, the user can “build” a Unicode codepoint by typing its hexadecimal value. Note that there’s no visual feedback in this mode. This is intentional. This mode is intended to be a fallback for users that don’t use an IME. Closes #1116
* selection: rework how we update a selectionDaniel Eklöf2022-07-28-106/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, each selection update would result in grid covered by the selection being walked *three* times. First to “premark” the area that *will* be selected after the update, then again to unmark the previous selection (excluding the cells that were premarked - but the cells are still iterated), and then one more time to finalize the selection state in the grid. Furthermore, each time a frame is rendered, the entire selection were iterated again, to ensure all the cells have their ‘selected’ bit set. This quickly gets *very* slow. This patch takes a completely different approach. Instead of looking at the selection as a range of cells to iterate, we view it as an area, or region. Thus, on each update, we have to regions: the region representing the previous selection, and the region representing the to-be selection. By diffing these two regions, we get two new regions: one that represents the cells that were selected, but aren’t any more, and one that represents the cells that previously were not selected, but now will be. We implement the regions using pixman regions. By subtracting the current selection from the previous selection, we get the region representing the cells that are no longer selected, and that should be unmarked. By subtracting the previous selection from the current, we get the region representing the cells that was added to the selection in this update, and that should be marked. selection_dirty_cells() is rewritten in a similar manner. We create pixman regions for the selection, and the current scrollback view. The intersection represents the (selected) cells that are visible. These need to iterated and marked as being selected. Closes #1114
* selection: extend: use scrollback relative coordinatesDaniel Eklöf2022-07-28-15/+34
| | | | | | | | | | | | | When extending a selection, we determine *how* to extend it (which endpoint to move, and whether to grow or shrink the selection) by comparing the extension point with the old start and end coordinates. For this to work correctly, we need to use scrollback relative coordinates. This fixes an issue where extending a very large selection (covering many pages) sometimes shrunk the selection instead of growing it, or just misbehaving in general.
* selection: foreach_selected_*(): refactor: use grid_row_abs_to_sb()Daniel Eklöf2022-07-28-6/+5
|
* selection: selection_on_rows(): use scrollback relative coordsDaniel Eklöf2022-07-28-21/+68
| | | | | | | | | | | When checking if the current selection intersects with the region (passed as parameter to the function), use scrollback relative coordinates. This fixes an issue where selections crossing the scrollback wrap-around being misdetected, resulting in either the selection being canceled while scrolling, even though it wasn’t scrolled out, or the selection _not_ being canceled, when it _was_ scrolled out.
* search: find_next(): handle trailing SPACER cellsDaniel Eklöf2022-07-28-0/+5
| | | | | | | | Make sure to increment match_end_col to account for trailing SPACER cells after a match. This fixes an issue where search matches weren’t highlighted correctly when the match *ends* with a double-width character.
* config: add colors.search-box-{no-,}matchDaniel Eklöf2022-07-28-7/+85
| | | | Closes #1112
* test: config: test colors.{jump-labels,scrollback-indicator}Daniel Eklöf2022-07-28-2/+52
|
* input: kitty: always treat composed characters as ‘printable’Daniel Eklöf2022-07-28-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain dead key combinations results different escape sequences in foot, compared to kitty, when the kitty keyboard protocol is used. if (composed && is_text) key = utf32; else { key = xkb_keysym_to_utf32(sym_to_use); if (key == 0) return false; /* The *shifted* key. May be the same as the unshifted * key - if so, this is filtered out below, when * emitting the CSI */ alternate = xkb_keysym_to_utf32(sym); } If is_text=false, we’ll fall through to the non-composed logic. is_text is set to true if the character is printable *and* there aren’t any non-consumed modifiers enabled. shift+space is one example where shift is *not* consumed (typically - may be layouts where it is). As a result, pressing ", followed by shift+space with the international english keyboard layout (where " is a dead key) results in different sequences in foot and kitty. This patch fixes this by always treating composed characters as printable. Closes #1120
* keymap: change alt+escape to emit \E\E instead of a CSI 27 sequenceDaniel Eklöf2022-07-28-1/+4
| | | | Closes #1105
* render: it’s unlikely() the current cell is where the cursor isDaniel Eklöf2022-07-28-1/+1
|
* csi: clamp color index for ‘CSI 38/48 ; 5 ; idx m’ sequencesDaniel Eklöf2022-07-22-2/+8
| | | | | | | | | | | | | | Indexed color values are stored in the cell attributes as color indices (into the 256-color table). However, the index from the CSI was not validated in any way, meaning you can do something like this: echo -e ‘\e[38:5:1024m CRASH \e[m’ and foot will crash on an out-of-bounds access. Fix by clamping the color index. Closes #1111
* grid: reflow: require col count > 0 when skipping line truncationDaniel Eklöf2022-06-30-1/+1
| | | | | | | | | | | | | | | | | | When reflowing the grid, we truncate lines with a hard linebreak after the last non-empty cell. This way we don’t reflow trailing empty cells to a new line when resizing the window to a smaller size. However, “logical” lines (i.e. those without a hard linebreak) are *not* truncated. This is to ensure we don’t trim empty cells in the middle of a logical line spanning multiple physical lines. Since newly allocated rows are initialized with linebreak=false, we need to ensure _those_ are still truncated - otherwise all that empty space under the current prompt will be reflowed. Note that this is a temporary workaround. The correct solution, I think, is to track whether a line has been printed to or not, and simply ignore (not reflow) lines that haven’t yet been touched.