Commit graph

4006 commits

Author SHA1 Message Date
Kovid Goyal
862c8657be
Cleanup previous PR
Make ColorProfile.test_mark_colors() return MARK_MASK pairs instead of a
hard-coded three, simplify the test by using MARK_MASK and mutable expected
values, and correct the changelog entry: config reload was not affected,
set-colors, launch --color, sessions and automatic theme switching were.
2026-10-29 08:52:08 +05:30
Kovid Goyal
33f55fbb93
Merge branch 'fix/live-text-marker-colour-slots' of https://github.com/vboufleur/kitty 2026-10-29 08:50:11 +05:30
Kovid Goyal
23cd5fd8eb
Have --config=NONE also skip other conf files used by kitty 2026-10-29 08:46:15 +05:30
Vitor Araujo Boufleur
3459adc4fc Fix live text-marker colour slot indexing 2026-10-28 16:23:18 -03:00
Kovid Goyal
96ef7b3fb5
Merge branch 'codex/dnd-skip-moves-to-source-directory' of https://github.com/hezhizhen/kitty
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-28 21:18:37 +05:30
Kovid Goyal
fc788ef599
... 2026-10-28 21:09:21 +05:30
Zhizhen He
ad0b3ad86b docs: Avoid a platform-specific option link in the changelog 2026-10-28 20:53:25 +08:00
Kovid Goyal
ad451c720f
Fix #10759 2026-10-28 17:25:46 +05:30
Kovid Goyal
0dcd16d6fe
Update changelog 2026-10-28 11:01:05 +05:30
Zhizhen He
1e273aa289 Docs: Correct protocol references, examples and generated help 2026-10-28 13:24:43 +08:00
Kovid Goyal
78d6839881
Fix #10757 2026-10-28 07:50:44 +05:30
Zhizhen He
849c04153c choose-fonts: Fix style ordering for negative axis values 2026-10-27 22:52:24 +08:00
Kovid Goyal
02dd29ad14
Add nightly version to version string for nightly builds. Fixes #10751 2026-10-27 10:43:51 +05:30
Zhizhen He
f0c67e1b97
clipboard: Reject output files with case aliases 2026-10-26 22:21:29 +08:00
Kovid Goyal
78b28eb5fc
Merge commit '6294070d06' 2026-10-26 17:22:09 +05:30
Kovid Goyal
6294070d06
Do not let a window waiting for a render frame delay the paint when the frame arrives
render() reset last_render_at even when a window could not paint because it
was waiting for a render frame. The frame callback then arrived within
repaint_delay and was ignored, so the window was painted by the next parse
of child output, which ignores repaint_delay. Since small output is now parsed
immediately, that paint happened mid-burst, showing intermediate states of
programs that redraw with several small writes, such as less echoing the
partial mouse escape code in its prompt. Fixes #10749
2026-10-26 17:18:26 +05:30
Kovid Goyal
52d33e2c82
zsh completion: Respect the descriptions format style for group headings
Previously group headings were hard-coded as %B<title>%b, ignoring the
user's zstyle ':completion:*:descriptions' format. This caused literal
%B/%b markers to appear with fzf-tab. Now the configured format is used,
falling back to bold titles when none is set.

Fixes #10748
2026-10-26 16:31:39 +05:30
Zhizhen He
49e5695188
clipboard: Resolve symlinks before cleaning output paths 2026-10-26 13:12:42 +08:00
Kovid Goyal
ddeb15b05a
clipboard: Download data once for outputs sharing a MIME type
Rather than every output sharing a remote MIME type writing its own
temporary copy of the data and decoding images separately, store the
data in a single temporary file per MIME type, decode images once and
save all outputs for that MIME type sequentially from it. The temporary
file is created in the directory of the first output where that is
possible, so a missing directory for one output does not affect others.

Also reject output files that resolve to the same path, following
symlinks as the atomic file update does, since saving to them would race
with the last write winning.
2026-10-26 08:53:47 +05:30
Kovid Goyal
3723c447aa
clipboard: Reject duplicate stream outputs for the same MIME type
Stream outputs write data as it arrives, so with fan-out to all outputs
sharing a remote MIME type, two outputs to the same stream would
interleave their data chunk by chunk, or encode two images into the
stream concurrently. Reject such duplicates with an error instead.
Also add a changelog entry for saving all outputs sharing a MIME type.
2026-10-26 08:48:06 +05:30
Zhizhen He
bb956c7c6b
clipboard: Commit MIME list output when saving to a file 2026-10-26 10:05:45 +08:00
Kovid Goyal
db9ae83672
macOS: Verify that the pty name from ptsname_r() matches the slave fd
Since the pty name is now obtained from the master fd, check that it
refers to the same device as the slave fd, so that a mismatched pair
passed to spawn() raises an error instead of silently giving the child
the wrong controlling terminal. Also merge the changelog entry into the
existing macOS bullet.
2026-10-26 06:42:01 +05:30
Chris Ren
b2087a7b42 macOS: Fix kitty freezing when opening a window while a /dev entry is stuck
On macOS, ttyname_r() calls devname_r(), which lstat()s every entry in
/dev until one matches. New ptys are appended to /dev, so naming the pty
of a new window looks up every older entry, and one stuck entry blocks
spawn() on the main thread with the GIL held, freezing kitty.

