Commit graph

1637 commits

Author SHA1 Message Date
Miro Hrončok
dcd67580f5 tests: accept coreutils >= 9.12 shell-quoted env output in test_ssh_env_vars
Since coreutils 9.12, env shell-quotes values written to a terminal
by default (a pty counts as one, see coreutils issue #355 for the
history: https://github.com/coreutils/coreutils/issues/355).

This makes the literal, unquoted match for TSET= in
test_ssh_env_vars no longer find the value, so the test times out
waiting for it and eventually surfaces as an EIO reading from the pty
once the child has already exited. Accept the shlex-quoted form of
the value as well, since the ssh kitten's own env-passing code does
not use env and is unaffected.

Observed failure (Fedora rawhide buildroot with coreutils-9.12-1.fc46):

    ======================================================================
    ERROR: test_ssh_env_vars (kitty_tests.ssh.SSHKitten.test_ssh_env_vars)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "kitty_tests/__init__.py", line 461, in wait_till
        self.process_input_from_child(timeout=end_time - time.monotonic())
      File "kitty_tests/__init__.py", line 449, in process_input_from_child
        data = os.read(self.master_fd, io.DEFAULT_BUFFER_SIZE)
    OSError: [Errno 5] Input/output error

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "kitty_tests/__init__.py", line 250, in wrapper
        return func(*args, **kwargs)
      File "kitty_tests/ssh.py", line 146, in test_ssh_env_vars
        pty.wait_till(lambda: 'TSET={}'.format(tset.replace('$A', 'AAA')) in pty.screen_contents())
      File "kitty_tests/__init__.py", line 464, in wait_till
        raise Exception(f'Failed to read from pty with error: {e}. {self.screen_contents_for_error()}') from e
    Exception: Failed to read from pty with error: [Errno 5] Input/output error. Screen contents as repr:
    '...\nA=AAA\nTSET=\'AAA-$(echo no)-`echo no2` !Q5 "something else"\'\n...'

    Ran 337 tests in 19.341s
    FAILED (errors=1, skipped=3)

Assisted-By: Claude Sonnet 5
2026-09-22 13:42:05 +02:00
Kovid Goyal
a908167e98
Fix the IPC lock used by custom shader compilation 2026-09-22 15:21:40 +05:30
白鸽
2faf4b051c Splits: Resize adjacent regions consistently when dragging dividers 2026-09-22 17:09:21 +08:00
白鸽
629fec3750 Handle empty iterables before testing their truthiness 2026-09-22 16:30:29 +08:00
Kovid Goyal
2795eac486
add test for IME around cursor 2026-09-19 15:51:09 +05:30
Kovid Goyal
ff7681336f
... 2026-09-19 12:10:40 +05:30
Kovid Goyal
fd65a44c1e
Fix #10496 2026-09-19 11:55:08 +05:30
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
Kovid Goyal
c85bcda29c
Linux only allow single instance socket use by same user
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-09-18 14:54:49 +05:30
Kovid Goyal
dcedd186de
edit-in-kitty: Harden parsing of edit commands received from clients
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-09-17 19:56:56 +05:30
Kovid Goyal
5db43982c8
Fix #10491 2026-09-17 17:03:58 +05:30
Kovid Goyal
701f40b5c8
fix #10490
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-09-17 14:22:59 +05:30
Kovid Goyal
d37f845293
cleanup previous PR fixing one regression and doing code cleanups 2026-09-16 12:57:51 +05:30
Kovid Goyal
d20a0acb3a
Merge branch 'feature/inactive-shader-tint' of https://github.com/xiaobai050/kitty 2026-09-16 11:36:26 +05:30
Kovid Goyal
65b02b21f4
Splits: Fix issues with proportional sizing
Fixes found while reviewing #10471:

- A window squeezed to zero size (by maximize or an extreme bias) was
  indistinguishable from a removed one, so closing an unrelated window
  handed its share to windows in sub-trees that lost nothing. Track
  survivors separately from the numeric weight.

- Pruning a batch of windows gave a different layout than closing them
  one by one, since a perpendicular sub-tree stops being perpendicular
  once removals collapse it. Apply the policy one window at a time.

- Windows reconciled by do_layout(), rather than split off an existing
  window, bypassed the policy entirely. Route them through it too.

Also fix two pre-existing bugs on the same code paths:

- collapse_redundant_pairs() collapsed top down, so a pair whose
  children only became empty during the recursion was never
  re-examined and was left in the tree, consuming its share of the
  space.

- do_layout() kept using a stale pairs root when removing windows
  collapsed the tree, so windows added in the same relayout were
  attached to the discarded root and vanished for a frame.
2026-09-16 10:47:59 +05:30
Kovid Goyal
791614ce93 Merge branch 'splits-proportional' of https://github.com/xiaobai050/kitty
# Conflicts:
#	kitty_tests/layout.py
2026-09-16 09:23:31 +05:30
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
Kovid Goyal
a11839a2c7
Merge branch 'fix/nested-split-border-resize' of https://github.com/xiaobai050/kitty 2026-09-16 08:42:29 +05:30
Kovid Goyal
b0b5c286c5
cleanup previous PR and fix some bugs I doscovered while doing it 2026-09-15 22:04:44 +05:30
Kovid Goyal
bde35f3dd0
Merge branch 'feature/tab-to-split' of https://github.com/xiaobai050/kitty 2026-09-15 20:03:11 +05:30
Kovid Goyal
bab67650e2
Test suite: Fix small numbers of Python tests being run in incorrect environment
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
Also fix env reporting. Fixes #10478
2026-09-15 16:50:21 +05:30
Kovid Goyal
87ab3e98f4
Graphics protocol: Fix file descriptor leak that can be triggered by malicious clients
Also make failure responses generic to avoid leaking any filesystem
information to failed opens
2026-09-14 21:03:15 +05:30
白鸽
18023eaafa Custom shaders: Clear cached programs when disabling shaders 2026-09-14 22:41:26 +08:00
白鸽
7b41e33399 Custom shaders: Redraw static effects only on demand 2026-09-14 22:41:26 +08:00
白鸽
cf33820973 Custom shaders: Support tinting complete inactive windows 2026-09-14 22:41:26 +08:00
白鸽
120cad0cba Fix native tab drop completion and offset hit testing 2026-09-14 20:07:58 +08:00
白鸽
82085561a0 Splits: Preserve perpendicular shares on batch removal 2026-09-14 20:07:57 +08:00
白鸽
7faf714da2 Allow dropping single-window tabs into another tab layout 2026-09-14 19:17:54 +08:00
白鸽
cced6bb355 Splits: Add optional proportional sizing 2026-09-14 19:17:53 +08:00
白鸽
d3d3f1735d Splits: Resize the correct divider in nested layouts 2026-09-14 19:17:51 +08:00
Kovid Goyal
6dc6d1cc54
Fix buffer overflow in the shaped run cache key
fill_key() sizes its scratch buffer assuming every cell holds at most
MAX_NUM_CODEPOINTS_PER_CELL codepoints. The draw paths in screen.c
enforce that, but Line.add_combining_char() does not, so a line built via
the Python API with more codepoints in a cell overflows the key buffer
once the run is long enough. Bail out of caching such runs instead.
2026-09-09 09:29:25 +05:30
Kovid Goyal
df999b05e5 Fix drag gesture state leaking past the button event early returns
Follow-ups to the drag_or_normal_select selected text drag support:

- Reset the pending drag at the top of handle_button_event again, before
  the scrollbar, missing screen and mouse position early returns. Moving
  it into a helper placed it after those returns, so a scrollbar track
  click (with scrollbar_jump_on_click disabled) no longer cleared an
  armed URL drag, letting it fire on a later mouse move with no button
  held. Split the helper in two, as arming the drag needs an up to date
  mouse position but clearing it does not.

- Clear the click queue for all drag kinds, not just text drags. A native
  drag consumes mouse-up, so the press lingered and turned the next press
  into a double press, selecting a word instead of starting a new
  gesture. Reproducible with link drags before this change.

- Note that handle_potential_drag can call into Python, which can
  re-alloc the windows array, so w must not be used after it returns.

Also share the drag thumbnail construction between drag_url and
drag_selection (and skip the thumbnail rather than dividing by zero on a
zero width render), use None instead of -1 for the mock event pixel
position so negative positions remain testable, and tighten the
off-by-one bound in clear_click_queue.
2026-09-08 18:51:02 +05:30
Kovid Goyal
d90869a8c6 Merge branch 'feature/drag-selected-text' of https://github.com/xiaobai050/kitty 2026-09-08 18:44:56 +05:30
rudolf-blue
18bddffcca Raise the maximum font size and fix the legacy zoom limit
The ceiling in change_font_size is ten times the configured font_size, so
the largest size you can reach depends on the size you configured. With
font_size 6 zooming stops at 60pt, while font_size 20 reaches 200pt. That
is backwards: a small configured font is if anything a reason to want a
larger temporary zoom, not a smaller one.

Use the larger of that multiple and an absolute 256pt. No existing setup
loses range, since the multiple still wins whenever it is the bigger of
the two. The bounds and the clamp move into options/utils.py so the
numbers are in one place and can be tested directly.

increase_font_size also had its own cap of five times font_size. That was
the old limit, missed when 25d8d9fe6 raised change_font_size to ten, and
because the wrapper clamps before delegating, the stale bound is the one
that wins. Both legacy wrappers can simply drop their bounds: they go
through change_font_size, which already clamps.
2026-09-07 19:41:08 -04:00
白鸽
2cd6733c75 Allow dragging selected text with drag_or_normal_select 2026-09-06 21:16:02 +08:00
Kovid Goyal
49b7bf6646
Fix #10434
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-09-04 03:58:20 +05:30
Kovid Goyal
ede47d2f93
file transfer protocol: harden against malicious clients planting symlinks
This is actually not a security boundary for this protocol. Since it is
explicitly *not* designed to be proof against malicious clients.
However, to avoid more AI generated security reports against it...
2026-09-01 22:23:24 +05:30
Kovid Goyal
03fbdad855
Color control protocol: Respond to unknown field names safely using base64 encoding 2026-09-01 21:20:04 +05:30
Kovid Goyal
398fa49084
Skip test inapplicable on macOS 2026-09-01 20:28:26 +05:30
Kovid Goyal
3281919056
ssh kitten: Verify owner and permissions of SHM memory used for askpass
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-09-01 20:14:03 +05:30
NightWatcher
376e72ded8 Add configurable rounded window borders 2026-08-29 22:30:04 +08:00
Kovid Goyal
64fa6ff111
Speed up pixel compositing with SIMD vectorization
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
Alpha blending of graphics protocol images and animation frames is
2-3.5x faster and glyph alpha masks are composited onto canvases using
the same vectorized primitives
2026-08-29 09:53:38 +05:30
Hassan Raza
bf7d908e3f
Parse goto_session options when discovering sessions 2026-08-28 16:21:17 +05:00
Hassan Raza
bd2d09e467
Fix EOF handling for empty DnD transfers 2026-08-28 14:01:04 +05:00
Hassan Raza
9c557f917b
Fix explicit stdin sources in the DnD kitten 2026-08-28 13:19:25 +05:00
Hassan Raza
e31a5e4e07
Fix empty hints selection handling 2026-08-28 11:49:17 +05:00
Hassan Raza
99fb1b8aca
Fix notification close mode 2026-08-28 11:20:05 +05:00
Hassan Raza
1229f19f6d
Restore hints named-group program arguments 2026-08-27 21:55:56 +05:00
Hassan Raza
4a19654bc2
Fix composed frame metadata 2026-08-27 15:09:14 +05:00