Commit graph

5282 commits

Author SHA1 Message Date
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
Daniel Eklöf
22266e384b
search: refactor: add add_wchars(), make search_add_chars() use it
search_add_chars() converts the incoming UTF-8 string into a wide-char
string, and then calls add_wchars().

add_wchars() inserts the string into the search buffer, at the current
cursor position.
2022-01-29 17:50:42 +01:00
Daniel Eklöf
2ab569169e
Merge branch 'xcursor-size' 2022-01-29 17:48:16 +01:00
Pranjal Kole
d9cd1749e0 wayland: use strtol() to parse xcursor_size
sscanf is not very robust. For example,
$ XCURSOR_SIZE="36asdf" foot
works without any errors, and xcursor_size is parsed as 36.
2022-01-29 17:52:06 +05:30
Daniel Eklöf
7930652b30
Merge branch 'xcursor-getenv-fix' 2022-01-29 13:06:13 +01:00
Pranjal Kole
fa396cdc33 wayland: use getenv() according to spec
From the NOTES section of getenv(3):
 The string pointed to by the return value of getenv() may be statically
 allocated, and can be modified by a subsequent call to getenv()...

So, previously xcursor_theme could be modified by libc to contain
xcursor_size. This has been fixed by getting xcursor_theme after
computing the value of xcursor_size.
2022-01-29 16:18:19 +05:30
Daniel Eklöf
2cc0a450b4
doc: foot.1: add missing ‘*’ 2022-01-27 18:54:48 +01:00
Daniel Eklöf
034f4171a4
doc: foot.1: use tab for indentation 2022-01-27 18:54:38 +01:00
Daniel Eklöf
49a2f4a9e6
Merge branch 'document-ansi-colors' 2022-01-27 18:49:54 +01:00
Daniel Eklöf
c7836bcd90
readme: add URL mode to the list of keyboard shortcuts 2022-01-27 18:49:04 +01:00
Daniel Eklöf
0c363b83bf
readme: add the new XF86{Copy,Paste} keyboard shortcuts 2022-01-27 18:48:51 +01:00
Daniel Eklöf
90b906d159
doc: foot.1: add URL mode bindings to the list of default keyboard shortcuts 2022-01-27 18:45:53 +01:00
Daniel Eklöf
701d5fe5a4
doc: foot.1: add “enter URL mode” shortcut 2022-01-27 18:45:41 +01:00
Daniel Eklöf
ef855aa132
doc: foot.1: add the new XF86{Copy,Paste} key bindings 2022-01-27 18:45:22 +01:00
Daniel Eklöf
27017cf0b3
Merge branch 'support-copy-paste-keybindings-by-default' 2022-01-25 21:41:07 +01:00