Commit graph

3051 commits

Author SHA1 Message Date
Daniel Eklöf
0beed9fcf6
Merge branch 'base64-optimize' 2020-11-29 11:17:50 +01:00
Craig Barnes
8d568143da base64: optimize error checking in base64_decode() 2020-11-29 07:19:58 +00:00
Daniel Eklöf
c213ee90f1
keymap: add ‘CSI 27;<mod>;27~’ escapes for Esc with modifiers 2020-11-28 11:50:32 +01:00
Daniel Eklöf
016c703b3d
doc: foot.1: add IRC channel 2020-11-27 22:39:33 +01:00
Daniel Eklöf
cf1c92eae5
readme: better link to freenode 2020-11-27 19:48:40 +01:00
Daniel Eklöf
632dda93d3
readme: rename ‘IRC, social media’ -> ‘Contact’ 2020-11-27 19:06:41 +01:00
Daniel Eklöf
f6dcb88771
readme: irc: add channel and my username 2020-11-27 18:54:18 +01:00
Daniel Eklöf
abe6a4f212
Merge branch 'split-cursor-blink-state'
Closes #218
2020-11-27 17:14:16 +01:00
Daniel Eklöf
addc374655
main: tag fdm loop with likely() and unlikely() 2020-11-26 18:23:28 +01:00
Daniel Eklöf
15b35b7641
fdm: keep polling on EINTR 2020-11-26 18:23:01 +01:00
Daniel Eklöf
903a8eaf4a
doc: foot.5: minor highlighting fixes 2020-11-26 18:22:45 +01:00
Daniel Eklöf
4d9e5368a9
doc: foot.1: no need to say foot.ini twice 2020-11-26 18:22:22 +01:00
Daniel Eklöf
cb2f496269
term: split cursor blink state into two
There are two different escape sequences that can be used to set the
cursor blink state: ‘CSI ? 12 h/l’ and ‘CSI Ps SP q’.

Up until now, they both modified the same internal state in foot. This
meant you could enable a blinking cursor with e.g. ‘CSI ? 12 h’ and
then disable it with ‘CSI 2 SP q’.

Since the ‘CSI ? 12’ escapes are used in the civis/cnorm/cvvis
terminfo entries, applications often ended up disabling the blink
state on exit (typically be emitting ‘cnorm’), requiring users to
manually re-enable blinking.

By splitting the internal state into two separate states, we can
improve the situation.

The cursor will blink if at least one of the two have been enabled.

The setting in foot.ini sets the default state of the ‘CSI Ps SP q’
escape.

This means if the user has enabled blinking in the configuration, the
cursor will blink regardless of civis/cnorm/cvvis. Which probably is
what the user wants.

If the user has NOT enabled blinking, civis/cnorm/cvvis act as
intended: cvvis blink, civis and cnorm do not.

If an application overrides the cursor blink/style with ‘CSI Ps SP q’,
that will override the user’s setting in foot.ini. But most likely
that too is intended (for example, the user may have configured the
application to use a different cursor style). And, a well written
application will emit the ‘Se’ terminfo sequence on exit, which in
foot is defined to ‘CSI SP q’, which will reset both the style and
blink state to the user configured style/state.

Closes #218
2020-11-26 18:09:32 +01:00
Daniel Eklöf
360cc8e6de
term: remove read-only properties copied from the config
Use the config directly instead.
2020-11-26 18:08:28 +01:00
Daniel Eklöf
bb0b3ab122
changelog: update contributor list 2020-11-25 20:43:59 +01:00
Daniel Eklöf
d151d4bc50
Merge branch 'dont-reflow-alt-screen'
Closes #221
2020-11-25 20:33:56 +01:00
Daniel Eklöf
434c8e4121
grid: resize_without_reflow: don’t call min() on every loop iteration 2020-11-25 20:33:07 +01:00
Daniel Eklöf
9a498038d6
resize: don’t reflow text on alt screen
Alt screen applications normally reflow/readjust themselves on a
window resize.

