aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeLines
...
| * add Nord themeMariusz Bialonczyk2022-03-11-0/+42
| |
* | foot.ini: change vim modeline from ‘conf’ to ‘dosini’merkix2022-03-13-1/+1
| |
* | osc: use four digits in OSC-4 and OSC-11 rgb:r/g/b repliesDaniel Eklöf2022-03-13-4/+8
| | | | | | | | Closes #971
* | Merge branch 'osc-buffer-growth'Craig Barnes2022-03-13-3/+13
|\ \ | |/ |/|
| * osc: grow OSC buffer exponentially instead of by fixed increments of 128Craig Barnes2022-03-02-3/+13
| | | | | | | | | | | | With fixed increments of 128 bytes, an OSC 52 copy operation could end up doing thousands or tens of thousands of realloc(3) calls just to copy a few MB.
* | input: get_current_modifiers(): don’t crash if seat has no keyboardDaniel Eklöf2022-03-04-6/+19
| | | | | | | | Closes #963
* | dcs: prevent possibility of out-of-bounds reads in decrqss()Craig Barnes2022-03-02-4/+4
|/ | | | | | | | | | This could be triggered by running, for example: printf '\033P$qrxyz\033\\' ...which would cause a memcmp() of 4 bytes on a 2 byte string literal. Fixes: #960
* Wrap setlocale in asserts since it can failjvoisin2022-02-27-4/+12
|
* Add JetBrains Darcula themeEnes Hecan2022-02-27-0/+28
|
* meson: stop using deprecated functions, require meson >= 0.58Daniel Eklöf2022-02-27-7/+8
| | | | | | * get_pkgconfig_variable() -> get_variable() * prog.path() -> prog.full_path() * meson.build_root() -> meson.global_build_root()
* Merge branch 'socket-activation'Daniel Eklöf2022-02-27-29/+147
|\ | | | | | | Closes #604
| * Install notes regarding systemd unit filesMax Gautier2022-02-26-1/+1
| |
| * Socket activation changelog entryMax Gautier2022-02-26-1/+1
| |
| * Document socket activation featureMax Gautier2022-02-26-1/+17
| | | | | | | | - Particular mention to included systemd user units
| * Adding systemd unit files for socket activationMax Gautier2022-02-26-0/+37
| | | | | | | | | | | | | | | | | | | | - Support for multiples concurrent instances, templated on WAYLAND_DISPLAY - Use standard input for the socket file descriptor (inetd style) - Always use the socket provided by systemd with the systemd user service - wayland-instance@.target is intended to be a special target a bit like graphical-session.target.
| * Make foot able to receive a socket from its parentMax Gautier2022-02-26-26/+91
|/ | | | | | | If the argument to --server is parsed as a number, consider it to be a file descriptor, and use that as a socket. This is necessary to be able to use socket activation with the server mode of foot.
* Merge branch 'scrollback-home-and-end'Daniel Eklöf2022-02-24-90/+86
|\
| * config/input: add scrollback-home|end key bindings (unbound by default)Daniel Eklöf2022-02-23-0/+26
| |
| * commands: refactor scrollback up/downDaniel Eklöf2022-02-23-90/+60
|/ | | | | | | | | | | | | | | | | | | | | | | | | When moving the viewport in the scrollback (i.e. “scrolling”), we need to ensure the viewport is not moved past the beginning, or end, of the scrollback. This was previously accomplish by first limiting the number of lines to scroll to the number of visible rows (i.e the viewport _size_), and by adjusting the viewport after moving it, to ensure it doesn’t point into an uninitialized scrollback area etc. I.e. the implementation was _reactive_. This patch rewrites the logic to be _proactive_; we now calculate _where_ the beginning (or end) of the scrollback is, and then how many lines there is from there, to the viewport. This is our _maximum_ number of lines to scroll. When done correctly (which I hope this patch does), this allows us to remove _all_ checks after moving the viewport - we already _know_ it’s correct, and valid. As a bonus, we can remove the old limit, where scrolling was only allowed to be at most a single page.
* Merge branch 'custom-input-escapes'Daniel Eklöf2022-02-18-22/+221
|\ | | | | | | Closes #325
| * doc: foot.ini: document the new [text-bindings] sectionDaniel Eklöf2022-02-16-0/+31
| |
| * foot.ini: move [text-bindings] section, and update exampleDaniel Eklöf2022-02-16-3/+3
| | | | | | | | Use Super+c -> Ctrl+c as example
| * changelog: remapping input to custom escape sequencesDaniel Eklöf2022-02-16-0/+2
| |
| * config: do key binding collision handling in overridesDaniel Eklöf2022-02-16-18/+19
| | | | | | | | | | This ensures we detect, and handle, collisions also for key-bindings specified as overrides.
| * tests: config: initial tests for text-bindingsDaniel Eklöf2022-02-16-0/+37
| |
| * wip: map key combos to custom text strings (including escapes)Daniel Eklöf2022-02-16-4/+132
|/ | | | | | | | | | | | | With this, it is now possible to map key combos to custom escapes. The new bindings are defined in a new section, “text-bindings”, on the form “string=key combo”. The string can consist of printable characters, or \xNN style hex digits: [text-bindings] abcd = Control+a \x1b[A = Control+b Control+c Control+d # map ctrl+b/c/d to UP
* main: --server: don’t exit with code 0 on failureDaniel Eklöf2022-02-16-4/+7
| | | | | | | | | | | | | | | | | | A foot --server instance would exit with code 0, even on failure, if the number of currently open terminal instances were 0. This is because ‘ret’ assumed failure, and then tried to set it to ‘success’ after the even loop had terminated, basted on the server’s current state. Fix by: * set ‘ret’ to success just before entering the event loop * set ‘ret’ to failure when we detect an FDM failure * don’t try to second-guess success/failure after having exited the event loop Closes #943
* Merge branch 'terminfo-sync-2026'Craig Barnes2022-02-16-5/+5
|\
| * doc: ctlseq: recommend using DECSET 2026 for synchronized updatesCraig Barnes2022-02-16-4/+4
| | | | | | | | | | | | Instead of the somewhat problematic[1] DCS-based equivalent. [1]: https://codeberg.org/dnkl/foot/issues/459
| * terminfo: use DECSET 2026 instead of DCS sequences for Sync capabilityCraig Barnes2022-02-16-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Even though it makes little difference to foot which is used in the terminfo entry, DECSET 2026 has some advantages[1] over the DCS sequences and we should probably promote the better of the 2 where possible. Note: the terminfo string was taken from Nicholas Marriott's suggestion[2] in the terminal-wg discussion. [1]: https://codeberg.org/dnkl/foot/issues/459 [2]: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/2#note_973680
* | csi: fix case label typo in decrqm()Craig Barnes2022-02-16-1/+1
|/ | | | | | | | | | The other functions that deal with private modes all use 1070 for term->sixel.use_private_palette. The xterm docs[1] also list this param as 1070: > Ps = 1 0 7 0 ⇒ use private color registers for each graphic Using 1079 seems to have been a mistake in commit 4aa980a6a2ce3c3.
* doc: ctlseq: tweak formatting of OSC 22 sequence slightly, for clarityCraig Barnes2022-02-15-1/+1
| | | | | Having 3 separately underlined words made it look a bit like 3 separate parameters, at a glance.
* doc: ctlseq: make OSC 8 formatting consistent with other sequencesCraig Barnes2022-02-15-3/+3
|
* Explicitly initialize sigaction::sa_mask members with sigemptyset(3)Craig Barnes2022-02-12-6/+16
| | | | | | | | | | | | | | | | | | | | Not doing so before calling sigaction(3) is "undefined" according to POSIX[1]: > Applications shall call either sigemptyset() or sigfillset() at least > once for each object of type sigset_t prior to any other use of that > object. If such an object is not initialized in this way, but is > nonetheless supplied as an argument to any of pthread_sigmask(), > sigaction(), sigaddset(), sigdelset(), sigismember(), sigpending(), > sigprocmask(), sigsuspend(), sigtimedwait(), sigwait(), or > sigwaitinfo(), the results are undefined. The use of designated initializers means that sa_mask members were still being initialized, but sigset_t is an opaque type and implicit initialization doesn't necessarily produce the same results as using sigemptyset(3) (although it typically does on most implementations). [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaddset.html
* osc: don’t damage the entire view on a single color palette updateDaniel Eklöf2022-02-10-1/+41
| | | | | Instead, loop the viewport and dirty only those cells that are affected by the palette change.
* Merge branch 'remove-decset-27127'Craig Barnes2022-02-09-17/+6
|\
| * csi/input: remove private mode 27127Craig Barnes2022-02-09-17/+6
| | | | | | | | This effectively reverts commit 31c73f0cf01e1d0bdcd1435136b010c1c1ab442c.
* | meson: fcft-3.0.0 is buggy, require 3.0.1Daniel Eklöf2022-02-09-1/+1
|/ | | | | | | Fcft-3.0.0 is known to cause crashes. We don’t want anyone ever compiling foot against it. Closes #935
* Merge branch 'refactor-key-bindings'Daniel Eklöf2022-02-09-171/+223
|\
| * config: rename csd.color.close -> quitDaniel Eklöf2022-02-09-4/+4
| | | | | | | | | | | | | | | | | | | | | | This fixes a compilation error on FreeBSD: ../../foot/render.c:2055:45: error: no member named 'epoll_shim_close' in 'struct config::(anonymous at ../../foot/config.h:254:9)' conf_color = &term->conf->csd.color.close; ~~~~~~~~~~~~~~~~~~~~~ ^ /usr/local/include/libepoll-shim/epoll-shim/detail/common.h:8:15: note: expanded from macro 'close': #define close epoll_shim_close
| * input/search/url: pass pointer-to key-binding struct to execute()Daniel Eklöf2022-02-09-25/+28
| |
| * config: ‘pipe’ is now optional ‘aux’ data in the key-binding structDaniel Eklöf2022-02-09-83/+116
| | | | | | | | | | This allows us to add helper functions that e.g. compare bindings’ aux data in a generic way.
| * config: rename enum config_key_binding_type -> key_binding_typeDaniel Eklöf2022-02-09-7/+7
| |
| * input: call wayl_bindings_reset() when receiving a new keymapDaniel Eklöf2022-02-09-9/+1
| |
| * wayland: add wayl_bindings_reset()Daniel Eklöf2022-02-09-5/+13
| | | | | | | | | | This function resets (clears) all key- and mouse-bindings associated with the seat.
| * wayland: use key_bindings_destroy() to destroy the mouse bindingsDaniel Eklöf2022-02-09-3/+7
| |
| * wayland: unify key- and mouse-binding structsDaniel Eklöf2022-02-09-36/+46
| |
| * config: move structs and enums used by config from terminal.h -> config.hDaniel Eklöf2022-02-09-11/+13
|/
* foot.ini: add modeline so vim uses # comments instead of ;Johannes Altmanninger2022-02-09-0/+2
| | | | | | | | | | | | | | | | | Editors like Vim and Kakoune ship filetypes dosini and ini respectively. Both use ";" as comment character, which is used for example by Vim's "gq" command which wraps lines while preserving comment prefixes. foot only accepts # comments. I think it's desirable to stick to a single commenting style (easier to diff configs). Make Vim accept that by adding modeline to use the "conf" filetype, which is for "generic Unix config files". We already have an Emacs modeline at the top, but Vim seems to ignore it. Kakoune doesn't have that filetype, but a patch has been proposed to use # whenever it already occurs in the file, see https://github.com/mawww/kakoune/pull/4537
* Merge branch 'fallback-mouse-cursor'Daniel Eklöf2022-02-07-3/+15
|\ | | | | | | Closes #738
| * changelog: fallback xcursorAshish SHUKLA2022-02-07-1/+1
| |
| * Specify a fallback mouse cursorAshish SHUKLA2022-02-07-2/+8
| | | | | | | | | | `text' cursor is not available in lots of cursor themes, but `xterm' is, so specify `xterm' as a fallback cursor name.
| * pgo: add stub for render_xcursor_is_validAshish SHUKLA2022-02-07-0/+6
|/
* doc: ctlseq: OSC-22Daniel Eklöf2022-02-07-0/+4
|
* changelog: OSC-22Daniel Eklöf2022-02-07-0/+5
|
* osc: implement OSC-22 - set xcursor pointerDaniel Eklöf2022-02-07-0/+4
|
* term: add term_set_user_mouse_cursor()Daniel Eklöf2022-02-07-0/+17
| | | | | | | | | This function allows setting a custom mouse cursor. This is done by adding a ‘char*’ member to the term struct. When it is non-NULL, we *always* use that pointer (the exception being when the pointer is hidden), while the pointer is over the grid. This is instead of the hand/beam pointers we otherwise would use.
* render: add render_xcursor_is_valid()Daniel Eklöf2022-02-07-1/+11
| | | | | Returns true if the provided cursor name is non-NULL, and exist in the currently loaded xcursor theme.
* render: call wl_cursor_theme_get_cursor() earlierDaniel Eklöf2022-02-07-8/+13
| | | | | | | | | | | | | | | | | | | | | Before this patch, wl_cursor_theme_get_cursor() was called in the FDM hook, just before we’re about to update the mouse cursor “for real”. This relies on seat->pointer.xcursor still being valid. This is true as long as we’re only using our compiled-in static xcursor names, but not otherwise. Now, we call wl_cursor_theme_get_cursor() in render_xcursor_set(). At this point, we *know* seat->pointer.xcursor is valid. There is a slight chance of added overhead here, if the client application is switching mouse grabbing on/off rapidly. Before, the calls to wl_cursor_theme_get_cursor() would automatically be throttled. However, the main point of delaying the actual pointer update to the FDM hook is to throttle the *Wayland* calls. And this is still happening: wl_cursor_theme_get_cursor() is client-side only.
* Merge branch 'pipe-scrollback-crash'Daniel Eklöf2022-02-07-10/+21
|\ | | | | | | Closes #926
| * changelog: crash in pipe-scrollbackDaniel Eklöf2022-02-07-0/+2
| |
| * term: scrollback-to-text: crash when trying to extract the entire scrollbackDaniel Eklöf2022-02-07-10/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | We calculated the ‘start’ row by adding the number of screen rows to the current grid offset. This works in most cases. But not when the offset is close to the wrap-around. This triggered a crash when we tried to access a row number larger than the number of available grid rows. Fix by bounding the start row to the number of grid rows. This unearthed a second bug, where trying to extract the scrollback resulted in nothing getting copied. The extraction logic did: for (r = start; r != (end + 1); r++) .... This works, as long as end isn’t start-1. When we try to extract the entire scrollback, it _is_ start-1. Fix by rewriting the loop logic to check for r==end *after* copying the row contents, but *before* incrementing r. Closes #926
* Merge branch 'selection-handling-during-reflow'Daniel Eklöf2022-02-07-30/+67
|\ | | | | | | Closes #924
| * changelog: scrollback wrap-around crossing selectionsDaniel Eklöf2022-02-07-0/+2
| |
| * selection: foreach: sort start/end based on their scrollback-start relative valuesDaniel Eklöf2022-02-07-20/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When iterating the characters in a selection, we want to go from the “start” to the “end”, where start is the upper left-most character, and “end” is the lower right-most character. There are two things to consider: * The ‘start’ coordinate may actually sort after the ‘end’ coordinate (user selected from bottom of the window and upward) * The scrollback wraparound. What we do is calculate both the star and end coordinates’ scrollback-start relative row numbers. That is, the number of rows from the beginning of the scrollback. So if the very first row (i.e. the oldest) in the scrollback is selected, that has the scrollback-start relative number “0”. Then we loop from whichever (start or end coordinate) is highest up in the scrollback, to the “other” coordinate.
| * grid: reflow: add TODO to detect selection on re-used rows, and cancel itDaniel Eklöf2022-02-07-0/+7
| |
| * selection: ensure start/end coordinates are bounded by the current gridDaniel Eklöf2022-02-07-10/+2
| | | | | | | | Closes #924
* | tests: fix typo in error messageCraig Barnes2022-02-07-1/+1
|/
* Merge branch 'finalize-selection-on-window-resize'Daniel Eklöf2022-02-07-0/+27
|\ | | | | | | Closes #922
| * changelog: mouse selections are finalized on window resizeDaniel Eklöf2022-02-07-0/+7
| |
| * render: resize: add TODO: translate pivot coordsDaniel Eklöf2022-02-07-0/+6
| |
| * render: resize: finalize selection before reflowing the gridDaniel Eklöf2022-02-07-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a crash caused by the selection’s pivot point not being translated during reflow. While we could simply reflow the pivot point as well, testing shows irregular behavior with ongoing selections across window resizes, with different compositors behaving differently. For now, we simply finalize the selection, instead of trying to handle ongoing selections. Closes #922
| * term: init: initialize selection pivot point coords to -1,-1Daniel Eklöf2022-02-07-0/+4
|/ | | | | | While this _shouldn’t_ be necessary (pivot points are only used while a selection is ongoing). But it doesn’t hurt to initialize them anyway.
* changelog: “(null)” being logged as font-nameDaniel Eklöf2022-02-06-0/+2
|
* config: font->name may be NULLDaniel Eklöf2022-02-06-2/+6
| | | | | If it is, fallback to the font pattern instead, like we used to do before fcft-3.
* changelog: missing ‘wayland_client’ dependency in test-configDaniel Eklöf2022-02-06-0/+5
|
* meson: tests: config: add missing ‘wayland_client’ dependencyDaniel Eklöf2022-02-06-1/+1
| | | | Closes #918
* changelog: add new ‘unreleased’ sectionDaniel Eklöf2022-02-05-0/+11
|
* Merge branch 'releases/1.11'Daniel Eklöf2022-02-05-18/+17
|\
| * ci: codespell: don’t uppercase words in the exclude list1.11.0releases/1.11Daniel Eklöf2022-02-05-3/+3
| |
| * ci: fix codespell -L usage, take 2Daniel Eklöf2022-02-05-1/+1
| |
| * ci: fix codespell -L usageDaniel Eklöf2022-02-05-3/+3
| |
| * ci: use fcft master branchDaniel Eklöf2022-02-05-8/+0
| |
| * ci: allow ‘Ser’ (as in Simon Ser) in CodespellDaniel Eklöf2022-02-05-3/+3
| |
| * main: remove debug loggingDaniel Eklöf2022-02-05-2/+0
| |
| * meson: bump version to 1.11.0Daniel Eklöf2022-02-05-1/+1
| |
| * changelog: prepare for 1.11.0Daniel Eklöf2022-02-05-4/+13
|/
* Merge branch 'fcft-3'Daniel Eklöf2022-02-05-385/+904
|\
| * char32: inline wcs*() wrappersDaniel Eklöf2022-02-05-128/+70
| |
| * fcft: adapt to API changes in fcft-3.xDaniel Eklöf2022-02-05-385/+962
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fcft no longer uses wchar_t, but plain uint32_t to represent codepoints. Since we do a fair amount of string operations in foot, it still makes sense to use something that actually _is_ a string (or character), rather than an array of uint32_t. For this reason, we switch out all wchar_t usage in foot to char32_t. We also verify, at compile-time, that char32_t used UTF-32 (which is what fcft expects). Unfortunately, there are no string functions for char32_t. To avoid having to re-implement all wcs*() functions, we add a small wrapper layer of c32*() functions. These wrapper functions take char32_t arguments, but then simply call the corresponding wcs*() function. For this to work, wcs*() must _also_ be UTF-32 compatible. We can check for the presence of the __STDC_ISO_10646__ macro. If set, wchar_t is at least 4 bytes and its internal representation is UTF-32. FreeBSD does *not* define this macro, because its internal wchar_t representation depends on the current locale. It _does_ use UTF-32 _if_ the current locale is UTF-8. Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is defined. Other fcft API changes: * fcft_glyph_rasterize() -> fcft_codepoint_rasterize() * font.space_advance has been removed * ‘tags’ have been removed from fcft_grapheme_rasterize() * ‘fcft_log_init()’ removed * ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
* Merge branch 'config-no-null-strings-in-printf'Daniel Eklöf2022-02-05-80/+129
|\
| * config: s/of the form/on the form/Daniel Eklöf2022-02-05-1/+1
| |
| * config: use getline idiomaticallyPranjal Kole2022-02-05-66/+72
| | | | | | | | | | | | getline(3) contains an example program at the end, showing its usage. A few other changes have also been made.
| * config: don't pass null strings to *printf()Pranjal Kole2022-02-05-18/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | musl and glibc's *printf() convert NULL strings to "(null)" [0][1], but this is undefined behaviour. context.value has to be set to two backspaces, so that the extra colon is removed. context.key is set to one backspace, so that the extra dot is removed. context.section is now set to "main" by default, so it is never NULL. [0]: https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c#n593 [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf-internal.c;hb=HEAD#l1011
* | changelog: XF86Copy+XF86Paste are now recognized by defaultDaniel Eklöf2022-02-05-0/+4
|/
* Merge branch 'improve-shellscript'Daniel Eklöf2022-02-04-0/+5
|\
| * generate-version: exit early if argc is not 3Pranjal Kole2022-02-04-0/+5
| | | | | | | | Print usage information and exit if the number of arguments is not 3.
* | box-drawing: LIGHT ARC: check for sqrt() failuresDaniel Eklöf2022-02-04-0/+14
| | | | | | | | Closes #914
* | Merge branch 'sixel-repeat-edge-cases'Daniel Eklöf2022-02-04-14/+30
|\ \
| * | sixel: revert to default state when an invalid DECGRI character is receivedDaniel Eklöf2022-02-04-0/+5
| | |