Commit graph

1462 commits

Author SHA1 Message Date
Kovid Goyal
1fb52b8443
Cleanup previous PR and make VS15 on explicit width cell behavior consistent with VS16 2026-09-18 22:59:19 +05:30
Kovid Goyal
c444b942ef
Merge branch 'thai-sara-am' of https://github.com/noomz/kitty 2026-09-18 20:54:46 +05:30
devangpratap
62a4b451d4 Do not offer symlinks to directories as executables in completion
CompleteExecutablesInPath excluded directories with e.IsDir(), but that is false
for a symlink pointing at a directory. Directories are executable in the
access(2) sense, so such a symlink sitting in a PATH entry passed the X_OK check
and was offered as a command. Use the existing is_dir_or_symlink_to_dir helper,
which already makes this distinction elsewhere in the file.
2026-09-16 20:17:32 -04:00
devangpratap
579c735014 Use GuessMimeType for mime based completion
complete_by_mimepat called mime.TypeByExtension directly, so it saw only the
extensions the Go standard library knows about. Everything else in kitty that
needs a mime type goes through utils.GuessMimeType, which also consults the
user's mime.types, kitty's builtin types and KnownExtensions. As a result
files like foo.py or foo.toml were not offered when completing arguments that
ask for text/*, even though kitten pager opens them as text.
2026-09-16 05:43:17 -04:00
devangpratap
ebb41b83da Fix completion of directories containing files with uppercase extensions
Completion patterns are lowercased in make_completer and file names are
lowercased before being matched against them, but the names of files inside
a directory were passed to the matcher unchanged. A directory whose only
matching file was named something like B.CONF was therefore never offered as
a completion candidate for a *.conf pattern, while the same file named
b.conf worked.
2026-09-16 00:43:53 -04:00
Siriwat Uamganmsup
0b29c33e89 Widen the cell for Thai/Lao vowel sign AM (U+0E33, U+0EB3)
These two code points have Grapheme_Cluster_Break=SpacingMark but a
width of one, the only such code points in Unicode. Grapheme
segmentation (GB9a) adds them to the previous cell, so "จำ" occupied a
single cell in kitty while wcwidth() based programs count two. As a
result the SARA AA glyph was clipped, only the nikhahit was visible and
the cursor drifted right by one cell per AM.

Now, when such a code point combines into a plain one cell wide cell,
the cell is widened to two cells, using the same mechanism as U+FE0F
does for narrow emoji. The C and Go wcswidth() implementations are
updated to match so that kitty's own width calculations agree with the
screen.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 10:43:49 +07:00
devangpratap
04082039be Fix completion of symlinks to directories for directory arguments 2026-09-15 14:09:41 -04:00
devangpratap
fd904d45d8 Fix completion of paths directly under the root directory 2026-09-15 11:15:04 -04:00
Anand Hegde
8b564c7094 Go shlex: Do not drop empty quoted strings
Port the fix from 2093fb131 in the C shlex implementation to the Go one.
Previously an argument such as "" or '' was silently dropped, since an
empty word was also used to signal EOF. So "launch --title '' vim" in the
kitty shell was parsed as "launch --title vim". EOF is now signalled with
a negative Pos.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MA8JGs7pCoXFL2W6jEJ8sD
2026-09-14 16:09:51 +05:30
Anand Hegde
0791b39abb Fix completion after a trailing space in the kitty shell
SplitForCompletion computed the position of the new empty word as if
the previous word were one byte long, so tab completing after a space
following a multi-character word replaced part of that word. For example,
completing "launch --type " in the kitten @ shell produced
"launch --window ". The new word starts at the end of the input.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MA8JGs7pCoXFL2W6jEJ8sD
2026-09-14 16:09:05 +05:30
Kovid Goyal
e2093178e5
Fix empty kitty config dir causing watching for changes to kitty.conf failing 2026-09-02 09:36:03 +05:30
Kovid Goyal
fb99338101
also ask for cursor position on benchmark data completion to ensure terminal has updated its state 2026-08-29 03:02:56 +05:30
Kovid Goyal
302399681c
Make benchmark warmup more sophisticated by allocating a few thousand colors as well 2026-08-29 02:58:15 +05:30
Kovid Goyal
26fa4b557d
bash completion: Dont remove common prefix. Fixes #10388 2026-08-23 08:36:58 +05:30
OBrutus
19a0bf0670 Merge origin/master into go-kitten-ports
Reconcile the three ported kittens with 529 upstream commits. Only conflicts
were in the shrunk resize_window/broadcast/remote_file main.py stubs (upstream
reformatted their OPTIONS strings); resolved by keeping upstream's formatting
plus the Go-port stubs (shrunk main, remote_file handle_result shim, dropped
-h alias). Go build + kitten tests pass; dev build regenerates CLI cleanly;
Python suite at baseline (1 pre-existing unrelated failure).
2026-08-18 16:18:54 +05:30
Kovid Goyal
db36f6b9b6
Increase default number of reps for benchmarking 2026-08-18 08:22:46 +05:30
OBrutus
a0978a74a2 remote_file kitten: port ask UI to Go, wrap and shrink Python to result-handler shim
Adds kittens/remote_file/main.go (ask menu, hostname-mismatch prompt,
save-path prompt with tab completion, edit/open/save actions) on top of the
ControlMaster/ssh helpers from the previous two commits, registers it in
tools/cmd/tool/main.go, and adds remote_file to shell-integration/ssh/kitty's
wrapped_kittens list so both `kitty +kitten remote_file` and ssh-session
invocations exec the Go binary directly. main.py is shrunk to option_text
(kept importable by kitty/cli_stub.py and used for --doc/--help generation),
is_ssh_kitten_sentinel (kept importable by kitty/window.py), and the
handle_result shim boss.py runs in-process to open the returned file.

Also drops the dead `-h` alias on --hostname: Python's CLI layer always
special-cases -h/--help ahead of user options, so it never worked as a
hostname shorthand, but the Go CLI layer hard-errors on the collision; removing
it is a no-op for existing behavior (boss.py only ever passes --hostname) and
unblocks `kitten remote-file --help`. Also adds the same reset_terminal()
calls Python makes between UI phases (ask menu -> action, hostname-mismatch
prompt, overwrite prompt, $EDITOR handoff) so the Go and Python screens match.

Manually verified parity against Python (ask menu, cancel, open/edit/save
download+upload round-trips, hostname-mismatch Y/N, save-path prompt and
overwrite O/A/R/N) using a fake-ssh test double, and confirmed post-wrap that
`kitty +kitten remote_file` execs the Go kitten binary.
2026-08-13 15:21:57 +05:30
OBrutus
aa8bf26b02 broadcast kitten: Go TUI implementation and registration 2026-08-12 12:52:40 +05:30
OBrutus
edbf66f004 resize_window kitten: Go TUI implementation and registration 2026-08-11 00:27:05 +05:30
Kovid Goyal
3f16b01e80
Also handle leading ~ 2026-08-05 05:32:55 +05:30
Kovid Goyal
f156c3c152
Handle relative paths for the screenshot rc command correctly 2026-08-05 05:32:55 +05:30
Kovid Goyal
766466ad57
Add a screenshot remote control command 2026-08-05 05:32:55 +05:30
Kovid Goyal
51738e02f0
Update the list of NERD glyph names
Fixes #10311
2026-08-04 06:29:55 +05:30
Kovid Goyal
c51e957194
fix locking in LRUCache 2026-07-27 09:34:01 +05:30
Kovid Goyal
9dca948e9b
Restrict echo to only allow characters 0-9
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-07-26 16:05:13 +05:30
Sinity
ed51a3e97c
Benchmark unique multi-codepoint Unicode cells
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>
2026-07-12 15:27:24 +02:00
Kovid Goyal
d5cac0100e
Fix remote_control_script not working in a kitty instance run from inside another kitty instance 2026-07-06 09:08:43 +05:30
Kovid Goyal
011ef4d319
Use readline for the choose files search input 2026-07-05 15:16:11 +05:30
Kovid Goyal
b90e2124e0
Fix #10225 2026-07-05 13:38:48 +05:30
copilot-swe-agent[bot]
21f7e96bef
Address code review: add comment, fallback timer, and warning log for PID monitoring 2026-06-28 03:16:33 +00:00
copilot-swe-agent[bot]
aee532c586
Fix issue 10198: edit-in-kitty exits with editor's exit code
- Python (kitty/launch.py): Track editor PID via monitor_pid to capture
  exit code when editor window closes. Send exit code as data in the DONE
  message instead of sending no data.
- Go (tools/cmd/edit_in_kitty/main.go): Parse exit code from DONE message
  data and use lp.Quit(exit_code) to exit with the editor's exit code.
- Go (tools/cmd/tool/confirm_and_run_shebang.go): Check exit code when
  running edit-in-kitty as a subprocess; abort execution on editor failure.
2026-06-28 03:10:58 +00:00
Kovid Goyal
a2104d3755
Merge branch 'feat/10090-graphics-cache-dir' of https://github.com/Mekann2904/kitty 2026-06-19 10:16:10 +05:30
Matsumoto Kotaro
89946ebc07 graphics: make N a transient usage-hints bitmask
Change the graphics protocol N key from a boolean into a usage-hints
bitmask. Define the first bit as a transient hint, allowing the terminal
to treat the image data as short-lived and apply optimizations such as
skipping disk cache writes.

Propagate the transient hint through frame coalescing and composition, so
a composed frame is transient if any contributing frame is transient.
2026-06-19 13:22:01 +09:00
Kovid Goyal
8996aa798c
dnd kitten: Create regular files with O_EXCL to avoid symlink attacks
Some checks failed
CI / Linux (python=3.13 cc=clang sanitize=1) (push) Has been cancelled
CI / Linux (python=3.11 cc=gcc sanitize=0) (push) Has been cancelled
CI / Linux (python=3.12 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
This is not really needed as the terminal emulator should be de
duplicating directory entries anyway but no harm in defense in depth.
2026-06-03 12:17:38 +05:30
Kovid Goyal
e6e5524f67
diff kitten: Strip suid/sgid bits from extracted files 2026-06-03 05:45:04 +05:30
Kovid Goyal
cb0f05c4e4
Fix parsing of config set aborting on non-existent files
Some checks are pending
CI / Linux (python=3.13 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.11 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.12 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-06-02 21:19:04 +05:30
copilot-swe-agent[bot]
bff5af7052
address review: fix comment wording and rename burst_actions variable 2026-06-02 12:46:10 +00:00
copilot-swe-agent[bot]
d80fd1c23d
consolidate watch tests and add include-in-included-file test
- Merge TestWatchForConfigChangesIncludeAdded and
  TestWatchForConfigChangesIncludeRemoved into the main
  TestWatchForConfigChanges function, which now starts the watcher
  once and shares it across all integration subtests.
- Add prime_watcher helper that retries writes until an action fires,
  replacing the blind time.Sleep(200ms) watcher-startup wait.
- Add new subtest "include added to already-included file adds its
  parent dir": writes an include directive into sub/included.conf
  (itself included from kitty.conf), then verifies that changes to
  the newly referenced file trigger the action, confirming its parent
  directory was added to the watch set.
- Fix TestWatchForConfigChangesDebounce to use prime_watcher instead
  of time.Sleep for startup; capture before_burst baseline before the
  burst loop so the burst-action count is computed correctly.
2026-06-02 12:45:00 +00:00
copilot-swe-agent[bot]
7e96373515
watch: non-recursive config file watching with dynamic include tracking 2026-06-02 08:23:05 +00:00
Matsumoto Kotaro
cc2d7a1789 graphics: add memory-only storage for graphics data
Add a new graphics protocol key, N=1, to request that transmitted
image/frame data is kept only in memory and not written to the graphics
disk cache file.

This is useful for transient high-frequency updates such as video-like
streams, where the latest frame is the only useful data and persisting
each frame to the disk cache causes unnecessary write traffic.

The implementation keeps the existing graphics cache abstraction intact:
memory-only entries can still be read back by animation, composition, and
frame coalescing paths. Only persistence to the disk cache file is skipped.

The default behavior is unchanged when N is omitted or set to zero.
2026-05-30 18:46:24 +09:00
Kovid Goyal
f2df2394ce
Fix conf watcher kitten not tracking changes to symlink targets
Some checks are pending
CI / Linux (python=3.13 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.11 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.12 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-05-24 09:54:01 +05:30
Kovid Goyal
dd136ba806
... 2026-05-24 09:12:43 +05:30
Kovid Goyal
6da5bae945
Cleanup previous PR 2026-05-18 13:55:48 +05:30
Kovid Goyal
c5b9b7d81d
... 2026-05-17 13:45:53 +05:30
Xuyiyang23333
c0661024d8 Fix silent failure when pager (less) is not installed
When kitten --help is run in a terminal and less is not available,
ShowHelpInPager silently discards the error from pager.Run(), resulting
in no output and a zero exit code. Fall back to writing help text
directly to stdout when the pager fails, matching the behavior of the
Python equivalent in kitty/cli.py which catches FileNotFoundError and
prints the text as a fallback.

Signed-off-by: Xuyiyang23333 <xuyiyang23333@gmail.com>
2026-05-13 00:37:55 +08:00
Kovid Goyal
3165a47579
More work on the DnD kitten 2026-05-05 10:49:56 +05:30
Kovid Goyal
da590ed5ec
Remove unused code 2026-05-03 11:57:33 +05:30
Kovid Goyal
cd7d3026f6
Handle dnd chunking internally in the loop 2026-05-02 17:28:01 +05:30
Kovid Goyal
ff7c6425e6
More work on dnd kitten 2026-05-02 12:16:42 +05:30
copilot-swe-agent[bot]
3f04b4dd40
Remove spurious blank line in Decoder Finish method
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/cb72bac9-aa33-480e-83e9-2f59508694a7

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-02 03:23:18 +00:00