Commit graph

4316 commits

Author SHA1 Message Date
Daniel Eklöf
ef4dc4bb7c
Merge branch 'app-id-in-notify' 2021-05-27 11:53:05 +02:00
Daniel Eklöf
f9a13e2eec
config: notify: change default value to use ${app-id}
Make the default value of ‘notify’ use ${app-id} for icon and
application name.
2021-05-27 11:41:57 +02:00
Daniel Eklöf
246c7ffc0f
readme: add OSC 8, 17, 19, 117, 119 and 777 to list of supported OSC 2021-05-26 22:45:48 +02:00
Craig Barnes
e5fedb77d9 Merge branch 'vt-remove-8bit-c1' 2021-05-26 20:07:51 +01:00
Daniel Eklöf
09f11b294d
Merge branch 'osc8-scrollback-wraparound'
Closes #552
2021-05-26 14:39:50 +02:00
Daniel Eklöf
a012c2fb3e
term: fix crash when an OSC-8 URI wraps around the scrollback
Long OSC-8 URIs, that are split up over multiple rows, are handled by
emitting one URI range on each row the URL touches.

This was done by initializing a row index variable, and then
incrementing it each loop iteration.

This caused an out-of-bounds array access when the row index reached
the maximum number of scrollback lines.

The fix is simple: make sure the row index variable wraps around,
instead of incrementing without any bounds.

