Require ModeSymlink when checking the SymlinkToDir marker as it shares a
bit with the other-execute permission, use a single helper for the check,
avoid stat() on hidden entries that will be skipped and treat symlinks to
directories as directories in save file path completion.
Recognize the existing directory-symlink marker when scanning, filtering
and deciding which results can be selected. Resolve symlinks before file
filters and cover directory selection and filtered navigation.
Replace exported get_dir files atomically so paths returned by Get/Add
never briefly vanish while another worker re-exports the same key.
Don't panic in Get for a key folder missing from entries.json.
Propagate errors from unlocking, document the lock()/unlock() contract,
and fix the NewDiskCache lock error test which checked the wrong cache
Key presses update the IME position, but cursor motion caused by child
output, such as the echo of committed text, did not. The next composition
then started with a stale anchor and its candidate window briefly appeared
at the old position before jumping to the cursor.
Once an IME composition has been seen, push the cursor position to the IME
whenever it changes outside a composition in the active window of the
focused OS window. Nothing extra happens until an IME is used, and there is
no timer, so no feedback loop with GNOME's done events.
Closes#10644
Fix the input wake scheduling issues
- Never stall input the main loop was woken for: the main thread parses on
signal turns too and accepts any chunk the I/O thread woke it for, and a
chunk is only marked as woken from the state the wake was decided on.
- Keep held deadlines across a wake and drop the duplicate main loop timer
for held input, so a held chunk is scheduled once.
- Accept a small chunk that grows before the main thread parses it, rather
than refusing it and needing another round trip.
- Only skip painting an OS window when none of its windows parsed new input,
and find held windows without a per screen search.
- Query only parsers that were read or have pending input, without taking
the children lock, and wake for removed children only when the main thread
did not request the close.
- Share one classification of pending input between the parser and the
I/O thread.
A zero-length commit, from EOF or EAGAIN, no longer sets new_input_at.
The delay is measured from the first real byte.
vt_parser_input_wake() takes the caller's now. The I/O thread reads the
clock once per pass instead of once per child.
These three changes are worth doing because they shorten the wake
decision and remove a second opinion about what is small.
A child exit no longer wakes on its own. The next iteration queues the
child and wakes the main thread, so the old child_closed branch was a
second wake and a second copy of the rate-limit check.
vt_parser_commit_write() no longer returns whether the pending bytes
are small. Nothing read that bool, and the real check is
vt_parser_input_wake().
A small write that already used its early wake, and a signal, share one
rate-limit deadline. The sooner of that slot and a large chunk's own
deadline still wins.
input_held was one flag for the whole process. A background window
waiting out input_delay skipped cursor blink, drags, and swap retries
in every OS window. The flag now lives on the OS window of the held
child. Other windows keep painting. The flag is cleared at the start
of each parse, so a window paints again once its bytes are read.
A large chunk stayed large_ready until the parser cleared its stamp, so
every later read woke the main loop again. Record the stamp on wake and
ignore that chunk until the parser replaces it.
Bytes already scanned and left in the buffer were counted with the next
write. A short write after a large tail waited out input_delay, while
the parser would have taken it immediately. The stamp now stores the
buffer size at that moment, and only bytes committed after it count.
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.
- Anchor the IME cursor rectangle at the column the pre-edit text is
actually drawn at, which is shifted left of the cursor when the text
would not otherwise fit on the line, instead of at the cursor column.
- Store the IBus cursor geometry cache per input context rather than in
a function static, only update it after a successful send and reset it
whenever a new input context is created.
- Add a test and a changelog entry.
During IME composition kitty reported the cursor rectangle at the end
of the pre-edit text (overlay_line.cursor_x), so every keystroke that
grew the pre-edit moved the rectangle and the IME candidate window
jumped horizontally.
Report the start of the pre-edit text (overlay_line.xstart) instead,
which is stable for the whole composition, and only send position
updates when it changes. Also deduplicate IBus SetCursorLocation the
same way the Wayland text-input path already does.
Add a small Slang lexer and top level declaration parser to slang.py, and
SlangShaderQuery which runs the slangc preprocessor when an answer could
depend on it. Use it for:
- Detecting pointer_map(), so that comments, #if 0 blocks and calls no
longer count, macros are honored, and a pointer_map() that is not public
or does not return float2 is reported instead of failing obscurely. The
result is cached alongside the pipeline module, so a cached load does
not run slangc.
- Applying pipeline var directives, which now work for declarations
spanning multiple lines and match by name as documented.
- Parsing the builtin shaders, with identical results for all of them.
Also cleanup minor issues form previous PR
- Ignore pointer_map() in groups that only draw to part of the screen
- Share the pointer position conversion between glfw.c and mouse.c
- Pass POINTER_MAP_SIZE to the pipeline as a define instead of
duplicating it
- Do not free the pointer map render target on every pipeline reload
- Document what pointer_map() may depend on and when d.mouse_pos lines
up with the pointer
Times laying out and drawing the horizontal tab bar for every built-in
style with 10, 50 and 200 tabs. Use --compare-with to also time
kitty/tab_bar.py as it is at some git revision.
Laying out the tab bar draws each tab several times, so cache evaluated
title templates for the duration of a single update, unless the template
depends on the length available for the title. Also skip measuring the
overhang of truncated tabs once there is no free space left, as then it
cannot change the layout.
Leave custom draw_tab functions a cell of slack per truncated tab, as
their overhang may grow with the space they are given. Add fade style
tests and a shared helper for horizontal tab bar tests.
A shader that draws content away from where kitty put it, such as crt
curving the screen, makes clicks and selections land on the wrong cells,
since kitty maps the pointer to the unmodified cell grid. Up to several
columns near the edges with the bundled crt shader.
Shaders can now define pointer_map(pos, d), returning where the content
shown at pos actually is. kitty renders it into a 64x64 grid when the
pipeline or viewport size changes, reads it back once, and uses it to
move all pointer events. Only always active groups that draw to the
screen are used, since only they move content permanently.
The crt shader defines it, sharing its warp function with fragment_main().
Do not show subtitles by default and fix transcription errors in the
subtitle files: kitty.conf, MIME type, --hyperlink=auto, WeeChat,
switch windows, and use lowercase kitty consistently.
- Only restore entry sizes in the Splits layout resize mode was opened in;
otherwise fall back to the default reset rather than refusing to reset
- Do not take a snapshot lazily from already resized sizes when resize mode
was opened in another layout
- Running the resize kitten while its overlay is open replaces the overlay so
the new options take effect, keeping the original-size snapshot
- Newer edge statuses replace older local messages, and edge failures beep
- Switching strategy no longer discards a --fraction command-line override
- Compute divider room without deep copying the pair subtree
- Fractional resize in other layouts adopts the probed state instead of
replaying every step
- Parse in-band resize reports robustly: require the 48; prefix, accept
extra parameters and reject negative values instead of panicking
- Handle bracketed paste in parse_input_from_terminal with a dedicated
scan for the end of paste marker so pasted escape bytes are never lost
- Guard against NaN in scroll_by_pixels and scroll_to_absolute, clamp
negative absolute scroll targets, let infinite fractional scrolls clamp
and propagate overflow errors from PyLong_AsDouble
- Empty disk cache entries no longer claim offset 0 in the cache file and
defrag only moves entries actually written to disk
- Reject zero and too large block sizes in rsync signature headers
- Only replace the encryptor tag once it has been read successfully