When we do it too, the result is graphical glitches/flashes since our
re-flowed text is rendered in one frame, and the application re-flowed
text soon thereafter.

We can’t avoid rendering some kind of re-flowed frame, since we don’t
know when, or even if, the application will update itself. To avoid
glitches, we need to render, as closely as possible, what the
application itself will render shortly.

This is actually pretty simple; we just need to copy the visible
content over from the old grid to the new grid. We don’t bother with
text re-flow, but simply truncate long lines.

To simplify things, we simply cancel any active selection (since often
times, it will be corrupted anyway when the application redraws
itself).

Since we’re not reflowing text, there’s no need to translate e.g. the
cursor position - we just keep the current position (but bounded to
the new dimensions).

Fun thing: ‘less’ gets corrupted if we don’t leave the cursor at
the (new) bottom row. To handle this, we check if the cursor (before
resize) is at the bottom row, and if so, we move it to the new bottom
row.

Closes #221
2020-11-25 07:47:40 +01:00
Daniel Eklöf
c2f043f906
Merge branch 'wl_output'
Closes #219
2020-11-25 07:43:57 +01:00
Kenny Levinsen
ab6327da26 wayland: Use wl_output_release with wl_output v3
wl_output_release, the use of which was recently introduced, is not
available until wl_output interface version 3.

However, only wl_output version 2 was bound. This lead to protocol
errors when a display was disconnected, causing foot to terminate.

Instead, only use wl_output_release if wl_output version 3 is provided
and bound. Otherwise, just use wl_output_destroy.

Closes: https://codeberg.org/dnkl/foot/issues/219
2020-11-25 00:19:23 +01:00
Daniel Eklöf
519eb24282
Merge branch 'sixel-pgo' 2020-11-24 21:35:28 +01:00
Daniel Eklöf
c03a4f6ffb
pkgbuild: add --sixel to generate-alt-random-writes 2020-11-24 21:31:44 +01:00
Daniel Eklöf
7755af5bea
install: add --sixel to suggested command line for generate-alt-random-writes 2020-11-24 21:31:44 +01:00
Daniel Eklöf
d2f0b82bda
scripts: generate-alt-random-writes: add --sixel
When --sixel is specified, we generate random sixel images in the
‘normal’ screen, after exiting the alt screen.
2020-11-24 21:31:34 +01:00
Daniel Eklöf
22c354c8fd
term: place frequently accessed members first in term struct
To hopefully use the cache better.
2020-11-24 20:55:41 +01:00
Daniel Eklöf
309e30ba97
Merge branch 'increase-sixel-default-max-size' 2020-11-24 19:24:07 +01:00
Daniel Eklöf
ba8b15d675
sixel: change default max size to 10000x10000
It used to be the size of the window. This caused images to be cropped
when the application emitting them didn’t change the max size.
2020-11-23 20:10:55 +01:00
Daniel Eklöf
90edc09697
render: don’t call term_arm_blink_timer() from multiple threads
We call term_arm_blink_timer() from render_cell(), which runs in
multiple threads.

This caused multiple blink timer FDs to be created and registered with
the FDM, later causing read failures after one of those FDs had been
closed again.

This rarely happened under normal circumstances, but was easy to
trigger when the whole screen was full of blinking text.

As a small optimization, we don’t bother taking the lock if the timer
FD already is valid.

This is safe, because:

1) If the timer FD isn’t valid, we take the lock and then call
    term_arm_blink_timer(), which again checks if the FD is already
    valid.

2) The blink timer FD cannot be closed while we’re rendering cells. It
   is only disabled in the FDM callback, which cannot execute while
   we’re rendering.
2020-11-23 19:26:00 +01:00
Daniel Eklöf
275f97381d
sixel: fix crash when an explicit sixel size had a height less than 6 pixels 2020-11-23 19:22:40 +01:00
Daniel Eklöf
8eaa195990
foot/footclient: add short options to all command line options
e813883367 added “missing” short command
line options to footclient.

