Commit graph

5830 commits

Author SHA1 Message Date
jaroeichler
9da1b1cec3
themes: add Material Amber 2023-03-03 18:31:31 +01:00
Daniel Eklöf
9a5a2d9957
key-binding: sort binding lists
Sort bindings such that bindings with the same symbol are sorted with
the binding having the most modifiers comes first.

This fixes an issue where the “wrong” key binding are triggered when
used with “consumed” modifiers.

For example: if Control+BackSpace is bound before
Control+Shift+BackSpace, then the latter binding is never triggered.

Why? Because Shift is a consumed modifier. This means
Control+BackSpace is “the same” as Control+Shift+BackSpace.

By sorting bindings with more modifiers first, we work around the
problem. But note that it is *just* a workaround, and I’m not
confident there aren’t cases where it doesn’t work.

Closes #1280
2023-03-03 18:29:22 +01:00
Daniel Eklöf
514fcc20a7
render: resize: call xdg_toplevel_set_min_size()
This is a hint to the compositor, not to set a smaller size than this.
2023-03-02 17:22:27 +01:00
Daniel Eklöf
8a849b4b08
render: fix inversed cursor fg color when alpha != 1.0, take #2
No need to check if terminal colors have been reversed - this is done
by the cell rendering logic.

This hopefully fixes all remaining issues with invisible text when
background alpha < 1.0
2023-02-28 17:49:57 +01:00
Daniel Eklöf
7a43737745
render: fix selected cursor cell being ‘invisble’ when background alpha is used
... by taking the cell ‘selected’ state into account when determining
whether to use the default fg or bg as the ‘text’ color.
2023-02-27 17:51:29 +01:00
Daniel Eklöf
7f26914583
wayland: ignore configure events for unmapped surfaces
Closes #1249

Note that it is still unclear whether ack:ing a configure event for an
unmapped surface is a protocol violation, or something that should be
handled by the compositor.

According to
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/108,
Kwin, Mutter and Weston handles it, while wlroots does not.
2023-02-25 09:22:20 +01:00
Craig Barnes
f2356adee3 doc: foot.ini: fix spelling mistake in [bell].urgent description 2023-02-16 09:12:53 +00:00
Craig Barnes
25154a8150 doc: ctlseq: fix capitalization in description of DA3 sequence 2023-02-16 08:50:53 +00:00
Daniel Eklöf
1c16e4a575
Tag a couple variables with UNUSED, to fix warnings with clang-15
Closes #1278
2023-02-12 19:09:48 +01:00
Craig Barnes
1823fa846a completions: bash: simplify awk command used to filter terminfo names 2023-01-27 11:47:12 +00:00
Craig Barnes
b81b98d47c render: fix incorrect indent introduced by previous commit 2023-01-17 23:49:32 +00:00
Daniel Eklöf
a9298959a1
render: fix double-width glyphs glitching when surrounding cells overflow into it
If cells overflowed (for example, by using an italic font that isn’t
truly monospaced) into a double-width glyph (that itself is *not*
overflowing), then the double-width glyph would glitch when being
rendered; typically the second half of it would occasionally
disappear.

This happened because we tried to rasterize the second cell of the
double-width glyph. This cell contains a special “spacer”
value. Rasterizing that typically results the font’s “not available”
glyph.

If _that_ glyph overflows, things broke; we’d later end up forcing a
re-render of it (thus erasing half the double-width glyph). But since
the double-width glyph _itself_ doesn’t overflow, _it_ wouldn’t be
re-rendered, leaving it half erased.

Fix by recognizing spacer cells, and not trying to rasterize them (set
glyph count to 0, and cell count to 1).

Closes #1256
2023-01-17 19:43:47 +01:00
Daniel Eklöf
d1220aebfd
terminfo: sync with ncurses 2023-01-14
* RV/rv: report DA2
* XR/xr: report version (XTVERSION)
* XF: boolean, focus in/out events available
2023-01-15 14:09:08 +01:00
Daniel Eklöf
09f3475ad1
config: don’t double-free key binding auxiliary data
Key bindings with multiple key mappings share auxiliary data (e.g. the
command to execute in pipe-* bindings, or the escape sequence in
text-bindings).

The first one is the designated “master” copy. Only that one should be
freed.

