9563 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
d68608b35a Fix tab bar edge strips rendered with opacity < 1 when background_opacity < 1 2026-07-03 02:56:41 +00:00
copilot-swe-agent[bot]
252d8b73f7 Fix superfluous tab bar margin when background_opacity < 1 (issue #10212) 2026-07-03 02:42:28 +00:00
Kovid Goyal
9cd2c60064 Clean previous PR 2026-06-29 06:17:08 +05:30
amoena
207b22aa80 fix(erase_last_command): erase the most recent command even empty output
erase_last_command selected the region to erase via find_cmd_output(..., -1),
which anchors on OUTPUT_START (OSC, 133;C). Commands that produce no output
(an empty Enter, a comment, cd, export, etc. -- never emit 133;C, so they were
skipped and an older command-with-output was erased instead. "Erase the last
command" therefore did not erase the last command whenever the most recent ones
has no output.

Select the region by prompt marks instead: erase the prompt block immediately
above the current (live) prompt, whatever it contains. Every submittd command
is now one unit, removed newest-first, one prompt block per invocation.

This also fixes two latent defects in the previous implementation:

* The on-screen deletion was anchored at `cursor->y - count`, which
  assumes the region ends exactly one row above the cursor.
  Multi-line prompts and skipped rows broke that assumption and left
  residual lines. Anchor at the top of the region instead.

* When part of the erased region was in the scrollback, the lines
  were removed from the history buffer but no redraw was signalled,
  so the deletion of the off-screen lines only became visible after
  the next scroll event recomputed the history viewport. Clamp
  scrolled_by to the new history length and call dirty_scroll()
  after shrinking the buffer.

include_prompt is retained for API compatibility but is now a no-op: the
unit erased is always the whole prompt block.
2026-06-28 11:17:01 -03:00
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
39ba5e271f ... 2026-06-25 16:26:42 +05:30
Kovid Goyal
253d6561de pep8 2026-06-25 16:23:15 +05:30
copilot-swe-agent[bot]
c2e7ee19d2 Change set_uint_at_address to use METH_FASTCALL, skip ctypes test on intel macs 2026-06-25 10:49:19 +00:00
copilot-swe-agent[bot]
f6d813dc26 Fix NULL address check and add docstring to set_uint_at_address 2026-06-25 10:39:14 +00:00
copilot-swe-agent[bot]
c35ff2e843 Replace ctypes in marks.py with C-level set_uint_at_address function 2026-06-25 10:35:11 +00:00
bjoernab
9e54a4e08c Fixed some spelling 2026-06-24 22:27:17 +02:00
Kovid Goyal
d3c7889395 When queueing dnd data to send to the client keep space available in the queue so that inut events are not dropped while the dnd is in progress 2026-06-24 10:58:31 +05:30
Kovid Goyal
903d2a5335 ... 2026-06-24 08:43:16 +05:30
Kovid Goyal
c6e823b3de Code cleanup 2026-06-24 07:57:30 +05:30
Kovid Goyal
dbba05de5c Merge branch 'copilot/fix-arm64-build-error' of https://github.com/kovidgoyal/kitty 2026-06-24 07:26:47 +05:30
Kovid Goyal
7f9373ffd1 Check tuple set item index 2026-06-24 07:02:38 +05:30
copilot-swe-agent[bot]
8a1780a800 Fix ARM64 Linux GCC build error caused by simde/arm/neon.h 2026-06-24 01:29:19 +00:00
copilot-swe-agent[bot]
d5037b5bed Tighten STAT format 4 value parsing 2026-06-23 16:35:35 +00:00
copilot-swe-agent[bot]
ce931d8b11 Fix STAT format 4 parsing pointer advance 2026-06-23 16:32:14 +00:00
Kovid Goyal
5fae28d804 macOS: Fix incorrect horizontal alignment when using text sizing protocol
Fixes #10179
2026-06-23 21:46:01 +05:30
Kovid Goyal
d114388553 Cleanup previous PR 2026-06-21 13:23:58 +05:30
Kovid Goyal
54a7841d18 Merge branch 'bvolpato/vertical-tab-bar-side' of https://github.com/bvolpato/kitty 2026-06-21 13:18:10 +05:30
copilot-swe-agent[bot]
051a5b72e0 Preferentially evict transient images before non-transient ones under storage pressure 2026-06-19 06:48:39 +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
copilot-swe-agent[bot]
946867bf57 Fix first Wayland window wrong cell count with fractional scale (issue 10146) 2026-06-19 02:43:17 +00:00
Kovid Goyal
ec2cc29de7 Dont expose method used only for testing to wider code 2026-06-19 07:28:52 +05:30
copilot-swe-agent[bot]
0901fcbc21 Fix description of alternate/alternate_scrollback extents 2026-06-18 11:12:56 +00:00
copilot-swe-agent[bot]
6b2bb97cb5 Add alternate and alternate_scrollback extents to get-text remote control command 2026-06-18 08:25:39 +00:00
Kovid Goyal
a685af8c35 version 0.47.4 2026-06-15 08:11:46 +05:30
Strykar
fbd4e5ad1f freetype: do not apply the fontconfig size-fixup matrix to color glyphs
ee937bdd1b routed FC_MATRIX through the cairo font matrix so synthetic
slant reaches color glyphs. But FC_MATRIX is also how fontconfig encodes
the pixel-size fixup of fixed-size faces. Noto Color Emoji is a ~109px
bitmap strike and fontconfig hands consumers a matrix scaling it to the
requested size (factor = requested_px / strike_px). cairo_set_font_size()
already brings the strike to the requested size, so feeding that matrix
into cairo_set_font_matrix() in apply_cairo_font_size() scales it down
again by the fixup factor. At terminal cell sizes that is a large shrink,
up to ~9x for small cells (easing to 1x as the cell nears the strike), so
color emoji render as a dot; fit_cairo_glyph() only shrinks, so it never
grows them back.

Only the shear carries synthetic slant; the diagonal is the size, which
cairo_set_font_size() and fit_cairo_glyph() already handle. Apply only
the shear and fall through to cairo_set_font_size() when there is no
shear. Pure-slant matrices are unchanged. This carries only the shear to
color glyphs, so a non-uniform diagonal scale from a hand-built FC_MATRIX
is dropped on that path; the stock fixup is uniform, so dropping it is
the intended behaviour.

Add a regression test that renders a color emoji and checks it fills its
cells, skipped unless a fixed-size color font with a fontconfig fixup
matrix is present.

Fixes #10144
2026-06-14 15:14:04 +05:30
Kovid Goyal
aa4e94cef5 Merge branch 'render-time-matrix' of https://github.com/Strykar/kitty 2026-06-13 12:49:05 +05:30
Kovid Goyal
b15e047a47 version 0.47.3 2026-06-12 09:57:55 +05:30
Kovid Goyal
cb1e64ffc5 Merge branch 'fix-tabs-mouse-handling-stuck' of https://github.com/ttys3/kitty 2026-06-12 09:46:23 +05:30
Strykar
8be2a10b29 fonts: attach synthetic-italic FC_MATRIX to found roman faces
fontconfig's FcFontList omits FC_MATRIX from its object set
(kitty/fontconfig.c), so a roman font that find_best_match finds there
(e.g. Fira Code, which ships no italic, in both its static and variable
builds) carries no synthetic-italic shear and its "italic" renders upright.
A family that is not found is substituted, and when the substitute
resolves through the listed faces those descriptors are equally
matrix-less, so this attach covers them too. Only raw fc_match
descriptors (runtime glyph-fallback faces via create_fallback_face, and
find_best_match's last-resort return) already carry the matrix from
substitution.

The italic intent for the configured faces exists only during selection,
not at face construction, so attach the matrix at the end of
get_font_files: for an italic slot whose chosen face is upright and has no
matrix, ask fc_match what fontconfig would do. fc_match returns a synthetic
matrix only when there is no real italic to use (no italic face and no
slanted named instance or variable slant axis), so a font that is already
italic, static or variable, is never double-slanted. Face construction
applies the matrix via FT_Set_Transform; the previous commit makes it
survive the size specialization step the render path builds faces from.
Only the matrix is taken, so selection is unchanged.

FontConfigPattern declared matrix as a required key, but pattern_as_dict
sets it only when the pattern has one, so declare it NotRequired. With
that and narrowing on descriptor_type the attach needs no cast.

Add a regression test (test_synthetic_italic_matrix): a roman no-italic
font gets a non-identity matrix on its italic slot while a real-italic
control does not, and the matrix survives specialize_font_descriptor. It
asserts the invariant rather than the exact shear (the value is
fontconfig's, version-dependent) and skips when the synthetic rule is
inactive.

Covers the four configured faces. Limitation: fc_match re-matches by family
name, so under an uncommon config (a multi-face family key plus a user
per-font FC_MATRIX rule keyed on width/style) it can attach a matrix
computed for a different face; the 90-synthetic shear this targets is
weight-independent and unaffected. A production version should re-match the
selected face by path+index+slant.
2026-06-11 00:57:59 +05:30
Strykar
779a49acde fonts: preserve the font matrix when specializing a descriptor
specialize_font_descriptor() re-resolves a descriptor by file, index,
size and dpi to pick up size dependent fields. The re-match carries no
slant request, so fontconfig cannot re-derive a synthetic italic matrix,
and only index, named_style and axes were copied back from the base
descriptor. Any FC_MATRIX on the descriptor was therefore lost on every
sized face build, so the face was constructed without it and
FT_Set_Transform was never called, rendering the glyphs upright.

Descriptors can carry FC_MATRIX since b3e7c3e ("Read FC_MATRIX from
fontconfig"). Copy the matrix back like the other selection derived
fields the re-match cannot reproduce.
2026-06-10 13:57:30 +05:30
ttyS3
dc36e21654 fix(tabs): mouse handling stuck after aborted tab drag on Wayland
A quick click-and-flick on a tab could leave all of kitty with mouse
input permanently redirected to the tab bar, making every window
unclickable and text selection impossible.

Starting a tab drag is asynchronous: the drag thumbnail is rendered on
the next frame before glfwStartDrag is called. If the button is
released in that window, wl_data_device_start_drag is sent with a stale
serial that no longer matches an active pointer implicit grab, so the
compositor silently ignores it. The wl_data_source then never receives
any event, on_drag_source_finished never runs, and the
tab_being_dragged state is stuck forever, hijacking all mouse events.

Fix in layers:
- glfw/Wayland: track the implicit grab (serial of the first button
  press and pressed-button count), use that serial for start_drag and
  refuse with EAGAIN when there is no active implicit grab instead of
  letting the compositor silently drop the request
- mouse.c: a left button release arriving while a tab drag is marked
  started but no system DND is active means the drag never launched
  (an active DND consumes the release on all platforms), so clear the
  drag state instead of waiting for DND events that will never come
- tabs.py: handle OSError from start_drag_with_data for tab drags the
  same way window drags already do; clear the potential-drag state when
  the release lands on the new-tab button or empty tab bar area
- tabs.py/boss.py: clear drag state on drag finish/drop even when the
  dragged tab has already been closed

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 03:43:25 +00:00
Kovid Goyal
dbf52d4870 Mark matrix as not required in the fontconfig typeddict as the C code adds it only when the pattern contains a matrix 2026-06-10 08:32:14 +05:30
Kovid Goyal
949a1e1fb1 Merge branch 'fix/focus-follows-mouse-desktop-switch-v2' of https://github.com/lxcode/kitty 2026-06-10 08:05:57 +05:30
Kovid Goyal
238573e799 Fix splits layout options serialization
Fixes #10124
2026-06-10 07:34:47 +05:30
Kovid Goyal
424fe9991b Sanitise color control responses for shells that still dont use the kitty keyboard protocol 2026-06-09 06:21:15 +05:30
David Thiel
1cc1a445e3 Fix focus_follows_mouse switching active window on desktop/space return
When focus_follows_mouse is enabled, returning to a desktop/space fired an
enter event that switched the active window to whichever one was under the
cursor, even though the mouse had not crossed a window boundary.

Distinguish genuine mouse motion into a window from a window reappearing
under a stationary cursor by checking, in cursor_enter_callback, whether the
cursor position actually changed. focus_follows_mouse now switches focus only
when the cursor moved, so motion into a window still switches focus while a
stationary reappearance does not.
2026-06-08 14:46:40 +01:00
Kovid Goyal
79a768ed55 Merge branch 'followup-b-cairo-matrix' of https://github.com/Strykar/kitty 2026-06-08 12:26:06 +05:30
Kovid Goyal
55425e2e75 Show secure input indicator on active tab 2026-06-08 11:22:54 +05:30
Kovid Goyal
d20fe4d4b5 version 0.47.2 2026-06-07 09:37:24 +05:30
Kovid Goyal
470a70db57 Remind user to not transfer files from machines they dont trust 2026-06-07 06:52:27 +05:30
Kovid Goyal
40ed8cfd3c fontconfig: ignore failure to return FC_INDEX assume its zero
Sigh. The number of creative ways Linux systems can be broken.
See #10112
2026-06-06 18:46:15 +05:30
Kovid Goyal
4aa4a5c056 File transfer protocol: use O_NOFOLLOW when opening regular files 2026-06-03 06:18:31 +05:30
Kovid Goyal
4043e99b75 Merge branch 'copilot/show-secure-input-in-menubar' of https://github.com/kovidgoyal/kitty 2026-06-01 13:11:30 +05:30