Commit graph

20002 commits

Author SHA1 Message Date
Kovid Goyal
a1085a78c3
ask kitten: Fix clicks hitting the wrong choice when the dialog does not fit
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
The dialog was drawn by writing newlines and relying on the terminal to
wrap long lines, recording clickable ranges assuming nothing scrolled or
wrapped. When the content was taller than the window, the screen
scrolled and every clickable range was off by the scroll amount.

Now the full layout is computed up front, with clickable ranges relative
to it, and rows are drawn with absolute cursor positioning and line
wrapping disabled, so the terminal never scrolls or wraps. The boxed
choice layout is used only if it fits entirely, otherwise the compact
one is used, and if even that does not fit, the content is bottom
aligned so the choices remain visible. Choices too wide for the screen
are truncated with an ellipsis.

Also fix:
 - The hidden text placeholder not being clickable when it wraps over
   multiple lines, its clickable range going stale after a resize, and
   its range including one cell too many.
 - Compact choice ranges being computed by iterating over a map, putting
   them in random order when several choices share a line.
 - An empty box row or compact row being output when the first choice is
   wider than the screen.
 - truncate_at_space using a cell width as a byte offset, splitting
   multi-byte characters, and looping forever when a character is wider
   than the available width.

Closes #10883
2026-11-17 19:26:38 +05:30
Kovid Goyal
517f418f9c
Cleanup previous PR
Drop the redundant v2 prefix from the disk cache key, as the key format
already changed when the inode was added.

Render the file the cache key was computed from, so that retargeting a
symlink while rendering, even if it is restored before AddPath() checks
the key again, cannot store the preview of one file under the key of
another. Renderers that need the selected path, custom preview commands
and calibre, opt out via NeedsSelectedPath(). The selected path is also
used when the target has a different extension, as renderers may detect
the format from it.
2026-11-17 19:11:40 +05:30
Zhizhen He
bc7d4664d8 choose-files: Reject stale preview cache writes
Recheck the path key before updating the cache. Include the inode so a replacement with the same size and modification time gets a different key. Version the key to invalidate previously cached previews.

Retry once when a changed path still resolves to a regular file.
2026-11-17 20:47:47 +08:00
Kovid Goyal
24fdd01944
support for publishing from a version branch
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-11-17 03:42:35 +05:30
Kovid Goyal
86be6aa355
Bump version of dependency for CVE 2026-11-17 03:19:17 +05:30
Kovid Goyal
291af51dfa
Show bell indicator on the active tab when the OS window is unfocused
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
A bell in the active window was never marked as needing attention, even
when the OS window did not have keyboard focus, so the tab bar bell
symbol was not shown. Now a window needs attention unless it is both
active and in the focused OS window.

Since the active window can now need attention, also:
- Clear needs_attention when the OS window gains focus, as
  focus_changed() is a no-op if the window became active while the OS
  window was unfocused, which would leave the indicator stuck.
- Use the bell color for minimal borders of an active group needing
  attention, instead of the active color (or the fallback green when
  active_border_color is none).

Fixes #10880
2026-11-16 20:36:28 +05:30
Kovid Goyal
906627df8a
Fix issues with rendering of glyphs wider than their cell
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Reduce the allowance for cropping glyphs wider than their cell, rather
than rescaling them, to 2/10 of the cell width, since cropping removes
ink, and test that cropped glyphs fill their cell.

FreeType: Move combining marks with their base glyph when it is rescaled
and moved into its cell, so that they stay in place relative to it.

CoreText: Rescale glyphs individually, as with FreeType, so that a
combining mark wider than the cell does not cause its base glyph to be
shrunk. Measure the width of glyphs in whole pixels, as rasterized, as
with FreeType, so that both renderers make the same decision. Never crop
colored glyphs, as with FreeType.

concat_cells: Produce RGBA bytes for 8 bit sprites, as for 32 bit ones,
and handle empty cells.
2026-11-16 17:28:23 +05:30
Kovid Goyal
2e77ef3d4b
FreeType: Move rescaled glyphs right to eliminate left overhang
As with the CoreText renderer, a glyph that is rescaled to fit its cell is
moved so that its ink starts at the left edge of the cell, so that marks that
hang to the left of it, as in polytonic Greek capitals, are no longer cut off.
2026-11-16 17:09:52 +05:30
Kovid Goyal
fd795df1ff
CoreText: Fix glyphs slightly wider than their cell being rendered smaller
Port the overhang allowance from the FreeType renderer: a glyph wider than
its single cell by at most 2/9 of the cell width, with a minimum of 2px, is
cropped rather than rescaled. Previously any glyph whose right edge was more
than 1px past the cell was rescaled, shrinking glyphs such as the d with
caron of Cascadia Code and the texture healing alternates of Monaspace.
Widths are measured per glyph, as with FreeType, so that combining marks do
not cause their base glyph to be shrunk.

