kitty/docs
Jesse Miller e8785ad21b Fix input_delay painting twice and using more CPU than input_delay 0
A large write was scheduled on two clocks. The I/O thread woke the main
loop once the previous wake was input_delay old. The parser then refused
a chunk of at least 1KB until input_delay had passed since its first
byte, and armed a timer for the rest. That first turn still painted:
repaint_delay only skips a paint when nothing was parsed and the last
paint is recent. The timer turn parsed the bytes and painted again right
away, because a turn that parsed input ignores repaint_delay. With both
delays at 1ms this was two trips, and often two paints, per large write.
input_delay 0 never holds, so it did the work once and used less CPU.

The I/O thread now asks the parser for one deadline, new_input_at +
input_delay, and sleeps until then. A chunk under 1KB still wakes
immediately, at most once per input_delay. A buffer within 16KB of full
wakes immediately, which is when the parser already refuses to hold.
If a frame callback or another event wakes the main loop while bytes are
held, render returns without painting. The hold timer is already armed.
A thumbnail still paints. A child that exits is taken off the poll set,
so the hold can no longer see it. The main thread is woken when that
child is queued and flush-parses its final output.

A signal stays latched until that wake. signalfd is emptied on the first
poll, so a later poll cannot see the same signal. Without the latch, a
signal that arrived inside the delay was dropped when the next poll had
no parser deadline.

A scanned tail left in the buffer has its timestamp cleared. Those bytes
were already looked at. They are not input waiting out input_delay.
Treating a zero timestamp as ready made every later wake skip the delay.
If monotonic() returns 0 at startup, the commit stores 1, so 0 stays the
empty timestamp and a real chunk still gets a deadline.
2026-10-10 13:38:38 -06:00
..
_static Cleanup previous PR 2026-10-09 20:41:46 +05:30
_templates
kittens Fix #10603 2026-10-05 04:16:54 +05:30
screenshots Add explicit edge resizing for Splits and preserve resize sessions 2026-10-09 19:54:02 +08:00
actions.rst
basic.rst Fix #10627 2026-10-10 10:05:17 +05:30
binary.rst
build.rst Correct the documentation dependency install command 2026-10-06 16:04:16 +05:00
changelog.rst Fix input_delay painting twice and using more CPU than input_delay 0 2026-10-10 13:38:38 -06:00
clipboard.rst clipboard protocol: Specify handling of invalid base64 data 2026-08-25 10:12:25 +05:30
color-stack.rst Color control protocol: Respond to unknown field names safely using base64 encoding 2026-09-01 21:20:04 +05:30
conf.py ... 2026-09-04 06:35:44 +05:30
conf.rst Implement auto reload of config 2026-04-16 14:41:29 +05:30
custom-shaders.rst Custom shaders: Query shader source with a parser instead of regexes 2026-10-10 11:04:08 +05:30
deccara.rst
desktop-notifications.rst
dnd-protocol.rst Add a note about text/uri-list lifetime 2026-09-02 10:14:32 +05:30
extract-rst-targets.py autoformat 2026-08-05 05:32:56 +05:30
faq.rst Switch from sphinx-inline-tabs to sphinx-design 2026-08-09 14:31:33 +05:30
file-transfer-protocol.rst
glossary.rst Update changelog 2026-08-18 08:04:48 +05:30
graphics-protocol.rst Graphics protocol: Fix file descriptor leak that can be triggered by malicious clients 2026-09-14 21:03:15 +05:30
index.rst Switch from sphinx-inline-tabs to sphinx-design 2026-08-09 14:31:33 +05:30
installer.sh Also use diskutil in a couple more scripts 2026-09-24 09:32:05 +05:30
integrations.rst awrit has been abandoned replace with terminal-browser 2026-08-28 21:42:53 +05:30
intro_vid.rst Cleanup previous PR 2026-10-09 20:41:46 +05:30
invocation.rst
keyboard-protocol.rst Add additional implementations of the keyboard protocol 2026-09-14 16:30:58 -05:00
kittens_intro.rst Docs for the dnd kitten 2026-05-06 08:12:00 +05:30
launch.rst Add support for docked windows 2026-10-01 15:45:44 +05:30
layouts.rst Cleanup previous PR 2026-10-09 19:51:38 +05:30
Makefile Fix #10577 2026-10-01 17:23:37 +05:30
mapping.rst Use launch in the remote control example 2026-10-06 16:04:16 +05:00
marks.rst
misc-protocol.rst
multiple-cursors-protocol.rst
notifications.py autoformat 2026-08-05 05:32:56 +05:30
open_actions.rst Use binary XDG shared MIME database for mimetype lookups 2026-10-06 08:27:55 +05:30
overview.rst Drag and drop: Fix issues in tab hover switching and insertion 2026-09-26 15:50:52 +05:30
performance.rst Switch to perf for profiling from gperftools 2026-08-16 11:24:41 +05:30
pipe.rst
pointer-shapes.rst
press-mentions.rst
protocol-extensions.rst
quake-screenshots.rst
quickstart.rst
rc_protocol.rst
remote-control.rst
requirements.txt Switch from sphinx-inline-tabs to sphinx-design 2026-08-09 14:31:33 +05:30
sessions.rst Fix #10627 2026-10-10 10:05:17 +05:30
shell-integration.rst Fix doubled words in docs and a test comment 2026-08-22 23:10:54 +03:00
support.html
support.rst
text-sizing-protocol.rst Cleanup previous PR and make VS15 on explicit width cell behavior consistent with VS16 2026-09-18 22:59:19 +05:30
underlines.rst
unscroll.rst
wide-gamut-colors.rst