Closes #552
2021-05-26 14:11:03 +02:00
Daniel Eklöf
e7fbded48f
Merge branch 'fix-iso-left-tab'
Closes #547
2021-05-26 09:15:13 +02:00
Craig Barnes
3d9302b6f9
macros: add UNITTEST macro and use to replace test_keymap_lookup() 2021-05-26 09:13:58 +02:00
Daniel Eklöf
360946917c
input: regression test for escape sequence generated for ctrl+shift+tab 2021-05-26 09:13:58 +02:00
Daniel Eklöf
51f7599e91
input: keymap_lookup: remove unused argument ‘seat’ 2021-05-26 09:13:58 +02:00
Daniel Eklöf
fbb809af3b
changelog: fixed mod+shift+tab regression 2021-05-26 09:13:58 +02:00
Daniel Eklöf
b5fb4a634b
keymap: iso_left_tab: we no longer “consume” shift when matching
Thus, the modifier list needs to include MOD_SHIFT, or we wont match
anything, causing us to hit the last entry, \E[Z.

Closes #547
2021-05-26 09:13:58 +02:00
Craig Barnes
f14b294dcc vt: remove action_utf8_print(term, 0) calls from UTF-8 state handlers
These calls appear to be left over from a previous refactoring of the
code. Calling this function with `wc == 0` is a no-op.
2021-05-25 21:45:55 +01:00
Craig Barnes
14a55de4e7 vt: remove partial support for 8-bit C1 control chars
These are part of the "anywhere" state in Paul Flo Williams' VT parser
state diagram[1]. That means that they should be accepted *anywhere* in
a byte sequence, including in the middle of other sequences or even in
the middle of a multi-byte UTF-8 sequence. Adhering to this requirement
makes them incompatible with the use of UTF-8 as a universal encoding.

Not adhering to the aforementioned requirement by making a special case
for UTF-8 sequences may seem tempting, but it's much more at odds with
the relevant standards[2] than it appears on the surface. UTF-8 is not
an "8-bit code", at least not according to the parlance of ECMA-43, nor
does it map the C1 control range in a compatible way.

[1]: https://vt100.net/emu/dec_ansi_parser
[2]: ECMA-35, ECMA-43, ECMA-48
2021-05-25 21:37:38 +01:00
Daniel Eklöf
6761d50ba5
pkgbuild: bump fcft requirement to 2.4.0 2021-05-25 19:01:06 +02:00
Craig Barnes
3eaf6ead2c Merge branch 'ctrl-c-cancel' 2021-05-25 17:03:26 +01:00
Craig Barnes
6eb6668c3c config: bind ctrl+c to "cancel" in search/url mode by default
Closes #544
2021-05-25 16:51:07 +01:00
Daniel Eklöf
37db94078f
Merge branch 'handle-display-roundtrip-failure'
Closes #542
2021-05-25 17:50:29 +02:00
Daniel Eklöf
c3c2ff7398
wayland: fdm callback: check return value of wl_display_dispatch_pending()
Since it’s inside a while-loop, we’d better handle failures, or we
risk getting stuck.
2021-05-25 17:50:17 +02:00
Daniel Eklöf
7bdecaae3b
wayland: roundtrip: log error and abort when wl_display_roundtrip() fails
ayl_roundtrip() has the following code:

    wl_display_roundtrip(wayl->display);

    while (wl_display_prepare_read(wayl->display) != 0)
        wl_display_dispatch_pending(wayl->display);
    wayl_flush(wayl);

If the first wl_display_roundtrip() fails, for example because the
Wayland socket has been closed, we may get stuck in the while-loop.

This happens if the read queue isn’t empty, in which case
wl_display_prepare_read() will return -1 and we’ll continue trying to
dispatch the pending events forever, never succeeding since the socket
is gone.

Closes #542
2021-05-25 17:50:17 +02:00
Craig Barnes
361fb74a8f doc: foot.ini: fix default key combos for "cursor-right-word" action 2021-05-24 21:34:51 +01:00
Daniel Eklöf
05160e61c5
readme: add link to IRC logs 2021-05-24 19:07:53 +02:00
Daniel Eklöf
e335d57bc7
Merge branch 'reflow-osc8-performance' 2021-05-23 10:30:45 +02:00
Daniel Eklöf
9a849b25cc
grid: reflow: uri-ranges: avoid looping URI ranges when reflowing
Since we know the following:

* URI ranges are sorted
* URI coordinates are unique
* URI ranges don’t cross rows

We can optimize URI range reflowing by:

* Checking if the *first* URI range’s start coordinate is on the
  current column. If so, keep a pointer to it.
* Use this pointer as source when instantiating the reflowed URI range
* If we already have a non-NULL range pointer, check its end
  coordinate instead.
* If it matches, close the *last* URI range we inserted on the new
  row, and free/remove the range from the old row.
* When line breaking, we only need to check if the *last* URI range is
  unclosed.
2021-05-23 10:29:45 +02:00
Daniel Eklöf
25d43bd4c3
grid: add grid_row_uri_range_destroy() 2021-05-23 10:29:44 +02:00
Daniel Eklöf
1868fa27e4
term: osc8_close: debug: assert all URI coordinates are unique 2021-05-23 10:29:32 +02:00
Daniel Eklöf
8c67817676
Merge branch 'foot_option_correction' 2021-05-22 20:37:41 +02:00
Clayton Craft
dade079576
foot.ini: use correct name for command-focused param
This expects a hyphen, not underscore, in the option name:

err: config.c:892: /home/user/.config/foot/foot.ini:34: [bell]: command_focused: invalid key
2021-05-22 10:53:09 -07:00
Daniel Eklöf
e37a6db19c
Merge branch 'sort-osc8-ranges' 2021-05-22 18:19:53 +02:00
Daniel Eklöf
7272a5469e
grid: row_add_uri_range: ensure the URIs are sorted 2021-05-22 18:16:54 +02:00
Daniel Eklöf
32dc373f1c
Merge branch 'dont-allow-overlapping-urls' 2021-05-22 18:16:07 +02:00
Daniel Eklöf
a9e8ba0932
url-mode: codespell 2021-05-22 17:08:14 +02:00
Daniel Eklöf
5605eb9040
url-mode: remove overlapping URLs, not just duplicates
echo -e '\e]8;;https://www.foo.bar\e\\https://www.foo\e]8;;\e\\.bar'

will produce an OSC-8 URL (https://www.foo) that is slightly shorter
than the auto-detected one (https://www.foo.bar).

This produces strange results in URL mode. For example, if
url.osc8-underline=always, the OSC8 underline will be removed when
url-mode is exited.

This patch changes the behavior so that auto-detected URLs that
overlap OSC-8 URLs are removed.

Note that OSC-8 URLs cannot overlap with each other, and that
auto-detected URLs also cannot overlap with each other.
2021-05-22 16:42:43 +02:00
Daniel Eklöf
458dd66135
Merge branch 'configurable-protocols-to-match-in-url-mode'
Closes #531
2021-05-22 14:51:15 +02:00
Daniel Eklöf
121ea39942
config: url.protocols: make it comma separated, for consistency 2021-05-22 14:50:47 +02:00
Daniel Eklöf
53516aceec
config: add url.protocols
This makes the protocols recognized by auto-detected URLs
configurable.

Closes #531
2021-05-22 14:50:47 +02:00
Daniel Eklöf
0f483d65ce
config: move url-mode related options to a dedicated section, ‘url’ 2021-05-22 14:50:47 +02:00
Daniel Eklöf
28d27f49bf
Merge branch 'underline-cursor-thickness'
Closes #524
2021-05-22 14:49:42 +02:00
Daniel Eklöf
1b5c849994
config: add cursor.underline-thickness
Works in pretty much the same way as ‘beam-thickness’, except that the
default value is “the font’s underline thickness”.

This means, that when unset, the cursor underline thickness scales
with the font size.

But, when explicitly set, either to a point size value, or a pixel
size, it remains fixed at that size.

Closes #524
2021-05-22 14:49:25 +02:00
Daniel Eklöf
af428d544f
Merge branch 'fdm-always-check-for-signals'
Closes #534
2021-05-22 14:47:44 +02:00
Daniel Eklöf
890dbc49cf
fdm: always check for signals after epoll_pwait(), not only on EINTR
This fixes an issue where we, at least on FreeBSD, sometimes get stuck
in epoll_pwait() after the shell has exited.

It turned out to be because the SIGCHLD signal was delivered at the
same time FDs were made readable/writeable. I.e. epoll_pwait()
returned a non-zero value even though it should have been interrupted
by the SIGCHLD.

To avoid having to search the entire signal array *every time*
epoll_pwait() returns, add a flag that is set in the signal
handler. This tells the FDM to scan the signal array after returning
from epoll_pwait().
2021-05-21 20:00:45 +02:00
Daniel Eklöf
b75bd6507a
notifications: use \e[22m to disable bold
\e[21m was previously used to disable bold. That changed a while ago,
to align foot with the majority of other terminal emulators.

\e[22m now disables both bold and dim.

When this change was done, the user notifications were not updated,
meaning the ‘message’ part was always in bold. This was never the
intended behavior.
2021-05-20 17:51:04 +02:00
Daniel Eklöf
ebc0bc83e0
Merge branch 'irc-update' 2021-05-20 07:46:03 +02:00
Daniel Eklöf
ac33f24b02
readme: remove my name from the IRC details 2021-05-20 07:45:21 +02:00
Craig Barnes
18364fd547 readme/doc: update details for IRC channel 2021-05-19 22:30:08 +01:00
Craig Barnes
74f740c975 vt: limit maximum value of params in vt_param_get()
So that the value is clamped to the range [0, 0x7fffffff] and retains
the same value, regardless of whether it's interpreted as a signed or
unsigned integer.

Closes #522
2021-05-17 18:15:34 +01:00
Daniel Eklöf
9fe278388b
render: stop spamming “resize” INFO logs
It _may_ be acceptable in e.g. tiling WMs, where windows are seldom
resized interactively.

But in a stacking WM where the typical way of resizing windows is by
interactive resizes, this spams way too much.
2021-05-17 19:11:56 +02:00
Daniel Eklöf
09eefabf33
grid: disable timing of resize operations 2021-05-17 19:04:50 +02:00
Daniel Eklöf
3da8dc123f
Merge branch 'search-refactor-extend-word'
Closes #421
2021-05-17 18:20:12 +02:00
Daniel Eklöf
48cc9596f1
changelog: ctrl+w can now be used across lines 2021-05-17 18:19:55 +02:00