- List the existing files that will be overwritten under the names they
are stored as in the destination, not the dropped names
- Treat symlinks to directories in the destination as directories in
find_overwrites, matching rename_contents, so the files that will be
overwritten inside the symlink target are listed
- Replace an existing file or dangling symlink with a dropped directory
instead of failing the drop after the user confirmed the overwrite
- Fail up front when a dropped file would replace an existing directory
- Also fold Unicode normalization when uniqifying remote drop names
- Probe for filesystem aliasing once before running the alias test
Displays the URL in a box sized to fit it, just below the hovered cell,
like a web browser tooltip. Split render_a_bar() into rendering the text
and drawing it so the width of the rendered text can be used to position
the box.
Also redraw when the hovered cell within a hyperlink changes, as the
position of the displayed target now depends on it.
Controls where the URL shown by show_hyperlink_targets is displayed:
along the top or bottom edge of the window, or immediately below the
hovered line. In all cases the URL is moved to the opposite side if it
would otherwise obscure the hovered line.
Fixes#10770
Preserve the grapheme segmentation state when the drawing line is
re-initialized after the current char has already been segmented, so that
emoji sequences are not split into multiple cells when wrapped or moved
past scaled text.
Mark colors are now stored per color layer and for the colors set by the
program, like the other colors, instead of in a single array that every
change overwrote. So set-colors without --configured no longer changes the
configured mark colors, window and session layer mark colors survive
changes to the global colors, resetting a layer, the color stack and full
reset restore the correct mark colors, --copy-colors copies them and
get-colors reports the mark colors of the window.
Make ColorProfile.test_mark_colors() return MARK_MASK pairs instead of a
hard-coded three, simplify the test by using MARK_MASK and mutable expected
values, and correct the changelog entry: config reload was not affected,
set-colors, launch --color, sessions and automatic theme switching were.
Move writing the MIME list into Output.write_mime_list() and test it
directly. Committing, permission preservation and failure cleanup are
already covered by the existing Output commit tests, so the PTY test
that spawned the kitten only added coverage for the missing commit.
The archive reused the metadata of the top level directory for all nested
directories and both bootstrap implementations recreated directories with
the remote umask.
Stat every directory when building the archive, passing the stat result
explicitly to the header callback and skipping directories that vanish or
are replaced by something else while being copied.
When deploying, move directories not present at the destination intact,
replacing any dangling symlink or file in the way, and merge into existing
directories keeping their permissions. The shell implementation falls back
to creating the directory and merging if the move fails. Make the
temporary directory deletable before removing it as copied directories can
lack write or search permission.
Closes#10727
Program output can remove the highlighted link under the mouse, which
left the hand pointer and the hovered link state stale until the mouse
moved or the modifiers changed. After parsing output, if the highlight
in the hovered window was cleared, reset the hovered link and re-derive
the pointer shape, using the current mouse tracking mode.
Closes#10725
Follow up fixes for link hover feedback from PR #10723:
- Recompute the cell under the mouse when modifiers change, so a stale
cell is not highlighted when the mouse is in the window padding
- Compare against the displayed highlight rather than the old modifiers,
so a change of mouse tracking mode without mouse motion is handled
- Update the hover in the OS window under the mouse, not only in the one
receiving key events
- Keep the hand pointer over a highlighted link when the program changes
the pointer shape
- Do not leave a link highlighted after opening it with a mapping that
does not show hover feedback
- Skip marking hyperlinks that are not going to be highlighted
- Validate url_mappings in set_url_mappings() and ignore it in
--debug-config output
- Make the update_mock_pointer test helper restore only the state it
overrides and keep heap state owned by the mock window
Refresh hover feedback only in the hovered pane when modifier changes alter
whether a single-click link action matches. Preserve resize and drag cursors
and keep OSC 22 pointer updates independent of modifier handling.
Compute link modifier masks while finalizing mouse mappings, clarify the
documentation, and cover the reported regressions with mock pointer events.
Lines whose thickness is specified in pts are now scaled by the ratio of
the current font size to the configured font_size, so they no longer look
too thin when zoomed in or too thick when zoomed out. At the configured
font size nothing changes. This combines with the existing multicell
scale for the text sizing protocol. Sprites are already cached per font
size, so no cache changes are needed.
For the window title bar, the drawn border is kept at least half a pixel
inside the pixels reserved for it, since the rounded rect shader
anti-aliases over a one pixel band on either side of each edge and would
otherwise bleed onto the rendered title.
Fixes#10362
New color_scheme_dark, color_scheme_light and color_scheme_no_preference
options. When any of them is set, the ssh kitten sends the color schemes
for all three system color schemes to kitty, which applies the one
matching the current system color scheme and switches between them when
the system color scheme changes. color_scheme is used for modes without
a specific color scheme.
The colors are applied in a new session color layer, above the colors of
the window and below colors set by programs. They are associated with the
color stack entry pushed by the ssh kitten and are removed when it is
popped, so nested sessions work and the colors are restored on exit.
Configs that only use color_scheme continue to use escape codes exactly
as before, as does the kitten when running inside tmux.
Fixes#10724
Colors in a window are now tracked in layers: the global configured colors
(kitty.conf and the automatic color theme), the colors of the individual
window (launch --color, --copy-colors) and the colors set by the program
running in the window (escape codes, set-colors without --configured).
Switching between light and dark themes changes only the global layer, so
colors set by the ssh kitten, by programs or by launch --color are no
longer overwritten.
Only the colors set by the program are saved on the color stack, so
popping the stack, for example when exiting the ssh kitten, uses the
current theme colors for everything else rather than those from before
the theme change. launch --color colors now also survive config reloads.
set-colors --configured still replaces colors set in the matched windows.
Fixes#10724
Follow configured mouse actions for the hand pointer and hover underline,
and refresh both on modifier changes without requiring mouse movement.
Cover URL detection, hyperlink highlighting, configuration variants, and
link dragging with focused regression tests.
The cmdline, environment and working directory of a window, as reported
by kitten @ ls, used for matching windows and saved in the window state,
now come from the root process, skipping over wrappers kitty inserts
such as /usr/bin/login on macOS. Previously on macOS these described the
login process. Cache the resolved root process so that this is cheap.
On Linux /proc/<pid>/task/<pid>/children only lists the children
created by the main thread, so children created by other threads of
multi-threaded programs were missed. Read the children lists of all
threads instead. On kernels without per thread children lists, build
the full parent to children map once instead of finding nothing. Also
avoid computing the descendants twice when the cgroup contains
processes outside the tree.
When the root process was not in the foreground, cwd=root used the cwd
of the foreground process instead of the root process. Also skip over
wrapper processes that kitty itself inserts, such as /usr/bin/login on
macOS and the run-shell kitten used for --hold, using their first child
as the root process instead. Previously on macOS cwd=root always
resolved to the home directory, the cwd of login.
On Linux, read the children of all threads of a process, since
multi-threaded programs such as kitten can create children from any
thread.
Make cwd_of_child and modify_argv_for_launch_with_cwd use the same
logic for deciding when the reported cwd applies to cwd=root.
Closes#10720
The selection dirty check computed iteration data in a different
coordinate system than apply_selection() used to store last_rendered,
so the two never compared equal when scrolled back, causing the
selection buffer to be re-uploaded and the window redrawn every frame.
Use a common helper for both.
Fixes#10714
Receiving a regular file over an existing symlink or hard link used to
truncate and overwrite the file the link points to. Instead, write
received files to a temporary file in the destination directory and
atomically rename it into place once the transfer completes, as was
already done for delta transfers. This also means interrupted transfers
no longer leave truncated files behind.
If the destination directory is not writable, fall back to writing in
place, but only for regular files with a single link, so that no other
file can be affected.
Also use stat rather than lstat when deciding whether to use delta
transfers, so that symlinks to large files can use them, and remove
the temporary file of failed or aborted delta transfers.
Closes#10713
Refuse to replace an existing directory, or a symlink to a directory, with
a file, reporting EISDIR before any data is transferred instead of a raw
OSError (or silently replacing the symlink). Report failures to create
parent directories with the actual errno and directory name. When a send
fails, the kitten now prints hints for the common causes: a missing
trailing slash on a directory destination and a ~ expanded by the shell
on the remote machine.
Fixes#8118Closes#10710
The title bars shown only for a window drag were hidden before the drop
was classified, which moves the windows, so a drop on a title bar was
treated as a directional insert instead of a swap.
Classify the drop in on_window_drop() before hiding them. On Wayland the
drag source can finish before the drop is delivered, so when the drop is
on kitty, on_drag_source_finished() now leaves hiding them to the drop,
falling back to hiding them if the drop never arrives.
Closes#10709
animation_duration sets how long animation_progress takes to rise to one,
after which it stays there, so effects can fade in and stay on. Previously
groups with no stop duration, such as toggled ones, always had a progress
of zero.
animation_reverse makes a group play its animation in reverse when it stops,
for any reason, instead of turning off immediately. With yes it takes as
long as animation_duration, or a number of milliseconds can be given.
Stopping part way through rising reverses from the current progress and
starting again while reversing rises from there.
animation_loops, used with animation_reverse, plays the animation forwards
and in reverse again after the first reverse, without holding at one, for
effects such as blinking a few times.
Also fix attached groups not having the same animation_progress as the group
they are attached to, as documented, and explain why the per-group values
are in KittyTextures rather than KittyCustomShaderData.
Fixes#10693
Since the notification being replaced has no dbus id yet, it cannot be passed
as the replaces argument to Notify, so close it once the notification server
creates it.
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.
Shell integration: Only wrap run0 when it is installed
Do not define the run0 wrapper in bash/zsh when run0 is not on PATH, as
that makes command -v run0 succeed on systems without it. In zsh, do not
clobber a user defined run0 function. Share the TERMINFO/no-sudo guard
between the sudo and run0 wrappers in fish. Add a test and a changelog
entry.
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.