Commit graph

4328 commits

Author SHA1 Message Date
Daniel Eklöf
dde31ffaf9
doc: foot.1: add TERMINFO section 2021-06-02 08:09:52 +02:00
Daniel Eklöf
f74c5fa9f0
Merge branch 'pua-double-width' 2021-06-01 17:51:25 +02:00
Daniel Eklöf
4c954be7a6
config: add boolean option tweak.pua-double-width
When enabled, PUA (Private Usage Area) codepoints are always treated
as double-width glyphs, regardless of the actual glyph width.

Requires allow-overflowing-double-width-glyphs=yes
2021-06-01 17:51:09 +02:00
Daniel Eklöf
d458d46f81
Merge branch 'selection-recognizes-hard-linebreaks'
Closes #565
2021-06-01 17:50:24 +02:00
Daniel Eklöf
f0041882f1
selection: pay attention to hard linebreaks when search for word boundaries
Double-clicking on a word in the left or right margin, would line-wrap
the selection if there was a non-empty cell in the corresponding
right/left margin on the prev/next line. Regardless of whether there
was a hard linebreak or not.

Script to reprouce:

  !/bin/bash

  cols=$(tput cols)
  printf "%*coo\nbar\n" $((${cols} - 2)) f

Run, then double click either “foo” or “bar”. Neither should select
the other part.

Closes #565
2021-05-31 17:15:20 +02:00
Daniel Eklöf
d5ff8c5f6f
Merge branch 'environment-docs'
Closes #556
2021-05-30 10:21:44 +02:00
Daniel Eklöf
4e3fdaa8f2
changelog: add bug ref to ‘environment section added to foot/footclient’ 2021-05-30 10:21:24 +02:00
Craig Barnes
d08096b201
doc: add ENVIRONMENT section to foot(1) and footclient(1) man pages
Closes #556
2021-05-30 10:20:48 +02:00
Daniel Eklöf
23e6a0a0ee
Merge branch 'include-directive'
Closes #555
2021-05-30 10:01:15 +02:00
Daniel Eklöf
9055d3d921
config: add ‘include’ directive
This allows you to include sub-configurations. For example, theme
files.

The ‘include’ directive is a top-level keyword. I.e. it cannot be used
inside sections.

* The included file must be specified with an absolute path
* The included file is parsed in its own scope
* Nested includes are allowed
* Multiple include directives are allowed

Closes #555
2021-05-28 17:44:13 +02:00
Daniel Eklöf
8262c1f0c2
Merge branch 'add-window-title-template-parameter' 2021-05-27 12:13:18 +02:00
Daniel Eklöf
f1d75a1e1f
notify: add ${window-title} 2021-05-27 12:11:47 +02:00
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