Commit graph

616 commits

Author SHA1 Message Date
Daniel Eklöf
fbb809af3b
changelog: fixed mod+shift+tab regression 2021-05-26 09:13:58 +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
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
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
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
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
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
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
48cc9596f1
changelog: ctrl+w can now be used across lines 2021-05-17 18:19:55 +02:00
Daniel Eklöf
e415f85829
search: find_next(): proper check for scrollback wrap around
Besides disallowing matches that crosses the scrollback wrap-around,
this also fixes a crash when the trying to search beyond the last
output, when the scrollback history hasn’t yet been completely filled.
2021-05-17 18:14:09 +02:00
Daniel Eklöf
e7c01f3e52
changelog: fonts sometimes not being reloaded with the correct scaling factor 2021-05-17 17:55:49 +02:00
Daniel Eklöf
e0f1a4ae33
sixel: don’t *ever* shrink image below its SRA size
If the image was accompanied with a “Set Raster Attributes” (SRA)
command, make sure we *never* shrink the image below the size
specified in the SRA.

Images are normally shrunk when their bottom rows are fully
transparent. This enables sixels that aren’t a multiple of 6 to be
emitted, without also emitting an SRA command.

But if there *is* an SRA command, obey it.

Verified against XTerm-367
2021-05-16 11:00:32 +02:00
Daniel Eklöf
8211484185
changeloge: xdg-activation support 2021-05-14 14:22:43 +02:00
Daniel Eklöf
2ac8509c82
render: force underlines to be visible
In some cases, the underline position (typically provided by the font,
mind you), end up below the cell, making it visible.

Note that below the cell here means below the line. I.e. the font
provided underline position is below the font provided line height...

Oh well.

Doing this in foot rather than fcft, since other applications
typically don’t have to clip the rendered text.

Closes #503
2021-05-12 20:10:04 +02:00
Daniel Eklöf
29776dbd1f
quirk: remove plasma/kwin quirk
Older version of Plasma/KWin had an issue where buffer damage recorded
before the buffer was attached were ignored. This appears to have been
fixed now.
2021-05-12 20:08:40 +02:00
Daniel Eklöf
07d0acbabf
changelog: improved performance when double buffering 2021-05-12 20:07:18 +02:00
Daniel Eklöf
aada44bc7e
changelog: sixel assertion hit when a sixel fills the scrollback 2021-05-08 20:29:35 +02:00
Daniel Eklöf
bfd3eb47ec
term: reset: fix reset of the VT struct
1. Free buffers and strings
2. memset() the vt struct
3. re-initialize members that must not be zero

We _could_ replace the memset() with explicit zeroing of all the
members. It’s just that there’s a lot of arrays, so this is much
easier.

Closes #495
2021-05-08 20:27:20 +02:00
Ryan Farley
3b089b4203 configure full color palette in foot.ini
Allow the use of numeric keys in [colors] to configure the full set of
256 colors in the palette. Fixes #489
2021-05-08 06:40:00 -05:00
Daniel Eklöf
63572e4223
Merge branch 'bell-enhancement' 2021-05-07 16:47:53 +02:00
Ryan Farley
4c73172ce5 update changelog 2021-05-07 04:49:34 -05:00
Daniel Eklöf
96ae2d2bd7
meson: require fcft >= 2.4 2021-05-07 11:31:33 +02:00
Daniel Eklöf
a720188b42
config: fix color cube generation
Closes #479
2021-05-06 12:39:30 +02:00
Daniel Eklöf
9e5d740422
box-drawing: add Unicode 13 U+1FB70 - U+1FB8B
Part of #471
2021-05-04 10:47:36 +02:00
Daniel Eklöf
b4c99f873f
render: only apply alpha when we’re using the default bg for background
In all other cases, alpha is disabled. This includes:

* Palette- or RGB-colors matching the default background color
* When any kind of reverse video is enabled (e.g. DECSCNM, or ANSI
  reverse)
2021-05-04 10:46:16 +02:00
Daniel Eklöf
da923100ca
main/client: change exit code
* foot exits with -26/230
* footclient exits with -36/220

This is to give each application a range of exit codes. Currently
unused, but we may want to change this in the future.
2021-05-04 10:41:22 +02:00
Daniel Eklöf
a1b41bd186
foot/footclient: use a custom exit code when foot/footclient fail to run
Normally, foot and footclient uses the exit code from the client
application (i.e. the shell).

However, foot (or footclient) itself may fail to run; if run outside
of a Wayland session, or no fonts are installed, or the client
application/shell cannot be found (“foot lsdjfldsjf”) etc.

Up until now, there has been no way to differentiate these kind of
failures from the client application exiting with code 1.

This patch changes foot’s failure exit code to -27/229, and
footclient’s to -28/228. Note that footclient will exit with foot’s
-27/229 if footclient ran successfully, but the foot server failed to
instantiate a new window.

Closes #466.
2021-05-04 10:40:38 +02:00
Daniel Eklöf
7ce767ab87
config: add ‘beam-thickness’ option
* Rename cursor.style value ‘bar’ to ‘beam’. ‘bar’ remains recognized,
  but should eventually be deprecated and then removed.
* Add ‘cursor.beam-thickness’ option, a pt-or-px value specifying the
  thickness of the beam cursor. Defaults to 1.5pt.
