Commit graph

22 commits

Author SHA1 Message Date
Kovid Goyal
fdab0a8097
Only test abstract UNIX sockets on Linux
Abstract sockets are a Linux-only feature, binding to one on macOS fails
with ENOENT.
2026-11-19 19:57:36 +05:30
Kovid Goyal
bfcd598772
Remove stale UNIX sockets when listening for remote control
If the socket file for --listen-on was left behind by a kitty instance
that was killed, binding to it failed, so remote control was disabled
and an error was shown over the program. Now, if no process is listening
on the socket, it is removed and binding is retried. A socket that a
process is listening on and files that are not sockets are never
removed, and the error shown includes the reason for the failure.
2026-11-19 19:57:36 +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
67d337794f
Remote control: Harden authorization of stream continuations
Requests on a registered stream skip authentication, so restrict that to
genuine continuations of the authorized request that opened the stream:

- A continuation may differ from the opening request only in its data,
  so it can no longer, for example, supply a different cmdline to run.
- Streams are bound to the socket peer or window that opened them, and
  only requests from that origin can continue or cancel them.
- Streams are aborted, discarding any buffered data, when the peer
  disconnects, the window is closed or the request is cancelled, so
  abandoned streams no longer stay authorized.
2026-11-03 17:12:53 +05:30
Zhizhen He
5234808693 Remote control: Do not register streams for async cancellations
Cancellations of async requests are allowed without authentication, and
requests on a registered stream are allowed without authentication too.
handle_cmd() registered the stream before returning for a cancellation, so
an unauthenticated cancellation could register a stream id that a later
request then used to skip authentication. Register the stream only after
cancellations have returned.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-03 17:52:17 +08:00
Kovid Goyal
617ddee75b
Remote control: Harden handling of passwords for async requests 2026-10-25 09:11:02 +05:30
Kovid Goyal
f8b1975692
set-font-size: Reject invalid sizes instead of misinterpreting them
Drop the abs() that silently flipped negative operands, reject non-finite
values and zero with an operator (which would otherwise reset the font
size). Validate in response_from_kitty too, so payloads sent by kitten @
get the same checks. Share the operator parsing with change_font_size.
2026-10-18 21:39:23 +05:30
Zhizhen He
23efab20d8
set-font-size: Support multiplication and division in mappings
Recognize all documented relative operators in the Python remote-control
parser and parse their numeric operand separately. Add regression coverage
for mapping dispatch with and without --all, and a changelog entry.
2026-10-18 18:56:11 +08:00
Kovid Goyal
3494fbda51
action: Give context in remote control parse error messages
Include the action definition in the error and avoid the quoted repr
that str() produces for KeyError. Use a spec'd Mock in the tests so
unexpected Boss attribute access fails, and reference the PR in the
changelog.
2026-10-18 14:16:11 +05:30
Zhizhen He
9c21523215
action: Report parsing errors to remote control clients 2026-10-18 15:48:36 +08:00
Kovid Goyal
22cfda44df
Fix visual window select treating an empty allowed set as unrestricted
An empty only_window_ids meant every window was selectable, so for example
select-window --exclude-active in a single window tab returned the active
window. Use None to mean unrestricted instead.

Closes #10683
2026-10-18 08:11:51 +05:30
Kovid Goyal
277ff7f1e1
Fix #10679 2026-10-17 11:12:49 +05:30
Zhizhen He
bb4a3324e7
Fix remote_control run with non-terminal stdin 2026-10-17 13:12:22 +08:00
Kovid Goyal
b7a657de10
Fix ls --self and --output-format being ignored in remote_control mappings
The Python implementation of message_to_kitty did not forward these
options in the payload, so they only worked via kitten @.
2026-10-17 10:15:49 +05:30
Zhizhen He
38004ded76
Fix --configured in set-enabled-layouts mappings 2026-10-17 10:28:04 +08:00
Kovid Goyal
5c89ea9a1a
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
Apply the --exclude-active filter in RemoteCommand.windows_for_payload so
every command using it honors the flag, instead of each command filtering
by hand. Extend the send-key test to cover --match, --match-tab and the
default active window fallback.
2026-10-16 21:04:41 +05:30
Zhizhen He
07ab3d3409
send-key: Honor --exclude-active
Exclude the active window before dispatching keys when requested. Add a
regression covering both values of the option with distinct active and
invoking windows, and update the changelog.
2026-10-16 23:09:18 +08:00
Kovid Goyal
8e99fba8ec
Fix #10668
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-16 07:35:45 +05:30
Kovid Goyal
f78106e296
Cleanup previous PR
- Back off on all accept() errors that leave the connection pending, not
  just resource exhaustion, so the talk thread cannot spin on a readable
  listener
- Use an atomic for the test only accept failure injection instead of
  taking the talk mutex on every accept
- Encrypt disk cache entries in chunks of up to 1MB to reduce the number
  of write syscalls for large images
- Have GlobalWatchers.set_extra() invalidate the cached watchers
2026-10-09 11:14:45 +05:30
rudolf-blue
b9b7e0b29c Stop the talk thread from blocking on peer sockets 2026-10-08 23:59:57 -04:00
rudolf-blue
806c86b9b3 Keep the talk thread running after transient accept() errors 2026-10-08 23:59:57 -04:00
Lucas TAVEAU
988242d4d2 feat: add remote control for OS window titles [feature/UAT-set-os-window-title] 2026-08-10 09:52:16 +02:00