This fixed a double-free on exit, with e.g.

  [text-bindings]
  \x1b\x23=Mod4+space Mod4+equal

Closes #1259
2023-01-15 10:24:01 +01:00
Daniel Eklöf
ffaf08e07c
config: remove unused struct 2023-01-15 10:23:44 +01:00
EuCaue
3f57afbf60
add rose-pine theme 2023-01-13 11:41:05 +01:00
Craig Barnes
becdcd9bb7 completions: bash: complete option arguments for short options 2023-01-10 19:56:12 +00:00
Craig Barnes
8acc10b9d4 completions: bash: use "case" instead of long if/elif/else chain 2023-01-10 19:44:24 +00:00
Craig Barnes
7d28da5006 Use "command -v" instead of "which" in bash completion scripts
The former is a built-in command in bash, whereas the latter is an
external command and isn't always necessarily available.
2023-01-10 18:34:25 +00:00
Grigory Kirillov
a38b8d0222 doc: fix a typo 2023-01-08 00:55:01 +03:00
Craig Barnes
f19768e304 wayland: avoid passing NULL to log_msg() in wayl_reload_xcursor_theme()
This pointer ends up being passed to various printf-family functions,
where passing a NULL pointer for an "%s" format specifier invokes
undefined behaviour.
2023-01-06 23:43:51 +00:00
woojiq
c9465e4c5c
themes: add Onedark 2023-01-06 10:49:45 +01:00
Daniel Eklöf
63bef0dc8c
ci: drop gitlab CI
We’re no longer mirroring to gitlab.
2023-01-02 13:52:56 +01:00
Craig Barnes
1d3023ec5e changelog: amend terminfo names, in accordance with previous commit 2023-01-01 15:21:17 +00:00
Daniel Eklöf
88641005fe
terminfo: PD/PE -> PE/PS
Ncurses 2022-12-24 had the names wrong. It was corrected on
2022-12-29.
2023-01-01 15:21:05 +01:00
Daniel Eklöf
e7c1a93d29
terminfo: add entries for bracketed paste
Ncurses added these in 2022-12-24, but they have been used/supported
by vim since 2017.

* BE - Bracketed paste Enable
* BD - Bracketed paste Disable
* PE - Paste Enable (i.e. "begin")
* PD - Paste Disable (i.e. "end")
2023-01-01 15:07:02 +01:00
Daniel Eklöf
6259d59b4d
config: change default grapheme-width-method from wcswidth to double-width
The old default, wcswidth, simply calls wcswidth() on the grapheme
cluster. This was supposedly the implementation with the highest
application compatibility. Except we never even tried to measure
it. It was just assumed.

A lot of modern applications have better implementations. Let’s try to
push support for better emoji support by changing our default method
from wcswith to double-width.

While far from correct (it’s not based on the Unicode tables), the
‘double-width’ method produces accurate results anyway.

double-width is like wcswidth(), in that it adds together the
individual wcwidths of all codepoints in the grapheme cluster. But, it
limits the maximum width to 2.
2023-01-01 10:29:27 +01:00
Daniel Eklöf
9e4270cd48
themes: comment out selection-{foreground,background}
That is, mouse selections should default to inverse fg/bg
2022-12-26 11:03:17 +01:00
Daniel Eklöf
135d4478a1
themes: add ‘conf’ modeline 2022-12-26 10:59:37 +01:00
Daniel Eklöf
da7b393a03
themes: remove alpha
Alpha isn’t really part of the theme. Leave it up to the user to set
alpha.
2022-12-26 10:54:02 +01:00
argosatcore
6ebe5cf621
Add Deus theme.
New color palette based on: https://github.com/ajmwagar/vim-deus
2022-12-26 10:51:42 +01:00
Daniel Eklöf
4ee0b28b02
config: font-size-adjustment: don’t allow empty %-values (key=%) 2022-12-17 11:00:05 +01:00
Daniel Eklöf
7bf150c11a
config: value_to_pt_or_px(): don’t allow empty px values (key=px) 2022-12-17 11:00:05 +01:00
Daniel Eklöf
59018446fd
foot.ini: add font-size-adjustment 2022-12-17 11:00:05 +01:00
Daniel Eklöf
f6ca8c90e1
config: add ‘font-size-adjustment=N[px|%]’ option
This patch adds a new config option, font-size-adjustment.

