aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* 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
|
* 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.
* Revert "grid: invert the default value of ‘linebreak’, from false to true"Daniel Eklöf2022-06-30-12/+6
| | | | This reverts commit cdd46cdf85b1087ac7465c646bb05078f1bbe85b.
* input: don’t ignore keyboard enter/leave events when there’s no keymapDaniel Eklöf2022-06-28-6/+3
| | | | | | | | | | | The compositor _usually_ sends the keymap event *before* the enter event. But not always. Not (yet) having a keymap is not a reason to ignore the enter event (now, on the other hand, getting a key press/release event without a keymap is a compositor bug). Closes #1097
* selection: wl_data_offer_set_action: use enum values instead of magic integersDaniel Eklöf2022-06-21-1/+4
|
* selection: reject dnd offers with unsupported mime-typesDaniel Eklöf2022-06-20-0/+4
| | | | | | | We were already doing this, implicitly, *if* the offer was for the main grid. This patch makes it more clear that we do not accept the offer.
* selection: explicitly reject *all* dnd offers not targeting the gridDaniel Eklöf2022-06-20-0/+1
|
* selection: ignore drag-and-drops with unsupported mime-typesDaniel Eklöf2022-06-20-1/+12
| | | | | | | | Specifically, make sure we do *not* call wl_data_offer_receive() with a NULL mime-type, as this causes libwayland to error out, which in turn causes foot to exit. Closes #1092
* shm-formats: #ifdef on formats added in 1.20Daniel Eklöf2022-06-20-0/+4
|
* wayland: log human readable SHM format names in debug buildsDaniel Eklöf2022-06-20-1/+135
|
* key-binding: set BIND_ACTION_KEY_COUNT correctlyDaniel Eklöf2022-06-17-1/+1
| | | | | When the new promp-prev/next bindings were added, we forgot to update BIND_ACTION_KEY_COUNT to reflect this.
* osc: add support for OSC 133;A (prompt markers)Daniel Eklöf2022-06-16-18/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the OSC-133;A sequence, introduced by FinalTerm and implemented by iTerm2, Kitty and more. See https://iterm2.com/documentation-one-page.html#documentation-escape-codes.html. The shell emits the OSC just before printing the prompt. This lets the terminal know where, in the scrollback, there are prompts. We implement this using a simple boolean in the row struct ("this row has a prompt"). The prompt marker must be reflowed along with the text on window resizes. In an ideal world, erasing, or overwriting the cell where the OSC was emitted, would remove the prompt mark. Since we don't store this information in the cell struct, we can't do that. The best we can do is reset it in erase_line(). This works well enough in the "normal" screen, when used with a "normal" shell. It doesn't really work in fullscreen apps, on the alt screen. But that doesn't matter since we don't support jumping between prompts on the alt screen anyway. To be able to jump between prompts, two new key bindings have been added: prompt-prev and prompt-next, bound to ctrl+shift+z and ctrl+shift+x respectively. prompt-prev will jump to the previous, not currently visible, prompt, by moving the viewport, ensuring the prompt is at the top of the screen. prompt-next jumps to the next prompt, visible or not. Again, by moving the viewport to ensure the prompt is at the top of the screen. If we're at the bottom of the scrollback, the viewport is instead moved as far down as possible. Closes #30
* ime: track IME focus independently from keyboard focusDaniel Eklöf2022-06-15-14/+21
| | | | | | | | | | | | | | | | | Replace the seat->ime.focused boolean with a terminal instace pointer, seat->ime_focus. Set and reset this on ime::enter() and ime::leave() events, and use this instead of seat->kbd_focus on all other IME events. This fixes two issues: a) buggy compositors that sometimes sends an IME enter event without first having sent a keyboard enter event. b) seats may be IME capable while still lacking the keyboard capability. Such seats will *always* see IME enter events without a corresponding keyboard enter event.
* ime: ime_reset_pending_{preedit,commit} is not used outside ime.cDaniel Eklöf2022-06-15-36/+34
|
* vt: tag collision-count check with ‘unlikely’Daniel Eklöf2022-06-15-1/+1
|
* vt: improve key calculation for compose sequencesDaniel Eklöf2022-06-15-4/+19
| | | | | | | | | | * Don’t assume 32 bits when rotating the old key. Use the number of actual bits available, as determined by CELL_COMB_CHARS_{HI,LO} * Multiply with magic hash constant This greatly reduces the number of collisions seen. For example, the Emoji test file (from the Unicode specification), now has zero collisions.
* vt: prevent potential endless loop when finding a slot for a composed characterDaniel Eklöf2022-06-15-0/+14
| | | | | | | | | | | | | | | | | | | | | Composed characters are stored in a tree structure, using a key as identifier. The key is calculated from the individual characters that make up the composed character sequence. Since the address space for keys is limited, collisions may occur. In this case, we simply increment the key and try again. It is theoretically possible to saturate the key space, in which case we’ll get stuck in an endless loop. Even if the key space isn’t fully saturated, we fairly easy reach a point where there are so many collisions for each insertion, that performance drops significantly. Since key space is limited (it’s not like a hash table that we can grow), our only option is to limit the number of collisions. If we can’t find a slot within a hard code amount of collisions, the character is simply dropped.
* selection: allow HT, VT and FF, disallow NUL in non-bracketed paste modeDaniel Eklöf2022-06-15-3/+22
| | | | | | | | | | | | | | | | This syncs foot with more recent versions of XTerm, where it’s “disallowedPasteControls” resource has changed its default value to BS,DEL,ENQ,EOT,ESC,NULL Note that we’re already stripping out ENQ,EOT,ESC in all modes. What does it mean for foot: * HT, VT and FF are now allowed, regardless of paste mode * NUL is now stripped in non-bracketed paste mode Closes #1084
* pgo: slave_spawn(): sync function signatureDaniel Eklöf2022-06-13-1/+2
|
* test: config: new test for the new ‘environment’ sectionDaniel Eklöf2022-06-13-0/+37
|
* changelog: new ‘environment’ section in foot.iniDaniel Eklöf2022-06-13-0/+4
|
* doc: document the new ‘environment’ config sectionDaniel Eklöf2022-06-13-4/+23
|
* config: add a new ‘environment’ sectionDaniel Eklöf2022-06-13-4/+63
| | | | | | | | This section allows the user to define custom environment variables to be set in the child process: [environment] name=value
* commands: scroll up: simplify viewport clamping logicDaniel Eklöf2022-06-13-13/+5
| | | | | | | | | | | | | | | | | | When scrolling the viewport up, we need to ensure we don’t go past the scrollback wrap around. This was previously done using “custom” logic that tried to calculate many rows away from the scrollback start the current viewport is. But this is *exactly* what grid_row_abs_to_sb() does, except it doesn’t account for uninitialized scrollback. So, copy the logic from grid_row_abs_to_sb(), but ensure scrollback start points to valid scrollback data. The maximum number of rows we’re allowed to scroll is now the same as the current viewport’s sb-relative coordinate. Maybe closes #1074
* grid: reflow: don’t trim trailing empty cells from logical linesDaniel Eklöf2022-06-11-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a line in the old grid (the one being reflowed) doesn’t have a hard linebreak, don’t trim trailing empty cells. Doing so means we’ll “compress” (remove) empty cells between text if/when we revert to a larger window size. The output from neofetch suffers from this; it prints a logo to the left, and system information to the right. The logo and the system info column is separated by empty cells (i.e. *not* spaces). If the window is reduced in size such that the system info is pushed to a new line, each logo line ends with a number of empty cells. The next time the window is resized, these empty cells were ignored (i.e. removed). That meant that once the window was enlarged again, the system info column was a) no longer aligned, and b) had been pulled closer to the logo. This patch doesn’t special case trailing empty cells when the line being reflowed doesn’t have a hard linebreak. This means e.g. ‘ls’ output is unaffected. Closes #1055
* grid: invert the default value of ‘linebreak’, from false to trueDaniel Eklöf2022-06-11-6/+12
|
* Merge branch 'tokyonight'Daniel Eklöf2022-06-01-0/+57
|\
| * Add 'themes/tokyonight-storm'Lorenz2022-06-01-0/+19
| |
| * Add 'themes/tokyonight-night'Lorenz2022-06-01-0/+19
| |
| * Add 'themes/tokyonight-day'Lorenz2022-06-01-0/+19
|/
* themes: add catppuccinStefan Prosiegel2022-05-25-0/+25
|
* config: use $HOME instead of getpwuid() to retrieve users’s home dirDaniel Eklöf2022-05-25-13/+13
| | | | | When searching for foot.ini, use $HOME instead of getpwuid() to retrieve the user’s home directory.
* main: minor rewording of non-UTF8 locale warnings and errorsDaniel Eklöf2022-05-14-6/+6
|
* meson: -Dsystemd-units-dir installs even if systemd is not foundDaniel Eklöf2022-05-12-4/+4
| | | | | If -Dsystemd-units-dir is explicitly set, then install the systemd service files regardless of whether systemd is available or not.
* meson: add -Dsystemd-units-dir=<path> meson command line optionDaniel Eklöf2022-05-12-10/+22
| | | | | | | | | This allows package maintainers to override the location to which our systemd service files are installed. It’s value is an *absolute* path, and *not* relative ${prefix}. The default is ${systemduserunitdir}.
* doc: benchmarks: update with desktop results for 1.12.1 (r9)Daniel Eklöf2022-05-12-13/+13
|
* doc: benchmarks: update with laptop results for 1.12.1 (r9)Daniel Eklöf2022-05-12-13/+13
|
* wayland: throttle xdg activation token requests for window urgencyDaniel Eklöf2022-05-11-3/+16
| | | | | | | | | | | | | | | | | When XDG activation support was added to URL mode, we introduced a regression, where it is possible to flood the Wayland socket with XDG activation token requests. Start foot with “foot -o bell.urgency=yes”, then run: while true; do echo -en ‘\a’; done Finally, switch keyboard focus to another window. Foot crashes. Throttle the token requests by limiting the number of outstanding urgency token requests to 1. Closes #1065
* terminal: move viewport when part of it is scrolled outDaniel Eklöf2022-05-11-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the viewport is at the top of the scrollback, and a program is scrolling (e.g. by emitting newlines), the viewport needs to be moved. Otherwise, the top of the viewport will show the *bottom* of the scrollback (i.e. the newly emitted lines), and the bottom of the viewport shows the top of the scrollback. How do we detect if the viewport needs to be moved? We convert its absolute row number to a scrollback relative row. This number is also the maximum number of rows we can scroll without the viewport being scrolled out. In other words, if the number of rows to scroll is larger than the viewports scrollback relative row number, the viewport needs to moved. How much do we need to move it? The difference between the number of rows to scroll, and the viewports scrollback relative row number. Example: if the viewport is at the very top of the scrollback, its scrollback relative row number is 0. In this case, it needs to be moved the same number of rows as is being scrolled.
* Themes: Add 'Monokai Pro' themeLorenz2022-05-09-0/+21
| | | Signed-off-by: Lorenz <lorenz@noreply.codeberg.org>
* pgo: add xdg_activation_token parameter to spawn() stubDaniel Eklöf2022-05-06-1/+2
|
* url-mode: add support for XDG activation when opening URLsDaniel Eklöf2022-05-05-69/+209
| | | | | | | | | | | | | | | | | | | | | | | | | First, add a ‘token’ argument to spawn(). When non-NULL, spawn() will set the ‘XDG_ACTIVATION_TOKEN’ environment variable in the forked process. If DISPLAY is non-NULL, we also set DESKTOP_STARTUP_ID, for compatibility with X11 applications. Note that failing to set either of these environment variables are considered non-fatal - i.e. we ignore failures. Next, add a helper function, wayl_get_activation_token(), to generate an XDG activation token, and call a user-provided callback when it’s ‘done (since token generation is asynchronous). This function takes an optional ‘seat’ and ‘serial’ arguments - when both are non-NULL/zero, we set the serial on the token. ‘win’ is a required argument, used to set the surface on the token. Re-write wayl_win_set_urgent() to use the new helper function. Finally, rewrite activate_url() to first try to get an activation token (and spawn the URL launcher in the token callback). If that fails, or if we don’t have XDG activation support, spawn the URL launcher immediately (like before this patch). Closes #1058
* changelog: fix URL in #1047 issue linkDaniel Eklöf2022-04-28-1/+1
|
* commands: fix LOG_DBG() usage in cmd_scrollback_{up,down}Craig Barnes2022-04-27-4/+4
| | | | | | The "end" variable was removed from both of these functions in commit cb43c581508d8, but the references to it in the expansion of LOG_DBG() weren't.
* changelog: add new ‘unreleased’ sectionDaniel Eklöf2022-04-27-0/+11
|
* Merge branch 'releases/1.12'Daniel Eklöf2022-04-27-10/+4
|\
| * meson: bump version to 1.12.11.12.1releases/1.12Daniel Eklöf2022-04-27-1/+1
| |
| * changelog: prepare for 1.12.1Daniel Eklöf2022-04-27-9/+3
| |
| * Merge branch 'master' into releases/1.12Daniel Eklöf2022-04-27-180/+336
| |\ | |/ |/|
* | changelog: changed behavior of “extend-to-word-boundary”Daniel Eklöf2022-04-27-0/+6
| |
* | selection: find_word_boundary_right: add “stop-on-space-to-word-boundary”Daniel Eklöf2022-04-27-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When true, selection_find_word_boundary_right() behaves as before - it stops as soon as it encounters a character that isn’t of the same *type* as the “initial” character (the last character in the selection). Take this, for example: The Quick Brown Fox The selection will first stop at the end of “the”, then just *before* “quick”, then at the end of “quick”. Then just *before* “brown”, and then at the end of “brown”, and so on. This suits mouse selections pretty good. But when selection_find_word_boundary_right() is used to extend a search match, it’s better to ignore space-to-word character transitions. That is, we want The Quick Brown Fox to first extend to the end of “the”, then immediately to the end of “quick”, then to the end of “brown”, and so on. Setting the ‘stop_to_space_to_word_boundary’ argument to false results in latter behavior. This is now done by search, when executing the “extend-to-word-boundary” and “extend-to-next-whitespace” key bindings.
* | Disable debug loggingDaniel Eklöf2022-04-27-2/+2
| |
* | term: reset sixel options when hard resetting the terminal stateDaniel Eklöf2022-04-26-0/+12
| |
* | config: add ctrl+shift+v and XF86 paste to SEARCH_CLIPBOARD_PASTEDaniel Eklöf2022-04-26-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | We now bind ctrl+v, ctrl+shift+v, ctrl+y and XF86Paste to pasting from the clipboard into the scrollback search buffer. Why all these? Because we can, and because all are common shortcuts for pasting: * ctrl+v: “normal” apps use this by default * ctrl+shift+v: used in terminals (including foot) * ctrl+y: Emacs * XF86Paste: special keyboard key, for pasting
* | search: fix infinite loop when highlighting all matchesDaniel Eklöf2022-04-26-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find_next() did not always terminate correctly, causing search_matches_next() to never terminate, which finally leads to an infinite loop when rendering the search overlay surface, while finding all matches to highlight. The problem is that find_next(), after having found the initial matching characters, enters a nested while loop that tries to match the rest of the search criteria. This inner while loop did not check if we’ve reached the last cell, and happily continued past it (eventually wrappping around the scrollback buffer). Closes #1047
* | search: assert that the match is *inside* the new viewportDaniel Eklöf2022-04-26-0/+9
| |
* | search: regression: crash when moving viewportDaniel Eklöf2022-04-26-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5c4ddebc3c57724bd89b959a33f5ad0bd97f482b refactored search_update_selection(), specifically, the logic that moves the viewport. It did so by converting the absolute row number (of the match) to scrollback relative coordinates. This way we could ensure the viewport wasn’t moved “too much” (e.g. beyond the scrollback start). However, grid_row_abs_to_sb() and grid_row_sb_to_abs() doesn’t take a partially filled scrollback into account. This means the row (numbers) it returns may refer to *uninitialized* rows. Since: * The match row itself is valid (we *know* it has text on it) * We *subtract* from it, when setting the new viewport (to center the match on the screen). it’s only the *upper* part of the new viewport that may be uninitialized. I.e. we may have adjusted it too much. So, what we need to do is move the viewport forward until its *first* row is initialized. Then we know the rest will be too.
* | changelog: typo: space on the wrong side of the parenthesisDaniel Eklöf2022-04-26-1/+1
| |
* | Merge branch 'sway-sub-surface-damage-workaround'Daniel Eklöf2022-04-26-2/+19
|\ \ | | | | | | | | | Closes #1046
| * | changelog: workaround for Sway bug #6960Daniel Eklöf2022-04-26-0/+9
| | |
| * | term: flash: work around Sway sub-surface unmap bugDaniel Eklöf2022-04-26-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unmapping a sub-surface in Sway does not damage the underlying surface. As a result, the OSC-555 escape (“flash”) will leave yellow margins on ~every second frame. Out of sway, river, weston and mutter, only Sway needs this workaround. This is a workaround for https://github.com/swaywm/sway/issues/6960 Closes #1046
| * | search: work around Sway sub-surface unmap bugDaniel Eklöf2022-04-26-1/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unmapping a sub-surface in Sway does not damage the underlying surface. As a result, "committing" a scrollback search will typically leave most of the foot window dimmed. It can be seen when "cancelling" a search as well, but there it's less obvious - only the margins are left dimmed. This is because cancelling a search damaged the current viewport (something that shouldn't be needed). Out of sway, river, weston and mutter, only Sway needs this workaround. This is a workaround for https://github.com/swaywm/sway/issues/6960
* | Merge branch 'search-crashes'Daniel Eklöf2022-04-26-151/+167
|\ \ | | | | | | | | | Closes #1036