Commit graph

4069 commits

Author SHA1 Message Date
Kovid Goyal
8e73e474b0
X11: Use a single process wide X error handler
Replace the grab/release error handler pattern with a process wide
handler that is installed for the lifetime of the display. Errors are
captured by nestable traps identified by request serial numbers, so
traps only capture errors from requests made while they are open, and
errors from requests not covered by any trap are reported rather than
exiting the process.

Requests to windows owned by other clients (selection requestors, drag
and drop peers) are trapped individually, without waiting for a round
trip to the server, and without covering calls into the application.

Also fix reading uninitialized memory when handling a MULTIPLE
selection request whose requestor window has been destroyed, trap
errors when replying to drag sources, report failure to deliver drag
data, and fix detectEWMH() leaving the error handler installed on an
early return.
2026-11-09 09:01:19 +05:30
Kovid Goyal
64c2702c4f
Update changelog 2026-11-09 08:48:30 +05:30
Kovid Goyal
0dfd9a832e
choose-files: Cleanup handling of special files in previews
Follow up to the previous commit fixing hangs when previewing named pipes:

- Skip previewing anything that is not a regular file (or a symlink to
  one) in preview_for, before any previewer opens it. This avoids
  unblocking and then breaking writers waiting on a FIFO and covers the
  non-text previewers (images, video, archives, calibre, commands) too.
- Apply the text preview size limit to the symlink target instead of the
  symlink itself, and enforce it while reading so that files growing
  after stat() are also handled.
- Pre-allocate the read buffer based on the file size, as os.ReadFile does.
- Read ignore files during scanning with the same non-blocking reader, so
  a FIFO named .ignore or .gitignore cannot stall the scan.