The left overhang of a glyph is now taken into account, and a glyph that is
rescaled is moved so that its ink starts at the left edge of the cell, so
that marks that hang to the left of it, as in polytonic Greek capitals, are
no longer cut off. Glyphs that extend past the right edge of the cell are
moved left as far as their left bearing allows, as with FreeType.

Also fix the tests for this to run on macOS: face_from_path() ignored the
font size on macOS and the tests treated pixels with only color bits set as
ink.

Fix concat_cells() for 32 bit sprites, broken since the SIMD compositing
change, which treated the 0xRRGGBBAA sprite pixels as RGBA bytes, producing
an opaque white image.
2026-11-16 17:06:39 +05:30
Pete Dietl
594c96f660
Fix glyphs slightly wider than their cell being rendered smaller
A glyph whose bitmap is wider than its cell is rendered again at a
smaller font size so that it fits, unless it is wider by no more than
two pixels, in which case it is cropped. That allowance is absolute, so
it covers less of the cell as the cell grows, and fonts with glyphs
that overhang their advance by design end up on the wrong side of it:
the texture healing alternates of Monaspace and 0xProto, or the d with
caron of Cascadia Code. Such a glyph is drawn visibly smaller than its
neighbors, at one font size and not at the next.

Make the allowance proportional to the cell width: 2/9 of the cell,
which is the 2px the rule was originally tuned for at the 9px cell of a
typical monospace font at 11pt and 96 dpi, with a minimum of 2px for
smaller cells. That keeps the widest Monaspace alternate, 14% wider
than its cell, at full size. A glyph that overhangs by more, such as a
Greek capital whose breathing mark and accent hang well outside the
cell, is still rescaled, since cropping would remove the marks.

Closes #10879
2026-11-16 14:58:42 +05:30
Kovid Goyal
d6c2ea1160
Request a main loop tick after state changes made from timers
Timers are dispatched outside the main loop tick, so state changed by
them was not rendered while the OS window was otherwise idle, only
catching up when some other event woke the loop. For example, a custom
tab bar refreshed from add_timer, or actions mapped to mouse clicks,
which are dispatched from a timer after click_interval.

Request a tick after every Python timer callback, after dispatching
pending clicks and when marking the tab bar dirty.