ptsname_r() on the master returns the same name with one ioctl() and a
stat() of that single path. Other platforms keep ttyname_r(), which does
not walk /dev there in the normal case.

Fixes #10741
2026-10-25 19:28:19 -05:00
Kovid Goyal
debcde56c0
Cleanup dangling symlink handling in atomic writes
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 EvalSymlinksThatExist to paths.go as it is no longer used only for
tar extraction, create the test symlinks in a deterministic order and
add a changelog entry for #10740 noting that it affects all atomically
saved files, not just clipboard output.
2026-10-25 22:23:27 +05:30
Zhizhen He
7fdd2af0fc
clipboard: Preserve dangling output symlinks 2026-10-25 22:21:52 +05:30
Kovid Goyal
68f242b7d9
clipboard: Cleanup atomic replacement of output files
Follow up to the merge of #10738. Use utils.AtomicUpdateFile to move
downloaded data into place instead of hand rolling the stat/chmod/rename
sequence. This fixes:

- Permissions of existing destination files not being preserved, as the
  chmod was applied to an already closed file
- An empty file being left at the destination if the rename failed, as
  the permissions probe opened the destination with O_CREATE
- Symlinks at the destination being replaced by regular files
- No fsync before the rename

Also encode converted images into memory and write them atomically, so
a failed encode no longer truncates and then deletes an existing
destination file.
2026-10-25 20:33:25 +05:30
Zhizhen He
0fae8bb9bd
clipboard: Replace existing output files atomically 2026-10-25 22:40:47 +08:00
Kovid Goyal
0955567d25
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-10-25 19:17:08 +05:30
Kovid Goyal
d53ad3fd3a
ssh kitten: Resolve HOME when using --symlink-strategy=resolve
The copied paths have their symlinks resolved, so files under a HOME that is
itself reached via a symlink, such as /home -> /usr/home, were not
recognized as being in HOME and were copied to an absolute path on the
remote machine. Also add the PR reference to the changelog entry for #10737.
2026-10-25 19:09:11 +05:30
Zhizhen He
814e7429ae
ssh: Fix HOME prefix matching for copied paths 2026-10-25 20:54:39 +08:00
Kovid Goyal
4bafcb9a7c
Graphics protocol: Add sub-feature querying
Fixes #10732
2026-10-25 09:59:12 +05:30
Kovid Goyal
617ddee75b
Remote control: Harden handling of passwords for async requests 2026-10-25 09:11:02 +05:30
Kovid Goyal
81535d9b33
hints: 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
- Guard against the quotes post processor producing start > end for a match
  consisting of just a single ASCII quote
- Use char_before() in the URL trailing punctuation loop and avoid computing
  the closing bracket twice
- Add PR reference to changelog entry
2026-10-24 06:36:26 +05:30
Kovid Goyal
92e9e6a038
Merge PR #10730: hints: Fix Unicode quotes not being removed from paths and URLs 2026-10-24 06:35:13 +05:30
Kovid Goyal
89db933a24
Fix #10729 2026-10-24 06:28:36 +05:30
xucian
f9b2fbb3b1 hints: Fix Unicode quotes not being removed from paths and URLs
The post-processors index the text by byte, so when looking at the
character before a position they decoded only the last byte of
multi-byte quotes such as ‘’ and “” and never matched them. URLs kept
the closing quote and paths kept both quotes. When the closing quote was
just outside the match, the start was also advanced by a single byte,
splitting the opening quote and producing invalid UTF-8, for example,
for the file name in wget's "Saving to: ‘index.html’".

This worked before the hints kitten was ported to Go.
2026-10-23 23:40:40 +03:00
Kovid Goyal
07c8731470
...
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-23 21:21:01 +05:30
Zhizhen He
22c1b6b252
ssh: Fix chmod compatibility on macOS when merging directories 2026-10-23 23:43:03 +08:00
Kovid Goyal
8538e82c05
ssh kitten: Preserve permissions of copied directories
The archive reused the metadata of the top level directory for all nested
directories and both bootstrap implementations recreated directories with
the remote umask.

Stat every directory when building the archive, passing the stat result
explicitly to the header callback and skipping directories that vanish or
are replaced by something else while being copied.

When deploying, move directories not present at the destination intact,
replacing any dangling symlink or file in the way, and merge into existing
directories keeping their permissions. The shell implementation falls back
to creating the directory and merging if the move fails. Make the
temporary directory deletable before removing it as copied directories can
lack write or search permission.

Closes #10727
2026-10-23 20:44:23 +05:30
Kovid Goyal
5cab872968
Reset link hover pointer when output clears the highlight
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
Program output can remove the highlighted link under the mouse, which
left the hand pointer and the hovered link state stale until the mouse
moved or the modifiers changed. After parsing output, if the highlight
in the hovered window was cleared, reset the hovered link and re-derive
the pointer shape, using the current mouse tracking mode.