It lets you configure how much the font size should be
incremented/decremented when zooming in or out (ctrl-+, ctrl+-).

Values can be specified in points, pixels or percent.

Closes #1188
2022-12-17 10:59:17 +01:00
Joakim Nohlgård
7bb5c80d04 main: Graceful fallback if user has configured an invalid locale 2022-12-16 08:38:37 +01:00
Daniel Eklöf
3b9aca6a3d
doc: foot-ctlseq: expand last column to fill screen in all tables 2022-12-14 12:20:52 +01:00
Daniel Eklöf
ccfb953bb0
slave: unsetenv() env vars that have been set to the empty string
That is, users can now *clear* environment variables by doing:

  [environment]
  VAR=””

Note that the quotes are required.

Closes #1225
2022-12-06 19:36:15 +01:00
Daniel Eklöf
646314469a
doc: foot.ini: add example, and mention string options can be quoted 2022-12-06 19:36:07 +01:00
Daniel Eklöf
57d9a7451f
foot.ini: use a quoted, empty string for “indicator-format”
We don’t allow empty values, but we do allow quoted, empty values.
2022-12-06 19:36:07 +01:00
Daniel Eklöf
051e862420
config: allow string values to be quoted
* Both double and single quotes are recognized. There’s no difference
  in how they are handled.
* The entire string must be quoted:
  - “a quoted string” - OK
  - quotes “in the middle” of a string - NOT ok
* Two escape characters are regonized:
  - Backslash
  - The quote character itself
2022-12-06 19:35:58 +01:00
Daniel Eklöf
1486c57bdb
doc: foot: add PWD to list of env vars set in child process 2022-12-04 19:49:02 +01:00
Daniel Eklöf
b43a41df6a
log: don’t default to syslog enabled
Initialize the global ‘do_syslog’ variable to false. This ensures any
log calls done before log_init() has been called (e.g. unit tests)
doesn’t syslog anything.

As a side effect, such log calls no longer open an implicit syslog
file descriptor; this is how this “bug” was found: valgrind detected
an unclosed file descriptor at exit.

Finally, completely disable syslogging if log-level is “none”.
2022-12-02 11:45:10 +01:00
Daniel Eklöf
76d494484f
url-mode: tag cells after snapshot:ing the grid
Before this patch, hyperlinked cells were tagged with the “URL”
attribute (thus instructing the renderer to draw an
underline) *before* the grid was snapshot.

When exiting URL mode, the cells were once again updated, this time
removing the URL attribute.

But what if an escape sequence had modified the grid _while we were in
URL mode_? Depending on the sequence, it could move cells around in
such a way, that when exiting URL mode, the affected cells weren’t
updated correctly. I.e. we left some cells with the URL attribute
still set.

The fix is simple: tag cells in the snapshot:ed grid only (which isn’t
affected by any escape sequence received while in URL mode). Not in
the *actual* grid (which _is_ affected).
2022-11-30 10:51:45 +01:00
Craig Barnes
1b24cf4fcb doc: ctlseq: add trailing space to fix XTGETTCAP entry in DCS table
Without the trailing space, both the sequence and the description
were getting packed into a single table column.
2022-11-24 20:34:41 +00:00
Daniel Eklöf
0fc8b65a2b
selection: selection_on_rows(): typo: row_start -> row_end
This fixes an issue where selections in the scroll margins were not
detected correctly. This meant they weren’t canceled as they should
have been, which in turn caused a visual glitch where text appeared to
be selected, but were in fact not.
2022-11-24 19:18:20 +01:00
Daniel Eklöf
4d03b6c611
Merge branch 'line-height-adjust'
Closes #1218
2022-11-24 19:17:09 +01:00
Daniel Eklöf
db2627ea26
changelog: scaling factor not being applied when converting px-to-pt 2022-11-24 17:21:53 +01:00
Daniel Eklöf
fa6b07abea
term: apply scale factor when converting a px value to pt 2022-11-24 17:20:05 +01:00
Daniel Eklöf
e85257bcae
term: initialize term->font_line_height when there’s no user-set line-height 2022-11-24 17:09:31 +01:00