* Rename (and export) pt_or_px_as_pixels() to
  term_pt_or_px_as_pixels()
* Change term_pt_or_px_as_pixels() to round point values instead of
  truncating them.
2021-04-30 20:36:16 +02:00
Craig Barnes
f95d7d4684 csi: add support for DECSET 2026, as an alternative to BSU/ESU sequences
See: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/2#note_847720
2021-04-25 18:35:46 +01:00
Daniel Eklöf
886160ba89
render: modify background color for highlighted text when fg == bg
When rendering a selected/highlighted cell where the foreground and
background colors are the same, invert the background color to make
the selected text legible.

Closes #455
2021-04-24 10:43:20 +02:00
Daniel Eklöf
1f807c6336
render: do render concealed text when it’s highlighted 2021-04-23 21:27:32 +02:00
Daniel Eklöf
033e1bd6ae
changelog: generate-alt-random-writes.py --sixel fixes 2021-04-22 11:26:59 +02:00
Daniel Eklöf
4044b6fa99
Merge branch 'releases/1.7' 2021-04-18 20:16:48 +02:00
Daniel Eklöf
7e2e9d4de8
changelog: prepare for 1.7.2 2021-04-18 20:12:26 +02:00
Daniel Eklöf
2f8ee9e61d
changelog: add cglogic to ‘contributors’ 2021-04-18 20:12:02 +02:00
Daniel Eklöf
b8f2c3b784
changelog: add cglogic to ‘contributors’ 2021-04-18 20:11:27 +02:00
Daniel Eklöf
1df48fcb33
config: bold-text-in-bright: add ‘palette-based’ as a special value
When ‘bold-text-in-bright’ is set ‘to palette-based’, colors matching
one of the 8 regular palette colors are brightened by using the
corresponding bright palette color.

Other colors, or all colors if ‘bold-text-in-bright’ is set to
‘yes|true’, are brightened by increasing the luminance.
2021-04-18 20:09:10 +02:00
Daniel Eklöf
11e8ff9dc5
render: brighten: use corresponding bright palette color for base 8 colors
When brightening one of the 8 base (“regular”) colors, use the
corresponding bright palette color, instead of increasing the
luminance.

Closes #449
2021-04-18 20:09:07 +02:00
Daniel Eklöf
8561fdb004
render: don’t let URL jump label sub-surfaces extend outside window geometry
We have no guarantee that sub-surfaces extending outside the window
geometry are rendered correctly (if at all).

For example, both Sway and River will render the window border on top
of the sub-surface.

Future versions of Sway may clip the sub-surface.

Since jump-labels are positioned slightly above, and to the left of
the URLs first character, having a label on either the top row, or on
the first column, will likely position it outside the window. This is
handled by simply setting x/y to 0 (or, to -margin, since the label
coordinate is later offsetted with the window margins).

Second, if the label is very long, it may extend outside the
window. This is very unusual for labels only showing the key, and not
the URL itself, but could happen in this case too, if e.g. the user
has configured double-width key characters.

This is handled by calculating its maximum width, and then truncating
the label.

Although very unlikely, it is possible for a label to also extend
outside the window’s vertical size. This could happen for very small
font sizes, where the label’s own margins are large, relative to the
font size. This case is currently not handled.

Closes #443
2021-04-18 20:08:41 +02:00
Daniel Eklöf
ce321e663e
config: add box-drawings-uses-font-glyphs=no|yes option
When disabled, we render box drawing characters ourselves. This is the
default.

When enabled, we instead use font glyphs. I.e. no special treatment.

Closes #430
2021-04-18 20:08:30 +02:00
Daniel Eklöf
2efd1016ce
render: draw underline cursor below text underline
This ensures the cursor is visible on cells where the text is
underlined.

Closes #415
2021-04-18 20:08:21 +02:00
Daniel Eklöf
0f792fa1ce
changelog: rewrite entry for OSC 17/117/19/119 2021-04-18 20:08:17 +02:00
Daniel Eklöf
c005c16504
changelog: auto_left_margin on cub1 only 2021-04-18 20:08:14 +02:00
Daniel Eklöf
d620a7b3b4
osc: implement OSC 17+19: change selection background/foreground colors
And of course, we also implement the corresponding reset sequences,
OSC 117+119.
2021-04-18 20:08:08 +02:00
Daniel Eklöf
660b771396
changelog: don’t use a hyphen between ‘OSC’ and the number 2021-04-18 20:08:02 +02:00
Daniel Eklöf
220fdc173e
changelog: tweak wording for URxvt’s XParseColor extension 2021-04-18 20:08:00 +02:00
Daniel Eklöf
1023f9a6e9
osc: add support for URxvt extension to include alpha in OSC-11
There are two variants, either using a ‘[percent]’ prefix for legacy
colors, or using ‘rgba:r/g/b/a’ instead of ‘rgb:r/g/b’.

Closes #436
2021-04-18 20:07:54 +02:00
Daniel Eklöf
f42e42246f
terminal: drain PTY when client terminates
This is done by:

* Not limiting the number of times we try to read from the PTY when
  we’ve have POLLHUP
* Not requiring the entire the previous read to have filled our
  buffer.
* Not erroring out on EIO.
2021-04-18 20:07:50 +02:00