- Unblock goroutines stuck on FIFOs when tests time out.
2026-11-09 08:42:30 +05:30
Zhizhen He
cdd278ee63
choose-files: Avoid hanging when previewing named pipes
Open text preview files in nonblocking mode and check the type on
the opened descriptor before reading. Reuse the same read for syntax
highlighting because it can reopen a path after the file changes.
2026-11-09 00:21:45 +08:00
Kovid Goyal
de20cf35e7
Update changelog
Some checks failed
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Has been cancelled
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Has been cancelled
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Has been cancelled
CI / Linux package (push) Has been cancelled
CI / Bundle test (macos-latest) (push) Has been cancelled
CI / Bundle test (ubuntu-latest) (push) Has been cancelled
CI / macOS Brew (push) Has been cancelled
CI / Test ./dev.sh and benchmark (push) Has been cancelled
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (c, macos-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Has been cancelled
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Has been cancelled
Depscan / Scan dependencies for vulnerabilities (push) Has been cancelled
2026-11-07 19:47:54 +05:30
Kovid Goyal
8f5c7544d1
Bash integration: Source the system startup files bash was built with
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
bash is compiled with the paths to its system wide profile and bashrc
(SYS_PROFILE and SYS_BASHRC) and there is no way to query bash for them.
Previously kitty guessed locations in /etc, which fails on distros that
keep these files elsewhere, such as hermetic /usr distros like Clear Linux
(/usr/share/defaults/etc) or Nix (/etc/bashrc).

Now find the paths by scanning the bash executable for them, both in kitty
and in kitten run-shell (so it works on remote hosts via the ssh kitten).
The result is cached per executable in kitty. If the scan fails, or the
locations are explicitly specified via the environment, the previous
behavior is used.

Fixes #10819
2026-11-07 06:25:36 +05:30
Kovid Goyal
e4988b522d
hints: Migrate from regexp2 v1 to v2
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
Use Capture.ByteRange() from v2 instead of a hand-rolled rune to byte
offset mapping. The old mapping required capture offsets to be monotonic
across matches, so a capture inside a lookaround overlapping a later match
in non-ASCII text caused all matches to be silently dropped.

Also propagate match errors instead of discarding them. Drops the v1
dependency, v2 was already pulled in by chroma.
2026-11-07 05:54:16 +05:30
Kovid Goyal
bdbf9f5af5
Fix #10810
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-05 20:46:52 +05:30
Kovid Goyal
3e4ffc1098
Update changelog 2026-11-05 14:49:07 +05:30
Kovid Goyal
d74472bd3c
choose-files: fix video and custom previews notbeing cached 2026-11-05 14:42:27 +05:30
Kovid Goyal
f1f02448ec
Merge branch 'codex/choose-files-single-thumbnail-decode' of https://github.com/hezhizhen/kitty 2026-11-05 14:35:17 +05:30
Kovid Goyal
fe5ac530e5
Custom shaders: Add screen-shake shaders for the bell
Shake only the window in which a bell occurred, using
d.bell_window_geometry, either side to side or in random directions.
Useful for shaking the window when a shell command fails. Add docs with
shell snippets to ring the bell on command failure and demo entries.
2026-11-05 14:32:45 +05:30
Zhizhen He
c0c31df39c choose-files: Decode video preview thumbnails only once 2026-11-05 16:25:59 +08:00
Kovid Goyal
8a3dace409
Custom shaders: Make bell-in-window event independent of visual bell
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
Fire the event directly from screen_bell() instead of piggy-backing on
start_visual_bell_at in the render loop. Previously the event only fired
when visual_bell_duration was non-zero and bells in windows that were not
visible fired it late, when the window was next rendered. Now only bells
in visible windows (in the active tab and not hidden by an overlay or the
layout) fire the event.
2026-11-05 12:26:06 +05:30
Kovid Goyal
f196b131b9
Remove some older major new features from the recent section ofthe changelog 2026-11-05 11:38:24 +05:30
Kovid Goyal
7f8020faa2
Wayland: Fix unbounded wait for xdg_output geometry
glfwGetWaylandCurrentMonitorFractionalScale() looped on
wl_display_roundtrip() until every monitor had received xdg_output
logical size and position, with no limit. Compositors do not send
these for an xdg_output created on an output whose global has
just been removed, so kitty would hang forever when creating a new OS
window after output churn.

Bound the wait to a few roundtrips and remember monitors for which we
gave up so we dont wait on them again. Re-lookup monitors after each
roundtrip, since a dispatched global_remove can free them.

Also track outputs that have been bound but not yet announced via
wl_output.done, so that a global_remove arriving before done frees them
instead of the dead output being announced later and living in the
monitor list forever.
2026-11-05 08:52:20 +05:30
Kovid Goyal
86fc3955cf
Update changelog 2026-11-05 08:46:51 +05:30
Kovid Goyal
bc9d0b87e3
Custom shaders: Add command and alternate screen events and uniforms
Add the command-start, command-finish, alternate-screen-enter and
alternate-screen-exit events, which fire for changes in the active window,
and the active_window_command_running, active_window_alternate_screen,
active_window_command_state_age and active_window_alternate_screen_age
fields to KittyCustomShaderData, so shaders can show effects while
commands run and hide them in full screen programs.
2026-11-05 08:43:37 +05:30
Kovid Goyal
7670f895a6
IME: Show the cursor at the position reported by the input method in the pre-edit text
Previously the cursor was always drawn after the pre-edit text, as the
cursor position sent by the input method was ignored, so one could not see
which character was being edited when moving inside the pre-edit text, as
with Chewing. Pass the pre-edit cursor from IBus, Wayland text-input and
macOS to kitty, in code points, and place the cursor there. On Wayland, do
not drop pre-edit updates that only move the cursor.

Also use the pre-edit cells rather than the original line under them to
size and color the cursor, so that it covers wide pre-edit characters.

The IME candidate window remains anchored at the start of the pre-edit text.

Fixes #10807
2026-11-05 08:26:34 +05:30
Kovid Goyal
5cd1d37017
Workaround for OS Window focus on notification in macOS when there are multiple kitty instances
Fixes #10805
2026-11-04 20:26:50 +05:30
Zhizhen He
4f689e2777 choose-files: Isolate custom preview command arguments 2026-11-04 10:56:49 +08:00
Kovid Goyal
44ac686c0c
Update changelog 2026-11-04 07:45:30 +05:30
Kovid Goyal
bb1aca6f27
Further harden remote control password processing
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-03 17:36:01 +05:30
Kovid Goyal
64991d3643
version 0.50.0 2026-11-03 13:40:34 +05:30
Kovid Goyal
731e0856ec
Fix #10794 2026-11-02 20:05:14 +05:30
Kovid Goyal
4a435e4fe6
macOS: Fix reloading config causing global menubar shortcuts injected by Apple to stop working
Fixes #10793
2026-11-02 16:27:47 +05:30
Zhizhen He
32e6c525f9 remote_file: Preserve local edits after upload failure 2026-11-01 13:29:24 +08:00
Kovid Goyal
fe55cd1963
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
Store per color scheme auto theme state in a typed dataclass instead of
string built attribute names. Track which theme files were seen during
the directory scan rather than checking for existence afterwards, so a
file deleted mid-scan cannot invalidate unscanned themes. Reset
applied_theme when the applied theme file is deleted.

Always re-read theme files on config reload and apply the theme for the
current system color scheme. Previously, once the applied theme was
invalidated, reloads stopped refreshing theme files, so re-creating the
file had no effect until the next system color scheme change. This also
means theme files created after startup are now applied on reload.
2026-10-31 17:15:08 +05:30
Zhizhen He
9c37638c0e Fix cached automatic themes surviving file deletion 2026-10-31 19:34:26 +08:00
Kovid Goyal
c93279d856
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
Move the D-Bus service Exec line generation into a helper with a fast unit
test instead of copying the test binary and re-executing it. Refuse paths
containing a carriage return, since D-Bus decodes \r as a newline and
rejects .service files containing a raw carriage return.
2026-10-31 09:28:45 +05:30
Zhizhen He
b6abbf7655 desktop-ui: Quote portal activation executable paths 2026-10-31 11:43:54 +08:00
Kovid Goyal
ccecfa037b
Cleanup previous PR 2026-10-31 08:33:43 +05:30
Zhizhen He
df02769ed1 themes: Isolate picker cache from unicode_input 2026-10-30 23:05:31 +08:00
Kovid Goyal
9575920aab
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
Track move source identities in drop_status rather than parsed_uri, and
also compare birth times where available, so that a replacement reusing
the inode number of a deleted source is not removed. Clarify the
changelog entry.
2026-10-30 18:28:40 +05:30
Kovid Goyal
d25a94fc68
Merge branch 'codex/dnd-preserve-replaced-move-sources' of https://github.com/hezhizhen/kitty 2026-10-30 18:26:18 +05:30
Kovid Goyal
88c5e1f6a0
Add a line to the spec to clarify that MIME types from first move only can be relied upon 2026-10-30 18:20:53 +05:30
Kovid Goyal
7fbe251750
dnd: Accept base64 payloads with trailing padding
libbase64's stream decoder fails every call made after it has seen
padding, even an empty one, so the empty message that terminates a
stream was rejected. Also size the decode buffers for pre-sent and
drag item data correctly, so that very short padded chunks such as
QQ== are not rejected.

Fixes #10777
2026-10-30 18:16:47 +05:30
Zhizhen He
7629533607 dnd: Only remove original sources after a local move 2026-10-30 20:29:16 +08:00
Kovid Goyal
f5c6ad38be
Cleanup previous PR 2026-10-30 14:24:59 +05:30
Zhizhen He
c370368a48 dnd: Reject local moves that merge back into a source 2026-10-30 14:32:13 +08:00
Kovid Goyal
2e283f4bc0
Condense 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-10-30 09:33:25 +05:30
Kovid Goyal
1799286567
Update changelog 2026-10-30 09:27:42 +05:30
Kovid Goyal
84b93bd01c
Wayland CSD: Document the new decorations and remove the standalone tests
The standalone C tests compiled the glfw sources by including them and
stubbing internals and were not run by the test suite. Move the useful
parts of the markdown docs into the option docs and changelog.
2026-10-30 09:07:45 +05:30
Kovid Goyal
8853163337
Merge branch 'feature/wayland-gnome-csd' of https://github.com/acid0ikario/kitty 2026-10-30 08:57:46 +05:30
Manuel Villanueva
401d8795f3
Wayland: default CSD to dark when desktop appearance is unavailable 2026-10-29 15:53:45 -06:00
Manuel Villanueva
0753e82dbf
Wayland: treat the default desktop appearance as light 2026-10-29 15:41:39 -06:00
Manuel Villanueva
45282eef7d
Wayland: inherit GNOME titlebar preferences through the desktop portal 2026-10-29 15:35:48 -06:00
Manuel Villanueva
c28c460e34
Wayland: use GNOME CSD by default and follow desktop appearance 2026-10-29 15:16:12 -06:00
Johan Nenzén
3dc4f8d5aa docs: add kmp-terminal and SSH Client for Android to graphics protocol 2026-10-29 20:58:38 +00:00
Kovid Goyal
cb88028abd
dnd kitten: Fix filesystem case sensitivity never being detected
is_case_sensitive_filesystem lost its true default when it moved into
the dnd struct, so remote drops always treated names differing only in
case as conflicting. Detect it properly and also probe for Unicode
normalization aliasing, since a case sensitive filesystem can still
treat differently normalized names as the same.
2026-10-29 21:46:25 +05:30