Commit graph

423 commits

Author SHA1 Message Date
Kovid Goyal
b6d99a8bcd
Fix #10517 2026-09-23 10:44:08 +05:30
devangpratap
c7226d702e Do not drop an escaped U+FFFD in the shlex lexer
write_escaped_ch compares the decoded rune against utf8.RuneError to
detect invalid UTF-8, but a literal U+FFFD decodes to that same rune, so
an escaped replacement character was silently deleted. The size returned
by DecodeRuneInString already tells the two apart: invalid bytes decode
with a size of one, a real U+FFFD with a size of three. Keep the rune
when the size is greater than one.
2026-09-21 12:05:20 -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
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
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
6da5bae945
Cleanup previous PR 2026-05-18 13:55:48 +05:30
Kovid Goyal
da590ed5ec
Remove unused code 2026-05-03 11:57:33 +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
copilot-swe-agent[bot]
ef8189016f
Add streaming base64 encoder with comprehensive tests
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:21:25 +00:00
copilot-swe-agent[bot]
7757d160bc
RemoveChildren: use RefCountedFile instead of DupFile, skip seek for child dirs
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/e648c02e-d4cc-4f6c-8188-17941e8a1dd8

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-27 04:01:02 +00:00
copilot-swe-agent[bot]
708cff7f4b
Convert RemoveChildren from recursive to iterative stack-based
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/bd5ca209-e811-4c49-bec7-5dd3a40d8c57

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-27 03:50:32 +00:00
Kovid Goyal
c655df1c2d
... 2026-04-27 09:12:43 +05:30
Kovid Goyal
9e59bf2f6a
Avoid extra lstat() per entry when removing directory tree 2026-04-27 09:09:07 +05:30
copilot-swe-agent[bot]
cca16aabd3
Add tests for RenameAt, find_overwrites, and rename_contents
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/2fffdd1f-2d67-4a28-b124-437c26794e25

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-27 03:02:32 +00:00
Kovid Goyal
8c2c32a5a5
More work on the dnd kitten 2026-04-27 08:22:17 +05:30
Kovid Goyal
151fb9220f
More work on dnd kitten 2026-04-26 20:45:41 +05:30
Kovid Goyal
ff560f615e
... 2026-04-26 13:15:08 +05:30
copilot-swe-agent[bot]
6000226cdf
Add tests for file_at_fd.go and fix FD lifetime bug in CopyFolderContents
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/389bb81e-e9f9-4428-a79a-d8d461cfe943

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-25 11:30:59 +00:00
Kovid Goyal
a5940b4eb1
... 2026-04-25 13:59:37 +05:30
Kovid Goyal
ecc241d891
For for background copy go routine to exit 2026-04-25 13:40:58 +05:30
Kovid Goyal
f6c0955e84
Read large directories in chunks for faster cancel 2026-04-25 13:34:21 +05:30
Kovid Goyal
a6e58e2ca9
Cleanup symlink seen handling 2026-04-25 13:25:33 +05:30
Kovid Goyal
5146cb388b
Fix various minor bugs in copy folders 2026-04-25 13:02:27 +05:30
Kovid Goyal
8737da510f
Add optional symlink following to copyfolder function 2026-04-25 12:08:56 +05:30
Kovid Goyal
4a5ab0a05e
Fix various minor bugs in the copy folders function 2026-04-24 15:35:44 +05:30
Kovid Goyal
68a4623f37
DRYer 2026-04-24 15:12:24 +05:30
Kovid Goyal
55c4519707
More pointless UNIX variability 2026-04-24 14:56:29 +05:30
Kovid Goyal
0f81bca430
DRYer 2026-04-24 14:37:34 +05:30
Kovid Goyal
ca7388c145
Bloody lazy Crapple
No mknodat. Sigh.
2026-04-24 14:22:41 +05:30
Kovid Goyal
2c37fb4845
API to copy folder contents using dir fds
Also make the various fd based wrappers handle EINTR automatically.
2026-04-24 14:12:04 +05:30
Kovid Goyal
ddcf471d90
rename file 2026-04-24 14:11:32 +05:30
Kovid Goyal
64342abda0
More work on the dnd kitten 2026-04-23 08:15:34 +05:30
Kovid Goyal
b4f7162a73
Use CLOEXEC with openat 2026-04-21 22:01:39 +05:30
Kovid Goyal
43035b7224
Rename at fd module 2026-04-21 21:59:05 +05:30
Kovid Goyal
828384a324
More fd based API 2026-04-21 21:58:33 +05:30
Kovid Goyal
b8de27655f
Utility function to delete content of dir pointed to by open file 2026-04-21 21:41:17 +05:30
Kovid Goyal
1ca6dba7e1
... 2026-04-21 13:12:45 +05:30
Kovid Goyal
3d8a2fbb4f
Use SIMD base64 everywhere 2026-04-21 11:56:55 +05:30
Kovid Goyal
744ad7438c
Use SIMD base64 encoding for graphics transmission 2026-04-21 10:01:28 +05:30
Kovid Goyal
93573aec6f
Switch to SIMD based base64 decoder 2026-04-21 09:52:39 +05:30
Kovid Goyal
1b741ca725
Clean up API of streaming decoder 2026-04-21 09:49:09 +05:30
copilot-swe-agent[bot]
7b346d15c1
Add comprehensive tests for streaming_base64 decoder
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/b5dbc339-6907-46fb-a7e7-9ee08b7ed20d

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-21 04:13:30 +00:00
Kovid Goyal
94651eaff2
Go version of streaming base64 decoder 2026-04-21 09:34:25 +05:30
Kovid Goyal
59cf34ca58
Get machine_id working on macOS as well 2026-04-12 12:31:42 +05:30
Kovid Goyal
950497ac0c
Cleanup previous PR 2026-04-03 22:25:05 +05:30
z3rco
b39f88c6a2 Fix multiple security vulnerabilities across C, Python, and Go code
Timing-safe comparisons:
- crypto.c: Replace memcmp with CRYPTO_memcmp for Secret equality,
  require equal lengths before comparing
- remote_control.py: Constant-time password lookup to avoid leaking
  valid passwords via dict hash timing
- file_transmission.py: Use hmac.compare_digest for bypass token
  comparison instead of ==

Memory safety:
- child-monitor.c: Fix inverted condition in write_to_peer that
  prevented memmove from ever executing on partial writes
- ibus_glfw.c: Null-terminate IBUS_ADDRESS copy to prevent string
  overread when strlen >= PATH_MAX
- x11_window.c: Add NULL checks after realloc in clipboard/DnD
  data handling (two sites)
- dnd.c: Cap accepted_mimes at 1MB to prevent unbounded growth,
  fix realloc to not lose the original pointer on failure
- png-reader.c: Cast to size_t before multiplication to prevent
  integer overflow on 32-bit platforms

Secrets hygiene:
- disk-cache.c: Zero encryption_key with explicit_bzero before free

Tar extraction hardening:
- tar.go: Validate hardlink targets against destination prefix to
  prevent writing outside extraction directory
- tar.go: Strip setuid/setgid/sticky bits from extracted files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:10:46 +01:00