Except they weren’t missing; they were intentionally missing short
options and only supported long options.

This commit makes the new/missing short options “official”, by adding
documentation, zsh completions and including them in usage().
2020-11-23 19:19:19 +01:00
Daniel Eklöf
9ab1235b97
changelog: add issue ref to footclient -w/-W 2020-11-23 07:34:27 +01:00
Daniel Eklöf
a5f3aa1278
Merge branch 'footclient-w'
Closes #189.
2020-11-23 07:31:33 +01:00
Craig Barnes
b8fc2e19da client: add new "--window-size-*" options to docs and CHANGELOG.md 2020-11-22 18:52:51 +00:00
Craig Barnes
748f98e0c0 client: add "--window-size-pixels" and "--window-size-chars" options 2020-11-22 18:52:28 +00:00
Daniel Eklöf
10eda1faa5
Merge branch 'pgo'
Closes #107
2020-11-22 19:31:25 +01:00
Daniel Eklöf
46eb23adc0
pkgbuild: revert accidental update of version 2020-11-22 19:29:45 +01:00
Daniel Eklöf
24164101b3
install: minor tweaks to PGO instructions 2020-11-22 19:29:45 +01:00
Daniel Eklöf
c1eaea6f0e
changelog: update link to install instructions for PGO 2020-11-22 19:29:45 +01:00
Daniel Eklöf
6214cdeaf1
install: re-write release build instructions 2020-11-22 19:29:44 +01:00
Daniel Eklöf
af6d1aa522
install: re-write description of recommended flags, and add size comparison 2020-11-22 19:29:44 +01:00
Daniel Eklöf
e23ab4a7a3
pkgbuild: no need to run pgo input *that* many times 2020-11-22 19:29:44 +01:00
Daniel Eklöf
d3cee56a10
changelog: add note about PGO without Wayland 2020-11-22 19:29:44 +01:00
Daniel Eklöf
82a9097cc0
install: no need to run input *that* many times 2020-11-22 19:29:44 +01:00
Daniel Eklöf
daa8d129c1
pgo: feed VT data through fdm_ptmx(), not vt_from_slave()
fdm_ptmx(), the FDM callback handler for ptmx data, is just as much in
the hot path as vt_from_slave(). It is also slightly more complicated
than a read() followed by a call to vt_from_slave().

As a result, some benchmarks performed significantly worse in a
partial PGO build than in a full PGO build, since fdm_ptmx() wasn’t
PGO:d.

To be able to feed data through fdm_ptmx(), we need to set up the
delayed rendering timer FDs, configure the timeout values, and provide
a readable FD it can read the VT data from.

The latter is done with a memory FD. This ensures *all* VT data is
loaded into memory before we feed it to the parser.
2020-11-22 19:29:44 +01:00
Daniel Eklöf
ecaa3b4135
render: no need to call attrs_to_font(), we already have a font reference 2020-11-22 19:29:43 +01:00
Daniel Eklöf
cf398df62e
pgo: initialize (mouse) selection 2020-11-22 19:29:43 +01:00
Daniel Eklöf
4cd1d35c1e
pgo: initialize a dummy wayland backend
* Empty seat list
* Empty monitor list
* Add dummy terminal instance to terminal list
2020-11-22 19:29:43 +01:00
Daniel Eklöf
96db338262
scripts: generate-alt-random-writes: add unicode and multi-column chars 2020-11-22 19:29:43 +01:00
Daniel Eklöf
f75ff86fc0
install: add --attr-{bold,italic,underline} to generate-alt-random-writes 2020-11-22 19:29:43 +01:00
Daniel Eklöf
e60fd1e113
pkgbuild: add --attr-{bold,italic,underline} to generate-alt-random-writes 2020-11-22 19:29:43 +01:00