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.
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().
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.
* Split up source files into several static libraries: misc + vtlib
* Add a new executable, pgo, that links to vtlib
* pgo is kind of like a mock test:
- provides stub implementations of functions not present in vtlib
- sets up a dummy terminal instance
- calls vt_from_slave() with static (pre-generated) content