Closes #10725
2026-10-23 17:02:12 +05:30
Kovid Goyal
4db8bdab70
Merge PR #10723: Respect mouse mappings for link hover feedback 2026-10-23 10:57:39 +05:30
Zhizhen He
4e9ff82c77
Fix link hover regressions identified in review
Refresh hover feedback only in the hovered pane when modifier changes alter
whether a single-click link action matches. Preserve resize and drag cursors
and keep OSC 22 pointer updates independent of modifier handling.

Compute link modifier masks while finalizing mouse mappings, clarify the
documentation, and cover the reported regressions with mock pointer events.
2026-10-23 12:59:35 +08:00
Kovid Goyal
0f52b57860
Scale box drawing, cursor and title bar border line thickness with font size
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
Lines whose thickness is specified in pts are now scaled by the ratio of
the current font size to the configured font_size, so they no longer look
too thin when zoomed in or too thick when zoomed out. At the configured
font size nothing changes. This combines with the existing multicell
scale for the text sizing protocol. Sprites are already cached per font
size, so no cache changes are needed.

For the window title bar, the drawn border is kept at least half a pixel
inside the pixels reserved for it, since the rounded rect shader
anti-aliases over a one pixel band on either side of each edge and would
otherwise bleed onto the rendered title.

Fixes #10362
2026-10-23 10:18:23 +05:30
Kovid Goyal
1fee9e89f6
ssh kitten: Allow per-host color schemes for dark and light mode
New color_scheme_dark, color_scheme_light and color_scheme_no_preference
options. When any of them is set, the ssh kitten sends the color schemes
for all three system color schemes to kitty, which applies the one
matching the current system color scheme and switches between them when
the system color scheme changes. color_scheme is used for modes without
a specific color scheme.

The colors are applied in a new session color layer, above the colors of
the window and below colors set by programs. They are associated with the
color stack entry pushed by the ssh kitten and are removed when it is
popped, so nested sessions work and the colors are restored on exit.

Configs that only use color_scheme continue to use escape codes exactly
as before, as does the kitten when running inside tmux.

Fixes #10724
2026-10-23 09:37:50 +05:30
Kovid Goyal
4a343a1801
Keep per-window and program colors when the system color theme changes
Colors in a window are now tracked in layers: the global configured colors
(kitty.conf and the automatic color theme), the colors of the individual
window (launch --color, --copy-colors) and the colors set by the program
running in the window (escape codes, set-colors without --configured).
Switching between light and dark themes changes only the global layer, so
colors set by the ssh kitten, by programs or by launch --color are no
longer overwritten.

Only the colors set by the program are saved on the color stack, so
popping the stack, for example when exiting the ssh kitten, uses the
current theme colors for everything else rather than those from before
the theme change. launch --color colors now also survive config reloads.

set-colors --configured still replaces colors set in the matched windows.

Fixes #10724
2026-10-23 09:22:17 +05:30
Kovid Goyal
b5adf1de0e
Linux: Send kitty's .desktop file name to notification servers for grouping
Closes #10721
2026-10-23 08:47:19 +05:30
Zhizhen He
e6561b6337
Respect mouse mappings for link hover feedback
Follow configured mouse actions for the hand pointer and hover underline,
and refresh both on modifier changes without requiring mouse movement.

Cover URL detection, hyperlink highlighting, configuration variants, and
link dragging with focused regression tests.
2026-10-23 05:08:02 +08:00
Kovid Goyal
e615009378
Use the root process for the window pid in ls and pid matching
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
This makes the pid consistent with the cmdline, cwd and env reported
for the window, which already skip over wrappers kitty inserts such as
/usr/bin/login on macOS and the wrapper used for --hold.
2026-10-23 01:19:40 +05:30
Kovid Goyal
4a99b367c5
Use the root process, not kitty's wrapper, for a window's process info
The cmdline, environment and working directory of a window, as reported
by kitten @ ls, used for matching windows and saved in the window state,
now come from the root process, skipping over wrappers kitty inserts
such as /usr/bin/login on macOS. Previously on macOS these described the
login process. Cache the resolved root process so that this is cheap.
2026-10-23 01:17:33 +05:30
Kovid Goyal
42f241da28
Fix launch --cwd=root using the wrong process
When the root process was not in the foreground, cwd=root used the cwd
of the foreground process instead of the root process. Also skip over
wrapper processes that kitty itself inserts, such as /usr/bin/login on
macOS and the run-shell kitten used for --hold, using their first child
as the root process instead. Previously on macOS cwd=root always
resolved to the home directory, the cwd of login.

On Linux, read the children of all threads of a process, since
multi-threaded programs such as kitten can create children from any
thread.

Make cwd_of_child and modify_argv_for_launch_with_cwd use the same
logic for deciding when the reported cwd applies to cwd=root.

Closes #10720
2026-10-23 01:07:04 +05:30