Add a benchmark stream containing 262,144 distinct base-plus-combining-mark cells per repetition so TextCache collection cost remains visible instead of collapsing into cache hits.
Co-Authored-By: Claude <noreply@anthropic.com>
Move the periodic collection check to PREPARE_FOR_DRAW_TEXT so ordinary and fixed-width text share one safe integration point, while tab handling no longer initiates collection.
Reset the additions counter only after the live-cell remap completes successfully.
Co-Authored-By: Claude <noreply@anthropic.com>
The TextCache interns every unique multi-codepoint cell text for the
lifetime of the window with no eviction, so a stream of unique texts
(for example random combining mark sequences) grows memory without
bound, several hundred MB/hour at moderate throughput.
Mirror the existing hyperlink pool garbage collection: every 8192
newly interned entries, steal the cache contents and have the Screen
remap the index in every live cell (history buffer, main and alt line
buffers, paused rendering snapshot and overlay line), re-interning
only entries still referenced by some cell. Entries whose last
reference scrolled out of the history buffer are freed.
See #10249
Co-Authored-By: Claude <noreply@anthropic.com>
When a kitty window regains text-input focus (e.g. switching back to a
workspace in sway, unminimizing, or unlocking the screen), the
zwp_text_input_v3::enter event is fired. However, text_input_enter()
only called enable + set_content_type without restoring the cursor
rectangle. If the compositor does not re-send wl_keyboard.enter at the
same time, kitty never updates the IME position, causing the popup to
appear at the top-left corner.
Restore the last known cursor rectangle in text_input_enter() so the
IME popup immediately appears at the correct position.
If smooth scrolling has reached its target, scroll_animation_tick()
clears the timer ID in the animation object. However, the timer
was not removed, which resulted in the timers potentially accumulating
and preventing the creation of new timers eventually. This caused smooth
scrolling to stop working in the terminal.
* Switches to "positional notation" to fix the bug.
* Consolidates `encode_hint` and `generate_prefix_free_hint` into `encode_hint`.
* Moves prefix_free_hints.go to hints_generator.go; `encode_hint` and `decode_hint` were moved here too.
* The "prefix-free" logic was made 0-index based instead of 1-index based for two reasons:
1. To simplify 1-off discrepancies.
2. To keep backwards compatibility with the old usage of `encode_hint`.
* Slight perfomance improvement added by reusing the runt-to-index map instead of rebuilding for each call to `decode_hint`.
* Unit tests added; for all new logic and old affected logic.
Fixes#10231
Allow the first mouse click on an inactive Cocoa OS window to be delivered to kitty instead of only activating the window.
Make the matching kitty-internal behavior consistent by forwarding clicks that switch focus to another kitty window in the currently focused OS window. This lets the same first click both focus the target kitty window and perform the click action, including forwarding to mouse-tracking applications.