Commit graph

5296 commits

Author SHA1 Message Date
Craig Barnes
ff90781ebc tests: fix typo in error message 2022-02-07 12:32:23 +00:00
Daniel Eklöf
3baf7de3b8
Merge branch 'finalize-selection-on-window-resize'
Closes #922
2022-02-07 13:23:56 +01:00
Daniel Eklöf
09fd39bb29
changelog: mouse selections are finalized on window resize 2022-02-07 10:44:00 +01:00
Daniel Eklöf
003ea4904d
render: resize: add TODO: translate pivot coords 2022-02-07 10:42:32 +01:00
Daniel Eklöf
a187271ca4
render: resize: finalize selection before reflowing the grid
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
2022-02-07 10:38:30 +01:00
Daniel Eklöf
b4027118e6
term: init: initialize selection pivot point coords to -1,-1
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.
2022-02-07 10:36:59 +01:00
Daniel Eklöf
1eef5a00e6
changelog: “(null)” being logged as font-name 2022-02-06 12:07:58 +01:00
Daniel Eklöf
b0e9ee2137
config: font->name may be NULL
If it is, fallback to the font pattern instead, like we used to do
before fcft-3.
2022-02-06 12:07:42 +01:00
Daniel Eklöf
87c0d857cf
changelog: missing ‘wayland_client’ dependency in test-config 2022-02-06 12:05:01 +01:00
Daniel Eklöf
203a09d533
meson: tests: config: add missing ‘wayland_client’ dependency
Closes #918
2022-02-06 12:02:42 +01:00
Daniel Eklöf
b3849cb983
changelog: add new ‘unreleased’ section 2022-02-05 17:38:24 +01:00
Daniel Eklöf
85be473303
Merge branch 'releases/1.11' 2022-02-05 17:37:58 +01:00
Daniel Eklöf
8c66dbbd78
ci: codespell: don’t uppercase words in the exclude list 2022-02-05 17:31:16 +01:00
Daniel Eklöf
1b0fac49ed
ci: fix codespell -L usage, take 2 2022-02-05 17:30:09 +01:00
Daniel Eklöf
e5926ad6be
ci: fix codespell -L usage 2022-02-05 17:29:23 +01:00
Daniel Eklöf
bfab825b02
ci: use fcft master branch 2022-02-05 17:27:30 +01:00
Daniel Eklöf
6c38c2358a
ci: allow ‘Ser’ (as in Simon Ser) in Codespell 2022-02-05 17:26:14 +01:00
Daniel Eklöf
844563a791
main: remove debug logging 2022-02-05 17:22:01 +01:00
Daniel Eklöf
3fea7829fa
meson: bump version to 1.11.0 2022-02-05 17:20:27 +01:00
Daniel Eklöf
ccb0cd178f
changelog: prepare for 1.11.0 2022-02-05 17:19:43 +01:00
Daniel Eklöf
52f1f44897
Merge branch 'fcft-3' 2022-02-05 17:15:49 +01:00
Daniel Eklöf
dc42b41b62
char32: inline wcs*() wrappers 2022-02-05 17:00:54 +01:00
Daniel Eklöf
e0227266ca
fcft: adapt to API changes in fcft-3.x
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
2022-02-05 17:00:54 +01:00
Daniel Eklöf
2be8c39044
Merge branch 'config-no-null-strings-in-printf' 2022-02-05 17:00:08 +01:00
Daniel Eklöf
343f2c51a4
config: s/of the form/on the form/ 2022-02-05 16:59:42 +01:00
Daniel Eklöf
a339c40f5d
changelog: XF86Copy+XF86Paste are now recognized by default 2022-02-05 16:42:38 +01:00
Pranjal Kole
06fdebbbcb config: use getline idiomatically
getline(3) contains an example program at the end, showing its usage.