Closes #10878
2026-11-16 13:32:14 +05:30
Kovid Goyal
344e4d0913
Merge branch 'dependabot/github_actions/actions-459db3049e' of https://github.com/kovidgoyal/kitty 2026-11-16 11:29:15 +05:30
Kovid Goyal
383704f32b
Merge branch 'dependabot/go_modules/all-go-deps-ba200be5c4' of https://github.com/kovidgoyal/kitty 2026-11-16 11:29:05 +05:30
dependabot[bot]
c2fedfa922
Bump github/codeql-action from 4.39.1 to 4.39.3 in the actions group
Bumps the actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.39.1...v4.39.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-16 03:44:52 +00:00
dependabot[bot]
15c9444b3f
Bump the all-go-deps group with 3 updates
Bumps the all-go-deps group with 3 updates: [github.com/dlclark/regexp2/v2](https://github.com/dlclark/regexp2), [github.com/nwaples/rardecode/v2](https://github.com/nwaples/rardecode) and [golang.org/x/sys](https://github.com/golang/sys).


Updates `github.com/dlclark/regexp2/v2` from 2.12.0 to 2.13.0
- [Commits](https://github.com/dlclark/regexp2/compare/v2.12.0...v2.13.0)

Updates `github.com/nwaples/rardecode/v2` from 2.4.5 to 2.4.6
- [Commits](https://github.com/nwaples/rardecode/compare/v2.4.5...v2.4.6)

Updates `golang.org/x/sys` from 0.49.0 to 0.50.0
- [Commits](https://github.com/golang/sys/compare/v0.49.0...v0.50.0)

---
updated-dependencies:
- dependency-name: github.com/dlclark/regexp2/v2
  dependency-version: 2.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
- dependency-name: github.com/nwaples/rardecode/v2
  dependency-version: 2.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-go-deps
- dependency-name: golang.org/x/sys
  dependency-version: 0.50.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-16 03:43:01 +00:00
Kovid Goyal
ec28187f6f
Fix newly displayed images sometimes not being rendered until the next redraw
prepare_to_render_os_window() decided whether a window needs to be rendered
in layers before calling send_cell_data_to_gpu(), which is what updates the
graphics layers. So on the frame in which an image first becomes visible
grman_has_images() returned a stale false, the window was rendered without
the image, and if nothing else triggered a redraw (for example, the cursor
is hidden so not blinking) the image did not appear until some unrelated
event such as mouse movement.

Fixes #10875
2026-11-16 07:45:22 +05:30
Kovid Goyal
2b260d8d67
Wayland CSD: Re-render on keyboard focus changes
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
The focus state of the decorations comes only from keyboard enter/leave
events, but the decorations were only re-rendered on configure events and
title changes. So they showed a stale focus state whenever focus changed
without a following configure, for example, when switching between tabbed
windows in niri, which keeps all tabs activated.

Re-render the decorations on keyboard enter/leave, looking up the window
again after the focus callbacks have run, since they can close it.

Also:
- Ignore the activated state in the change detection, as focus is tracked
  separately, to avoid rendering twice per focus change.
- Never create decoration surfaces in ensure_csd_resources() for windows
  that should not be decorated, such as fullscreen windows. Title changes
  while fullscreen could previously create them from a stale state.
- Recreate the decoration surfaces when they are missing even if the
  window state is unchanged, otherwise the resize borders were not
  restored after leaving fullscreen with hide_window_decorations
  titlebar-only.

Based on the patch by Ole Jørgen Brønner.

Closes #10873
2026-11-15 20:06:45 +05:30
Kovid Goyal
dea5bd4c24
Update changelog
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-11-15 09:49:43 +05:30
Kovid Goyal
b692122f22
Allow selecting text drawn in the tab bar outside the tabs
Dragging the mouse over text drawn in the tab bar outside the tabs, such
as text a custom tab_bar.py draws below the tabs of a vertical tab bar,
selects it, and releasing the button copies it like a window selection
(primary selection, then copy_on_select). Clicks and double clicks on
empty space and presses on tabs behave as before.

Based on the draft in #10870, with these additions:

- Movement within drag_threshold selects nothing, so a slightly jittery
  double click on text still opens a new tab.
- A selection whose release was lost does not keep capturing the
  mouse: it is cancelled by a press outside the tab bar (which then goes
  to its normal target), by motion with no button held, by any press in
  the tab bar, and by the OS window losing focus.
- The pointer shape is reset after the press or release that starts or
  ends a selection, instead of being left as the drag shape.

Fixes #10869
Closes #10870
2026-11-15 09:32:37 +05:30
Kovid Goyal
3568f959f3
save_as_session: Show where the session will be saved in the path prompt
The prompt now shows the directory relative names are saved in, taking
--base-dir into account, and notes that the .kitty-session extension is
added automatically. File name completion in the prompt is now relative
to that directory instead of the cwd of the active window.

See discussion #10867
2026-11-15 09:16:57 +05:30
Kovid Goyal
87d06354dd
Custom shaders: Fix focus driven groups ending in the wrong state after hide/unhide
Shader animation events are accumulated per OS window and only consumed
when the window is next rendered. A focus-out followed by a focus-in with
no rendered frame in between, as happens when the window is hidden and
shown again, or a brief focus steal within one repaint interval, left both
bits pending. The state machine then treated them as simultaneous, so the
focus-out hard stop prevented os-window-focus-in groups from starting and
groups started by focus-out were turned on while focused.

Now a focus change replaces any pending opposite focus change, so only the
final focus state is reported. Genuinely simultaneous events, such as a
click that moves focus away, still give focus-out priority.

Closes #10871
2026-11-15 08:39:25 +05:30
Kovid Goyal
64a02b4061
Fix cursor underflow when VS15 narrows a wide char on the previous soft wrapped line
The VS15 branch of draw_combining_char unconditionally moved the cursor
back by the width removed from the char. When the char was on the
previous line (cursor at x=0 after a soft wrap) this wrapped cursor->x to
UINT_MAX leading to out of bounds reads and writes. Only move the cursor
when it is on the same line as the char. Also preserve the soft wrap
marker in the cells cleared by halve_multicell_width.
2026-11-15 08:16:13 +05:30
Kovid Goyal
8e5487e9d4
choose-files kitten: Limit the number of entries shown for zip archives
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Previews of tar and rar archives were already limited to 500 entries, but
zip archives listed every entry.
2026-11-14 12:19:17 +05:30
Kovid Goyal
4fa6709910
choose-files kitten: Sanitize untrusted text in the preview panel
File names, archive member names, symlink targets, error messages and
ebook metadata were written to the terminal unsanitized, allowing
crafted names to inject escape codes (e.g. OSC 52 to overwrite the
clipboard) merely by highlighting the entry.
2026-11-14 12:19:09 +05:30
Kovid Goyal
add52d9cf7
Cleanup previous PR
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Normalise the cwd passed to CompleteFiles once, so that a relative cwd,
such as a config directory from a relative XDG_CONFIG_HOME, no longer gets
joined onto itself twice. This also removes the second resolution pass
against cwd and the absolutize_path helper. Check for errors in the test
setup and test relative, ../ and ~/ prefixes against a custom cwd as well
as a relative cwd.
2026-11-14 08:29:17 +05:30
Kovid Goyal
2b47a83a0d
Merge branch 'pr-10863' 2026-11-14 08:27:24 +05:30
Kovid Goyal
d8f96a7d0a
Unicode input kitten: Fix searching by name not finding some characters
The word filter for control characters was applied to the record index
instead of the codepoint, dropping the words for ~160 characters.

Fixes #10862
2026-11-14 08:23:25 +05:30
Kovid Goyal
e537944ebf
Fix error message when configured editor is not found
Fixes #10865
2026-11-14 08:19:44 +05:30
Kovid Goyal
f8556bbf8d
Fix #10858 2026-11-14 08:16:53 +05:30
Kovid Goyal
c4dd943f72
Only render regular files as window logos/background images and time out image conversion
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
A program running in the terminal could use edit-in-kitty to set --logo=/dev/zero
which would cause the image converter to read an infinite stream, blocking the
kitty main loop and consuming unbounded memory.
2026-11-13 21:51:03 +05:30
Kovid Goyal
11cbfdce23
Allow resizing docks
Docks can now be resized in whole cells by dragging their inner border,
with the resize_window action and with kitten @ resize-window, where
wider or taller always means bigger whatever the edge of the dock. A
dock keeps at least one cell and grows only into the content it is
docked to, so the docks inside it are never shrunk. OS window docks do
not shrink the tab docks of any tab, and when dragged, the other tabs
are re-laid out once, at the end of the drag. Percentage sizes stay
percentages. The new size is stored in the DockSpec, so it is reported
by kitten @ ls and saved in sessions. Resetting window sizes does not
change docks, as they are not part of the layout.

Previously the inner border of a dock showed a resize pointer but
dragging it did nothing, or in the Tall layout moved a layout divider.

Fixes #10857
2026-11-13 19:44:03 +05:30
Kovid Goyal
3fe8677c4d
Cleanup previous PR
Do not track decoration touches that start an interactive move or resize,
the compositor takes the contact over and need not send its up event, which
left the contact active and caused the next decoration touch to be ignored.
Drop a stale tracked contact whenever a new down arrives with the same id,
wherever it lands. A titlebar button held down by one finger no longer
blocks moving or resizing windows with another.

Restore the old mouse behavior of hit testing titlebar buttons only by x, so
that a button is still activated when released after dragging the pointer
below the titlebar.

Update the input serials only for decoration touches that are handled,
including their up events. Share the titlebar commit code between the
pointer and touch paths, remove checks that can no longer fail, fix
indentation in decoration_surface() and add a changelog entry.
2026-11-13 19:44:02 +05:30
Cryolitia PukNgae
d370da8bdf
Wayland: Handle touch input on client-side decorations
Touch events on decoration surfaces are discarded, leaving the titlebar
buttons and interactive window moves and resizes unavailable on touch
screens.

Share decoration hit testing and button actions with the pointer path.
Track the decoration contact separately from application touch points,
use its down serial for move and resize requests, and activate a button
only when the same contact is released over it.

Clear the contact on cancellation, seat capability loss and surface
destruction, and clear it before invoking a close callback.
2026-11-13 19:44:02 +05:30
Kovid Goyal
760caa1f6a
Handle ConEmu OSC 9;9 cwd reporting and ignore other ConEmu OSC 9 sub-commands
OSC 9;9;path is now treated as a report of the current working directory,
like OSC 7, instead of popping up a desktop notification. Other ConEmu
numeric OSC 9 sub-commands (1-12) are ignored rather than shown as
notifications.
2026-11-13 19:44:02 +05:30
Kovid Goyal
dfed4dc311
Fix multiline chars being torn by resize and ED 22
Removing multicell chars cleared only their text and the is_multicell flag,
leaving their other multicell fields. Code that did not check is_multicell
then mistook the removed cells for parts of multicell chars, so chars were
placed after unrelated rows and rewrap copied unrelated lines below such a
cell as the lower rows of a multiline char, tearing chars. Now all the
multicell fields are cleared and rewrap checks is_multicell.

The marker that preserves a blank cursor line during a resize was assumed
to be at the start of the line, but rewrap can place it after the lower
rows of multiline chars from the lines above, so removing it changed the
char at the start of the line instead, tearing multiline chars there. Now
the marker is removed where it is, just before the cursor.

When moving the screen into the scrollback for ED 22, the number of lines
to move was computed from the visual lines, which are lines from the
scrollback when it is scrolled. So too many lines were moved, adding blank
lines to the scrollback, or too few, tearing multiline chars. Now the lines
of the screen are used.
2026-11-13 19:43:59 +05:30
Kovid Goyal
0f19d55463
Fix infinite loops when making space for chars next to multiline chars
When looking for space free of the lower rows of multiline chars, with the
cursor on the last line below the bottom margin, a linefeed does not move
the cursor, so move_cursor_past_multicell() looped forever. Now it makes
space at the end of the line in that case.

move_cursor_past_multicell() also removed only the multicell char under the
cursor, not other chars in the cells the char being drawn would occupy. So
a wide char, for example one widened by VS16 at the end of a line, could
overwrite the first cells of a multiline char, leaving fragments of it.
Inserting chars before such a fragment looped forever, as the end of the
fragment was computed from its width ignoring its scale, so the loop went
backwards. Now all multicell chars in those cells are removed, and the end
of a char is computed from its scale and width and is always after the
current cell.

Also a char widened at the end of the line that was moved to cells
overlapping its original cell had its second cell cleared.
2026-11-13 19:43:52 +05:30
Kovid Goyal
cfd2b23dca
Fix out of bounds accesses with partially scrolled off multiline chars
Scrolling down (CSI T) could cut off the lower rows of a scale > 1 text
sizing character at the bottom of the screen. Adding a combining char to
it then wrote past the end of the line buffer in add_combining_char and
rewrapping on resize read past the end of the line buffer in
copy_multiline_extra_lines.

Multiline chars that are cut off at the edge of the screen or of the
history buffer, by scrolling or by inserting lines, are partially
scrolled off and are rendered as such, so they are kept. Code walking the rows of a multiline char now only visits
the adjacent rows that actually continue the char, rather than trusting
the y and scale of a cell, so it stays in bounds and does not modify
unrelated cells for partial or torn chars.

Chars that would be torn, i.e. left with rows from unrelated lines
adjacent to their remaining part, are removed. This happens when
scrolling with margins, when a partial char is moved away from the edge
of the screen by scrolling or deleting lines, when inserting lines pushes
the lower rows of a char straddling the bottom margin out of the scroll
region, and when a partial char
cut off at the bottom is no longer at the bottom after a resize. Rewrap
drops partial chars, as it already did for chars with missing top rows,
placing cursors that were on them where the char would have been.

The checks for torn chars are skipped unless a multiline char has been
drawn in the screen, and chars cut off at the bottom of the screen,
which can only be created by scrolling down or inserting lines, are
tracked so that
linefeeds do not need to scan for them.

A hard reset now clears the alternate screen as well, so that the flag
tracking whether multiline chars have been used can be reset.

Also fix the lower rows of multiline chars being lost on rewrap when the
lines after the char were continuations that fit on its first row.
2026-11-13 10:43:13 +05:30
devangpratap
30e7f3512e Complete paths relative to the config directory correctly
CompleteFiles resolved the prefix with filepath.Abs, which uses the
process cwd, instead of the cwd it was given. For the completers that are
relative to the config directory, like kitty --session and launch
--watcher, a prefix such as sessions/ was looked up under the shell's cwd,
so completing inside a sub-directory of the config directory gave nothing,
or the contents of a same named directory in the shell's cwd. Resolve
relative prefixes against the given cwd instead.
2026-11-12 16:40:55 -05:00
Kovid Goyal
fdea442b70
Hyprland now support the XDG bell protocol
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-11-12 19:53:14 +05:30
Kovid Goyal
b9e7070cc8
dnd kitten: Fix failure to start in a non-writable directory
Create the temporary directory used for staging drops lazily, on the first
drop, instead of at startup, so the kitten works in directories that are not
writable when nothing is dropped into them.

Fixes #10855
2026-11-12 18:54:46 +05:30
Kovid Goyal
1eaecbcead
Ignore inapplicable CVE
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
2026-11-12 13:12:33 +05:30
Kovid Goyal
ae63e8e671
Update changelog 2026-11-12 13:06:30 +05:30
Kovid Goyal
bdd1e84346
Allow docking windows to the OS window with launch --type=os-window-dock
An OS window dock is shown in every tab of its OS window, below the tab
bar and outside the docks of the tab, and lives as long as the OS window.
It is a single window running a single program, which is kept in the
active tab: it is moved to the new active tab on every tab switch, by a
new C function that moves the window between tabs of an OS window
without recreating its GPU resources. Every tab reserves the space for
the OS window docks, so switching tabs does not resize any windows.

The docks are not closed with tabs and do not keep a tab open, stay in
their OS window when the tab containing them is moved to another OS
window, and are closed when the last other window in the OS window is
closed. They are listed as part of the active tab, and the dock entry of
every docked group in the output of kitten @ ls now has a scope of
window, tab or os-window. They are saved in sessions, once per OS window.

Fixes #10854
2026-11-12 12:47:48 +05:30
Kovid Goyal
65da47b611
More detail for on_quit events and a new on_cwd change event 2026-11-12 11:29:08 +05:30
Kovid Goyal
cb66ed55ca
Fix watcher calls being silently dropped during bursts of window changes
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Every on_resize and on_focus_change took its own 0s timer, so creating many
windows from a single callback filled the fixed size glfw timer table and
add_timer() returned 0, silently dropping the watcher calls. Now watcher
calls are queued and delivered in order behind a single pending timer, and
only when the window actually has a watcher for the event. Calls made during
delivery go to the next batch, preserving the recursion guard the timer
exists for.

Also fix add_timer() leaking a reference to the callback when the timer
could not be added.

Fixes #10853
2026-11-12 09:03:33 +05:30
Kovid Goyal
b261b08b7a
Keep the session of tabs and windows moved to another tab or OS window
A tab moved to another OS Window keeps its session, and new tabs and OS
Windows created for moved tabs and windows belong to the session of what
was moved. A window keeps its own session, which may be none, wherever it
is moved, so --add-to-session=! is respected; a window of no session
belongs to the session of the tab it is in.

Add Window.effective_session_name for the "window session, else its tab's
session" rule that was duplicated in five places, and use it in launch as
well, so --add-to-session=. and --cwd=current agree with
new_window_with_cwd. OS Windows created by launch --type=os-window or for
moved tabs and windows now also record their session.

Closes #10851
2026-11-12 08:51:54 +05:30
Kovid Goyal
a0ac36784f
Cleanup previous PR 2026-11-12 08:49:43 +05:30
Zhizhen He
c5e6bdf1fe
Preserve session files when save_as_session --match has no windows to save
Report an error before writing if a filtered session serializes to
nothing. This keeps an existing session file intact and avoids
creating an empty one at a new path.
2026-11-12 09:33:49 +08:00
Kovid Goyal
6d8f7ac14f
Cleanup previous PR
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Let preview renderers supply extra cache key data instead of checking for
the cmd_renderer type. Include the command line in the key for custom
previews and the video_preview settings in the key for video thumbnails,
so that changing them no longer shows stale previews. GetPath and AddPath
now take this extra key data, replacing GetPathWithAlias.

Track the entry each path uses per extra key, so that previews of one file
with different settings do not evict each other. Do not remove an entry
while another path, such as another symlink to the same file, still uses
it. Cache hits are now recorded so that such shared entries are known.
Failing to remove an orphaned entry on a cache hit no longer turns the hit
into an error.

Fix ensure_entries() discarding unwritten changes when the entries file
does not exist yet, which lost the first path recorded in a new cache.
Also reset the path map when clearing the cache.
2026-11-11 21:26:01 +05:30
Zhizhen He
a1f5604cc2
choose-files: Keep custom preview caches separate for symlinks
Custom preview commands receive the selected path. Include that path
in their cache key so that symlinks to the same file can have different
previews. Keep the resolved target in the key so retargeting a link
still invalidates its entry.
2026-11-11 23:32:42 +08:00