1471 Commits

Author SHA1 Message Date
Mark Stuart
852fc4a662 Add equalize action and equalize_on_close option to Splits layout
Adds an `equalize` layout action that redistributes split sizes so each
window receives a proportional share of space along each axis.

Also adds an `equalize_on_close` layout option that automatically
equalizes splits whenever a window is closed, keeping the remaining
windows balanced without requiring an explicit key binding.

These two features compose well. For example, to keep splits balanced
at all times - equalizing on every open and close:

    enabled_layouts splits:equalize_on_close=true
    map ctrl+' combine : launch --location=hsplit --cwd=current : layout_action equalize
    map ctrl+/ combine : launch --location=vsplit --cwd=current : layout_action equalize

A standalone key binding for manual rebalancing is also supported:

    map ctrl+shift+e layout_action equalize
2026-05-29 20:02:42 +01:00
Kovid Goyal
3fc5bed364 Merge branch 'decst8c' of https://github.com/aymanbagabas/kitty 2026-05-27 08:38:45 +05:30
Kovid Goyal
c7622683c8 Cleanup previous PR 2026-05-27 08:31:41 +05:30
Ayman Bagabas
c68a1654d3 feat(vt): add support for DECST8C escape sequence
Recognize CSI ? 5 W as DECST8C, which resets the active screen's tab
stops to the default of every 8 columns. Other CSI W variants continue
to produce a parse error.

Signed-off-by: Ayman Bagabas <aymanbagabas@gmail.com>
2026-05-26 21:12:27 -04:00
Ayman Bagabas
3138ae4aad fix(screen): preserve tab stops across window resizes
Previously, every window resize reinitialised the tab stops to the
default of every 8 columns, discarding any stops set via HTS or cleared
via TBC. ECMA-48 only treats RIS, DECSTR, and DECCOLM as events that
reset tab stops, and other terminal emulators all preserve user-set
stops across an interactive resize.

Copy the surviving prefix of the previous tab stops into the freshly
allocated array on both main and alt screens. Newly added columns when
growing the window keep the default every 8 columns pattern. Also point
the active tabstops pointer at the alt screen's array when a resize
happens while the alt screen is active, instead of unconditionally
resetting it to the main screen's array.

Signed-off-by: Ayman Bagabas <aymanbagabas@gmail.com>
2026-05-26 21:12:27 -04:00
Hassan Raza
f413f528af Preserve copy_or_noop passthrough 2026-05-20 11:15:49 +05:00
Hassan Raza
d77c94e3aa Avoid shell quoting in ssh login fallback 2026-05-19 23:14:08 +05:00
Hassan Raza
c0db371afe Quote ssh bootstrap symlink moves 2026-05-19 16:54:02 +05:00
copilot-swe-agent[bot]
d5a6c072d9 Add data URI support to dnd kitten parse_uri_list
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/dd371733-fa08-484e-888a-8d0ebdadb853

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-18 07:54:57 +00:00
copilot-swe-agent[bot]
0062495e96 fix drop_update_mimes: use exact MIME matching and correct sentinel value
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/c41c0c3f-f9c8-4638-a4c4-64961b030f35

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-17 16:45:07 +00:00
copilot-swe-agent[bot]
05b288e754 Address code review: use PATH_MAX buffer and move os import to top
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/da8b4577-3de8-4784-afc0-c1967f605dec

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-17 15:34:56 +00:00
copilot-swe-agent[bot]
634c078168 Fix empty file not created when dragging from remote Linux to Finder
When dragging an empty file (or a directory containing an empty file)
from a remote Linux machine to macOS Finder, the empty file would not
be copied.

Root cause: in add_payload() in dnd.c, the file is only created with
O_CREAT when payload data arrives. For an empty file, no payload is
ever sent, so the file was never created on disk. When Finder then
tried to hard-link the (non-existent) temp file to the destination, it
failed silently.

Fix: in the "all data received" handler for type 0 (regular file),
check if the fd was ever opened. If not (empty file), create the empty
file explicitly before finishing.

Also add:
- A new test probe drag_remote_item_path:N to retrieve the filesystem
  path of a specific remote item by URI index.