A few other changes have also been made.
2022-02-05 13:48:08 +05:30
Pranjal Kole
65b5469e86 config: don't pass null strings to *printf()
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
2022-02-05 11:50:41 +05:30
Daniel Eklöf
ef54b7f2e5
Merge branch 'improve-shellscript' 2022-02-04 21:30:04 +01:00
Daniel Eklöf
e97e873b9e
box-drawing: LIGHT ARC: check for sqrt() failures
Closes #914
2022-02-04 18:15:35 +01:00
Daniel Eklöf
a5f8ed1b78
Merge branch 'sixel-repeat-edge-cases' 2022-02-04 18:14:32 +01:00
Daniel Eklöf
58bbbb0a31
sixel: revert to default state when an invalid DECGRI character is received 2022-02-04 18:14:25 +01:00
Daniel Eklöf
9e8d553a21
sixel: DECGRI (repeat) with a count of 0 should emit a single sixel 2022-02-04 18:14:24 +01:00
Daniel Eklöf
9150507209
sixel: resize: truncate instead of failing, when new size exceeds max size
If the size we’re trying to set exceeds the configured max size,
truncate instead of failing.
2022-02-04 18:14:24 +01:00
Daniel Eklöf
8ca0eaa94c
main: reset signal mask and signal handlers at startup
This ensures processes spawned by us (e.g. the shell, new terminal
instances etc) don’t inherit a flawed signal mask, or having signals
unknowingly ignored.

Closes #854
2022-02-04 18:13:21 +01:00
Pranjal Kole
a9bbbda1c7 generate-version: exit early if argc is not 3
Print usage information and exit if the number of arguments is not 3.
2022-02-04 19:10:16 +05:30
Daniel Eklöf
63b12d4cdc
Merge branch 'fix-bash-completions' 2022-02-03 19:33:51 +01:00
Nicolai Dagestad
0f49a8a033 Fix bash completion for lists of short options 2022-02-03 18:49:54 +01:00
Daniel Eklöf
af4ae65349
wayland: remove workaround for sway-1.5 bug - slow resizing of hidden windows
In Sway-1.5, sway waits for configure ACKs from hidden windows when
views are being resized. I.e. if you have e.g. a stacked view, with
one or more windows currently not visible, and you resize the stack,
then sway will emit configure events to all windows, and then wait for
ACKs before rendering the resized view.

The problem with this is that sway also does **not** call frame
callbacks on hidden windows. So if we have rendered one frame, and
thus registered a frame callback, we’ll never render any more frames
until the window becomes visible again. Ergo, if you resize the view
interactively, only the first resize actually happens. After that, all
hidden views are “stuck”, causing ACK timeouts.

We worked around this in foot by preempting the frame
callback. I.e. destroying it, and rendering the frame anyway.

This has fixed in sway-1.6, and thus we can remove the workaround.
2022-02-03 18:01:13 +01:00
Daniel Eklöf
69e2bff8c8
extract: ensure line-based selections are terminated with a newline
Closes #869
2022-02-03 17:58:25 +01:00
Daniel Eklöf
5ee902551a
selection: don’t quote file URIs on the alt screen
Closes #379
2022-02-02 21:17:01 +01:00
Daniel Eklöf
ab6b1b3679
install: remove reference to the Arch AUR package 2022-02-02 21:08:22 +01:00
grtcdr
fc99379a0c
docs: remove arch linux from install.md now that it's in the official repositories 2022-02-02 20:13:38 +01:00
Daniel Eklöf
04c091cf44
Merge branch 'alt-tab'
Closes #900
2022-02-02 19:22:20 +01:00
Daniel Eklöf
66801e4f33
keymap: alt-tab (C-tab) now emits “ESC tab” by default
In our default mode (roughly equivalent to XTerm’s modifyOtherKeys=1),
alt-tab now emits ESC-tab instead of CSI 27;3;9~.

When modifyOtherKeys=2 is enabled (CSI >4;2m), alt-tab emits the “old”
CSI 27 escape.

This better matches XTerm’s behavior.

Note that other alt-tab combos are ambiguous in XTerm, and thus they
are left unchanged here (i.e. we keep emitting CSI 27 escapes for
them).

Closes #900
2022-02-01 18:37:50 +01:00
Daniel Eklöf
94f0b7283a
Merge branch 'search-last-query' 2022-01-29 17:50:56 +01:00
Daniel Eklöf
eb33a0529f
changelog: search for last searched-for string 2022-01-29 17:50:43 +01:00
Daniel Eklöf
1537fd02bd
doc: foot.1: describe how to search for the previous search string 2022-01-29 17:50:43 +01:00
Daniel Eklöf
749d4c0766
doc: foot.1: shortcuts: mention that there are more actions than listed here 2022-01-29 17:50:43 +01:00
Daniel Eklöf
739e7d76b4
search: remember last searched-for string between searches
Regardless of how we exit search mode (commit or cancel), the search
string is remembered.

The next time we enter search mode, the last searched-for string will
be used when searching for the next/prev match (ctrl+r, ctrl+s), and
the search query is empty.
2022-01-29 17:50:42 +01:00