aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
* render: search: glyph_offset is in *cells*, cursor position in *characters*Daniel Eklöf2020-12-07-18/+70
| | | | | | When calculating the offset into the search string, from where to start rendering, take into account that the cursor position is in *characters*, and the glyph-offset is in *cells*.
* render: search: wcsnlen() -> wcswidth()Daniel Eklöf2020-12-07-1/+1
|
* render: search: handle multi-column charactersDaniel Eklöf2020-12-07-2/+3
|
* render: search: render colorized glyphs (emojis) correctlyDaniel Eklöf2020-12-07-5/+13
|
* ime: commit text using search_add_chars() while in scrollback search modeDaniel Eklöf2020-12-07-7/+8
|
* search: new function: search_add_chars()Daniel Eklöf2020-12-07-4/+5
| | | | | This function inserts a string into the search buffer, at the current insertion point (i.e. where the cursor is).
* ime: don’t commit to the slave while scrollback searchingDaniel Eklöf2020-12-07-5/+9
|
* render: ime: don’t render pre-edit string in grid while searchingDaniel Eklöf2020-12-07-0/+3
| | | | | | | | | While doing a scrollback search, the pre-edit string should be rendered in the search box, not in the grid. Note that we don’t yet support IME in scrollback search mode. This patch simply prevents the pre-edit text being rendered in the grid, in the “background”, while searching.
* install: highlight option default value in options listDaniel Eklöf2020-12-07-1/+1
|
* install: highlight option name in options listDaniel Eklöf2020-12-07-3/+3
|
* changelog: ime: add link to INSTALL.mdDaniel Eklöf2020-12-07-1/+3
|
* install: add ‘options’ section, describing compile-time optionsDaniel Eklöf2020-12-07-0/+10
|
* changelog: IME supportDaniel Eklöf2020-12-07-0/+1
|
* csi: add DECSET 737769 - enables/disables IME inputDaniel Eklöf2020-12-07-0/+10
| | | | 73 77 69 = I M E
* codespell: currenly -> currently, second instanceDaniel Eklöf2020-12-07-1/+1
|
* codespell: currenly -> currentlyDaniel Eklöf2020-12-07-1/+1
|
* features: include compile-time enable/disable state of features when printing versionDaniel Eklöf2020-12-07-3/+37
|
* render: ime: draw a ‘bar’ cursor when the pre-edit cursor’s begin == endDaniel Eklöf2020-12-07-6/+14
|
* shm: fix badly indented function return typeDaniel Eklöf2020-12-07-1/+1
|
* ime: add functions to enable/disable IME, simplify code that enables IMEDaniel Eklöf2020-12-07-47/+121
| | | | | | | | | | | | | | | | | We may want to be able to enable/disable IME run-time, even though we have received an ‘enter’ IME event. This enables us to do that. Also add functions to enable/disable IME on a per-terminal instance basis. A terminal may have multiple seats focusing it, and enabling/disabling IME in a terminal instance enables/disables IME on all those seats. Finally, the code to enable IME is simplified; the *only* surface that can ever receive ‘enter’ IME events is the main grid. All other surfaces are sub-surfaces, without their own keyboard focus.
* ime: expand cursor cell-end across multi-cell charactersDaniel Eklöf2020-12-07-0/+7
| | | | | This fixes an issue where the cursor ended in the middle of e.g double width characters.
* ime: don’t adjust cursor’s cell-end if it’s equal to the cell-beginDaniel Eklöf2020-12-07-6/+12
|
* ime: set cursor end correctly when it ends *after* the pre-edit stringDaniel Eklöf2020-12-07-0/+3
|
* ime: use correct index when calculating number of *cells* to advanceDaniel Eklöf2020-12-07-1/+1
|
* render: ime: don’t render cursor if cursor begin == endDaniel Eklöf2020-12-07-3/+4
|
* render: ime: calculate on-screen cursor position ourselvesDaniel Eklöf2020-12-07-3/+12
| | | | | | | | The position calculated by render_grid() may be -1,-1 if the cursor is currently hidden. This fixes a crash when trying to input IME while the cursor is hidden.
* ime: calculate wchar widths onceDaniel Eklöf2020-12-07-3/+8
|
* render: ignore IME preedit state when deciding which cursor style to renderDaniel Eklöf2020-12-07-1/+1
|
* ime: make IME compile-time optionalDaniel Eklöf2020-12-07-29/+103
|
* ime: render pre-edit textDaniel Eklöf2020-12-07-52/+356
| | | | | | | | | | | | | | This is done by allocating cells for the pre-edit text when receiving the text-input::done() call, and populating them by converting the utf-8 formatted pre-edit text to wchars. We also convert the pre-edit cursor position to cell positions (it can cover multiple cells). When rendering, we simply render the pre-edit cells on-top off the regular grid. While doing so, we also mark the underlying, “real”, cells as dirty, to ensure they are re-rendered when the pre-edit text is modified or removed.
* ime: wip: commit all changes in ‘done()’Daniel Eklöf2020-12-07-6/+64
|
* ime: feed committed string to client applicationDaniel Eklöf2020-12-07-0/+4
|
* ime: disable text-input on surface leaveDaniel Eklöf2020-12-07-2/+4
|
* ime: wip: add text-input object to seatDaniel Eklöf2020-12-07-0/+147
|
* changelog: DECSET 27127 - modifies Esc to send \E[27127~ instead of \EDaniel Eklöf2020-12-07-0/+3
|
* Merge branch 'allow-key-collision-if-action-is-the-same'Daniel Eklöf2020-12-07-4/+17
|\ | | | | | | Closes #233
| * config: ignore “self” when detecting key binding collisionsDaniel Eklöf2020-12-05-4/+17
|/ | | | | | | | | | | | | | | | | | | | | | | Previously, foot would not accept the following: [key-bindings] minimize=Escape minimize=Escape Now it does. I.e. key combos in the action being updated are ignored when detecting collisions. The example above is contrived; a real world example could be to remove certain combos from an action with multiple combos; perhaps to free up a combo for another action. Example: [search-bindings] cancel=Escape This would previously cause an error since `cancel=Control+g Escape` by default. Closes #233
* changelog: remove ‘crash when pasting non-textual clipboard content’Daniel Eklöf2020-12-05-4/+0
| | | | This crash doesn’t not exist in any release versions.
* fdm: do *not* keep polling on EINTRDaniel Eklöf2020-12-04-5/+4
| | | | | | This fixes an issue where foot --server did not exit on SIGINT. This happened because we never returned out from fdm_poll(), and thus we never saw ‘aborted’ being set.
* Merge branch 'releases/1.5'Daniel Eklöf2020-12-01-15/+31
|\
| * meson/pkgbuild: bump version to 1.5.41.5.4releases/1.5Daniel Eklöf2020-12-01-2/+2
| |
| * input: relax requirements for overriding keypad application modeDaniel Eklöf2020-12-01-9/+1
| | | | | | | | | | | | Don’t require NumLock to be locked. Foot has no idea _which_ modifier the user has mapped NumLock to, meaning we really cannot require it to be locked.
| * keymap: add ‘CSI 27;<mod>;27~’ escapes for Esc with modifiersDaniel Eklöf2020-12-01-0/+16
| |
| * doc: foot.5: minor highlighting fixesDaniel Eklöf2020-12-01-5/+6
| |
| * doc: foot.1: no need to say foot.ini twiceDaniel Eklöf2020-12-01-1/+1
| |
| * changelog: update contributorsDaniel Eklöf2020-12-01-0/+5
| |
| * render: don’t call term_arm_blink_timer() from multiple threadsDaniel Eklöf2020-12-01-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We call term_arm_blink_timer() from render_cell(), which runs in multiple threads. This caused multiple blink timer FDs to be created and registered with the FDM, later causing read failures after one of those FDs had been closed again. This rarely happened under normal circumstances, but was easy to trigger when the whole screen was full of blinking text. As a small optimization, we don’t bother taking the lock if the timer FD already is valid. This is safe, because: 1) If the timer FD isn’t valid, we take the lock and then call term_arm_blink_timer(), which again checks if the FD is already valid. 2) The blink timer FD cannot be closed while we’re rendering cells. It is only disabled in the FDM callback, which cannot execute while we’re rendering.
| * sixel: fix crash when an explicit sixel size had a height less than 6 pixelsDaniel Eklöf2020-12-01-4/+2
| |
| * client: fix handling of "-m" command-line flagCraig Barnes2020-12-01-1/+2
| |
| * render: allow-overflow: require a space in the next cellDaniel Eklöf2020-12-01-1/+5
| | | | | | | | | | | | | | | | When checking if we should allow a single-width character double-width glyph to overflow into the next cell, require the next cell to either be empty, or contain a space. Closes #203
| * keymap: fix alt+return combosDaniel Eklöf2020-12-01-11/+12
| | | | | | | | | | | | | | | | All alt+return combos mapped to the same escape sequence as alt+return itself. With this patch, alt+<mod(s)>+return map to a standard ‘CSI 27;x;13~’ sequence.
| * keymap: use same lookup table for Tab and ISO_Left_TabDaniel Eklöf2020-12-01-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With XKB, Shift+Tab maps to XKB_KEY_ISO_Left_Tab, not XKB_Key_Tab. Previously, we had two different lookup tables for the two. The tab table was correctly populated, while the ISO-left tab wasn’t. As a result, all Shift+Tab combos (except Shift+Tab itself) was wrong, and resulted in the same escape sequence as Shift+Tab. Fix by using the same table for both tab and ISO-left tab. Closes #210
| * readme: don’t uppercase titlesDaniel Eklöf2020-12-01-2/+2
| |
| * config: enable allow-overflowing-double-width-glyphs by defaultDaniel Eklöf2020-12-01-5/+9
| |
| * changelog: fix link to readme#keypadDaniel Eklöf2020-12-01-2/+3
| |
| * readme/doc:foot.1: document the (new) keypad behaviorDaniel Eklöf2020-12-01-1/+44
| |
| * input: enforce ‘numerical’ keypad mode when Num Lock override is enabledDaniel Eklöf2020-12-01-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When num lock override has been enabled via “CSI?1035h” (the default), keypad is always considered to be in ‘numerical’ mode. This affects how keypad keys are translated to escape sequences when Num Lock is active. The keypad has four modes: * Num Lock off, numerical mode * Num Lock off, application mode * Num Lock on, numerical mode * Num Lock on, application mode The keymap is identical for numerical and application mode when Num Lock is off, meaning the keypad effectively has three different modes. In XTerm, numerical and application mode _can_ be the same, **if** the ‘numLock’ resource is set to true (the default). It is only when ‘numLock’ is false that the application mode is actually used. This patch changes foot to do the same. We don’t expose an option, but do implement “CSI ? 1035”. Closes #194
| * input: track num lock stateDaniel Eklöf2020-12-01-0/+6
| |
| * csi: implement “CSI ? 1035” - toggle Num Lock overrideDaniel Eklöf2020-12-01-0/+12
| | | | | | | | | | This adds a num_lock_modifier state to the terminal, and hooks up “CSI?1035h/l” to toggle it.
| * input: use XKB_MOD_NAME_* macros instead of hard-coded stringsDaniel Eklöf2020-12-01-4/+4
| |
| * wayland: preempt render scheduling in ‘configure’ eventsDaniel Eklöf2020-12-01-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A configure event must be “committed”. In case of resizing, that means rendering a new frame and committing that surface. render_resize() will resize the grid and *schedule* a render refresh. However, if one is already pending, the refresh will take a very (relatively) long time - until the next frame callback is received. This poses a problem when the window is hidden, since in this case, the frame callback *never* comes. This in turn means we fail to commit a new surface in response to the ‘configure’ event. And that means the compositor needs to wait for a transaction timeout before continuing. The end effect is very slow and jerky window resizing when a hidden foot window is being resized. This can happen in tiled compositors, like Sway, where a window can be tabbed (and thus invisible), but still resized when its container is resized. Closes #190
| * changelog: add entry for 1.5.4Daniel Eklöf2020-12-01-0/+7
| |
* | Merge branch 'modify-escape-key'Daniel Eklöf2020-12-01-1/+16
|\ \ | | | | | | | | | Closes #225
| * | csi: add new private mode that makes the Escape key emit "\E[27;1;27~"Craig Barnes2020-11-29-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mode can be set by client programs with the DECSET, DECRST, XTSAVE and XTRESTORE sequences by using 27127 as the parameter. The sequence "\E[27;1;27~" is encoded in the same way as is done by xterm's "modifyOtherKeys" mode. Even though xterm itself never emits such a sequence for the Escape key, many programs already have support for parsing this style of key sequence.
* | | Merge branch 'clipboard-ignore-unhandled-mime-types'Daniel Eklöf2020-12-01-2/+8
|\ \ \ | | | | | | | | | | | | Closes #230
| * | | selection: do not try to paste un-handled mime typesDaniel Eklöf2020-11-30-2/+8
| | | | | | | | | | | | | | | | Closes #230
* | | | input: relax requirements for overriding keypad application modeDaniel Eklöf2020-12-01-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | Don’t require NumLock to be locked. Foot has no idea _which_ modifier the user has mapped NumLock to, meaning we really cannot require it to be locked.
* | | | Merge branch 'base64-padding-fix'Daniel Eklöf2020-11-30-6/+17
|\ \ \ \
| * | | | base64: only allow padding bytes at the end of a string when decodingCraig Barnes2020-11-30-6/+17
| | | | |
* | | | | Merge branch 'simplify-config-struct'Daniel Eklöf2020-11-30-46/+16
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | config: replace union in config struct with simple width/height membersCraig Barnes2020-11-30-46/+16
| |/ / /
* | | | selection: offer clipboard content in more mime typesDaniel Eklöf2020-11-30-0/+10
| | | |
* | | | input: improved debug logging of pressed keysDaniel Eklöf2020-11-30-10/+9
|/ / /
* | | Merge branch 'base64-optimize'Daniel Eklöf2020-11-29-32/+27
|\ \ \ | |/ / |/| |
| * | base64: optimize error checking in base64_decode()Craig Barnes2020-11-29-32/+27
|/ /
* | keymap: add ‘CSI 27;<mod>;27~’ escapes for Esc with modifiersDaniel Eklöf2020-11-28-0/+16
| |
* | doc: foot.1: add IRC channelDaniel Eklöf2020-11-27-0/+4
| |
* | readme: better link to freenodeDaniel Eklöf2020-11-27-1/+2
| |
* | readme: rename ‘IRC, social media’ -> ‘Contact’Daniel Eklöf2020-11-27-2/+2
| |
* | readme: irc: add channel and my usernameDaniel Eklöf2020-11-27-2/+12
| |
* | Merge branch 'split-cursor-blink-state'Daniel Eklöf2020-11-27-94/+52
|\ \ | | | | | | | | | Closes #218
| * | term: split cursor blink state into twoDaniel Eklöf2020-11-26-38/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two different escape sequences that can be used to set the cursor blink state: ‘CSI ? 12 h/l’ and ‘CSI Ps SP q’. Up until now, they both modified the same internal state in foot. This meant you could enable a blinking cursor with e.g. ‘CSI ? 12 h’ and then disable it with ‘CSI 2 SP q’. Since the ‘CSI ? 12’ escapes are used in the civis/cnorm/cvvis terminfo entries, applications often ended up disabling the blink state on exit (typically be emitting ‘cnorm’), requiring users to manually re-enable blinking. By splitting the internal state into two separate states, we can improve the situation. The cursor will blink if at least one of the two have been enabled. The setting in foot.ini sets the default state of the ‘CSI Ps SP q’ escape. This means if the user has enabled blinking in the configuration, the cursor will blink regardless of civis/cnorm/cvvis. Which probably is what the user wants. If the user has NOT enabled blinking, civis/cnorm/cvvis act as intended: cvvis blink, civis and cnorm do not. If an application overrides the cursor blink/style with ‘CSI Ps SP q’, that will override the user’s setting in foot.ini. But most likely that too is intended (for example, the user may have configured the application to use a different cursor style). And, a well written application will emit the ‘Se’ terminfo sequence on exit, which in foot is defined to ‘CSI SP q’, which will reset both the style and blink state to the user configured style/state. Closes #218
| * | term: remove read-only properties copied from the configDaniel Eklöf2020-11-26-56/+37
| | | | | | | | | | | | Use the config directly instead.
* | | main: tag fdm loop with likely() and unlikely()Daniel Eklöf2020-11-26-2/+2
| | |
* | | fdm: keep polling on EINTRDaniel Eklöf2020-11-26-4/+5
| | |
* | | doc: foot.5: minor highlighting fixesDaniel Eklöf2020-11-26-5/+6
| | |
* | | doc: foot.1: no need to say foot.ini twiceDaniel Eklöf2020-11-26-1/+1
|/ /
* | changelog: update contributor listDaniel Eklöf2020-11-25-0/+1
| |
* | Merge branch 'dont-reflow-alt-screen'Daniel Eklöf2020-11-25-20/+140
|\ \ | | | | | | | | | Closes #221
| * | grid: resize_without_reflow: don’t call min() on every loop iterationDaniel Eklöf2020-11-25-1/+1
| | |
| * | resize: don’t reflow text on alt screenDaniel Eklöf2020-11-25-20/+140
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alt screen applications normally reflow/readjust themselves on a window resize. When we do it too, the result is graphical glitches/flashes since our re-flowed text is rendered in one frame, and the application re-flowed text soon thereafter. We can’t avoid rendering some kind of re-flowed frame, since we don’t know when, or even if, the application will update itself. To avoid glitches, we need to render, as closely as possible, what the application itself will render shortly. This is actually pretty simple; we just need to copy the visible content over from the old grid to the new grid. We don’t bother with text re-flow, but simply truncate long lines. To simplify things, we simply cancel any active selection (since often times, it will be corrupted anyway when the application redraws itself). Since we’re not reflowing text, there’s no need to translate e.g. the cursor position - we just keep the current position (but bounded to the new dimensions). Fun thing: ‘less’ gets corrupted if we don’t leave the cursor at the (new) bottom row. To handle this, we check if the cursor (before resize) is at the bottom row, and if so, we move it to the new bottom row. Closes #221
* | Merge branch 'wl_output'Daniel Eklöf2020-11-25-4/+11
|\ \ | | | | | | | | | Closes #219
| * | wayland: Use wl_output_release with wl_output v3Kenny Levinsen2020-11-24-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wl_output_release, the use of which was recently introduced, is not available until wl_output interface version 3. However, only wl_output version 2 was bound. This lead to protocol errors when a display was disconnected, causing foot to terminate. Instead, only use wl_output_release if wl_output version 3 is provided and bound. Otherwise, just use wl_output_destroy. Closes: https://codeberg.org/dnkl/foot/issues/219
* | | Merge branch 'sixel-pgo'Daniel Eklöf2020-11-24-2/+50
|\ \ \
| * | | pkgbuild: add --sixel to generate-alt-random-writesDaniel Eklöf2020-11-24-1/+1
| | | |
| * | | install: add --sixel to suggested command line for generate-alt-random-writesDaniel Eklöf2020-11-24-0/+1
| | | |
| * | | scripts: generate-alt-random-writes: add --sixelDaniel Eklöf2020-11-24-1/+48
|/ / / | | | | | | | | | | | | When --sixel is specified, we generate random sixel images in the ‘normal’ screen, after exiting the alt screen.
* | | term: place frequently accessed members first in term structDaniel Eklöf2020-11-24-35/+34
| | | | | | | | | | | | To hopefully use the cache better.
* | | Merge branch 'increase-sixel-default-max-size'Daniel Eklöf2020-11-24-27/+21
|\ \ \ | |/ / |/| |
| * | sixel: change default max size to 10000x10000Daniel Eklöf2020-11-23-27/+21
|/ / | | | | | | | | It used to be the size of the window. This caused images to be cropped when the application emitting them didn’t change the max size.