- Two regression tests: test_remote_drag_empty_file (verifying the
  empty file is created on disk) and test_remote_drag_dir_with_empty_file
  (verifying an empty child file inside a directory is created on disk).

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/da8b4577-3de8-4784-afc0-c1967f605dec

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-17 15:31:15 +00:00
Kovid Goyal
3e0850a864 Fix failing test 2026-05-17 08:52:28 +05:30
n-WN
708372f249 tests: regression for apply_selection with paused-rendering + scrollback
Add a regression test that exercises the code path which crashed in
v0.46.2 (#10017): when paused_rendering is active and a selection
extends into the scrollback, the inner loop of apply_selection iterates
with a negative y. Without the recently-added paused_y translation and
the paused_y < 0 guard, the call to linebuf_init_line treats the
negative y as a huge unsigned index_type and reads ~4GB out of bounds
in line_attrs[idx], crashing with SIGBUS.

The test reproduces the trigger deterministically via the Screen Python
bindings and asserts that current_selections() returns the expected
buffer instead of crashing.
2026-05-16 17:00:01 +08:00
Kovid Goyal
6d4371f596 Properly pass source actions to drop events
Implemented for Wayland. Needs implementation for X11 and macOS
2026-05-14 11:07:52 +05:30
copilot-swe-agent[bot]
8acb6e7ecb Address review comments: rename variable and improve comments
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/41b8254d-fc79-4f41-9775-67d1ddfceb5b

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-14 02:53:15 +00:00
copilot-swe-agent[bot]
66dca3cde1 Fix dnd kitten: restrict drop to boxes matching drag source allowed operations
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/41b8254d-fc79-4f41-9775-67d1ddfceb5b

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-14 02:49:17 +00:00
Kovid Goyal
0a69b89a80 More work on dnd kitten 2026-05-12 12:23:57 +05:30
Kovid Goyal
12bdf972e0 ... 2026-05-12 09:37:16 +05:30
Kovid Goyal
4e3a3ba6ab Fix infinite wait in test 2026-05-12 09:36:30 +05:30
Kovid Goyal
634f13e65f More work on dnd kitten 2026-05-11 21:51:23 +05:30
Kovid Goyal
43b028bd6a Finish terminal side port of new dnd sub protocol 2026-05-11 13:39:43 +05:30
Kovid Goyal
07ec007388 Start work on porting code to new remote drag source protocol 2026-05-10 05:04:46 +05:30
Kovid Goyal
a0da884c6a Add optional error descriptions to drop errors as well 2026-05-09 12:24:43 +05:30
Kovid Goyal
21d8b2bcc0 Add descriptions to error codes for drag sources 2026-05-09 09:58:38 +05:30
copilot-swe-agent[bot]
96df7d7b43 Add tests for dnd query response
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/c73a0723-2890-4786-a97c-b40cc6c198e2

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-06 03:24:55 +00:00
Kovid Goyal
247ac6df59 Drag source delete on drop should only be done for remote drops 2026-05-05 21:49:42 +05:30
copilot-swe-agent[bot]
6129fd66b3 Delete source files on move drag, clear drag_sources and allow_drags
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/2f6384ba-c55a-4842-83a9-4cf1b0937420

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-05 16:10:19 +00:00
Kovid Goyal
b6a7724369 ... 2026-05-05 15:37:45 +05:30
copilot-swe-agent[bot]
fe6807c9b0 implement move deletion and add tests for dnd kitten drop
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/e2238746-2319-43e5-9b01-4899e7f06b50

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-05 09:37:50 +00:00
Kovid Goyal
fd7e43ab0c Make detection of command line flags that prevent sudo from overriding TERMINFO more robust 2026-05-05 09:38:07 +05:30
copilot-swe-agent[bot]
89ab2946ff Implement text drag thumbnail support using draw_window_title with nerd font fallback
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/6be6bfeb-64f8-466f-bf80-62915fabb5b4

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-04 04:46:53 +00:00
Kovid Goyal
4fe29f2630 dd basic drag thumbnail support to dnd kitten 2026-05-03 22:18:18 +05:30
Kovid Goyal
3a144e1d6e More work on dnd kitten 2026-05-03 17:09:03 +05:30
Kovid Goyal
0de313e178 More work on the dnd kitten 2026-05-03 13:06:56 +05:30
Kovid Goyal
7d468cb000 More work on dnd kitten 2026-05-03 06:54:43 +05:30
Kovid Goyal
a87441b91a Fix failing test 2026-05-02 17:16:27 +05:30
Kovid Goyal
d3114ec948 More work on the dnd kitten 2026-05-02 15:18:11 +05:30
Kovid Goyal
511ef6db31 More work on DnD kitten 2026-05-02 08:06:44 +05:30
copilot-swe-agent[bot]
4d55d30614 Enhance regression test with additional geometry validity assertions
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/3b0c9eab-24ba-4934-a941-be477477cee4

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-01 15:05:34 +00:00
copilot-swe-agent[bot]
20185fc317 Fix display corruption when maximizing horizontal split with window_padding_width >= 4 (issue #9946)
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/3b0c9eab-24ba-4934-a941-be477477cee4

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-01 15:04:46 +00:00
Kovid Goyal
cff2e6efcf ... 2026-05-01 12:49:50 +05:30
Kovid Goyal
197115cb95 More work on the dnd kitten 2026-05-01 12:37:35 +05:30
Kovid Goyal
614a32c790 More work on DnD kitten 2026-05-01 08:48:21 +05:30
copilot-swe-agent[bot]
777c1aa718 Update symlink tests to reflect new top-level symlink protocol behavior
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/9d43f7a2-9a0f-4749-aab8-bf72b82e7277

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-30 04:13:51 +00:00
Kovid Goyal
ee84e68ca4 Have top level symlink behavior match for local and remote drops 2026-04-30 09:38:17 +05:30
Kovid Goyal
79bf7ef1a4 Cleanup previous PR 2026-04-30 09:23:22 +05:30
copilot-swe-agent[bot]
0615823d15 Add text/uri-list edge case tests and overwrite confirmation tests to dnd_kitten_drop
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/cc433db7-b78f-4174-a6a7-1ba6e51955ac

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-29 13:27:02 +00:00
Kovid Goyal
8bbce578f2 Basic dnd test working 2026-04-29 17:59:33 +05:30
Kovid Goyal
1d6f695140 More work on dnd kitten 2026-04-29 17:46:12 +05:30