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
The Go parser had its own copy of the edge name mapping, which had drifted
from the Python one. Generate the Go mapping from the Python one so there
is a single source of truth, and share the documentation of the spacing
syntax between set-spacing and launch --spacing, documenting the long
forms.
Closes#10712
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
The I/O and talk threads can call glfwPostEmptyEvent() until
Boss.destroy() joins them, which is after the main loop has returned and
released the NSLock, so they could message a freed lock. The lock only
guarded a single flag, so replace it with an atomic exchange. This
removes the lifetime problem entirely, is cheaper than locking on every
wakeup, also fixes the unsynchronized access of the flag from the main
thread and no longer drops wakeups posted before the main loop starts.
Closes#10705
wayland_titlebar_color, macos_titlebar_color, scrollbar_handle_color and
scrollbar_track_color store a special value in their lowest byte with
actual colors shifted into the upper bytes. The Go client sent them as
plain RGB values, so kitty interpreted the blue component as the special
value, for example, scrollbar_track_color=#ff0000 used the foreground
color. It also rejected special values such as background and dark.
Encode them the same way as the Python parsers do.
Pass the CLI options to parse_colors_and_files instead of reading
global state, and have it set all and configured when reset is
specified, matching the Python client.
Read conf files with the standard config parser so that tabs,
indentation, long lines and include directives work, and report
invalid colors instead of silently ignoring them. Non-color settings
and special values of colors such as wayland_titlebar_color are still
ignored, as in the Python client.
Allow special_parse functions to take over fields that are backed by
options in the generated Go remote control code.
Skip color argument parsing for --reset, as documented and already done
by the Python command path. Add a payload-creation regression covering
invalid colors, missing files and valid colors with and without reset.
./dev.sh build unpacks the prebuilt dependencies, headers included,
into the gitignored dependencies folder. autoformat walks it and runs
clang-format over the vendored headers and sources there, rewriting
them in place. Skip it like bypy and 3rdparty; setup.py clean already
excludes it.
Go's min/max propagate NaN, so "nan" got past parse_opacity and failed
later with an unclear json.Marshal error, while the Python parser
silently clamped it to 0. Reject NaN in both, report a clear error
message for invalid opacity values, and replace the regression test with
a table test of parse_opacity covering clamping and invalid inputs.
5c4f6b39b removed the timer in Window.destroy() so that it cannot call
back into a destroyed window, but 100c78bbb dropped those lines again,
presumably by accident. Closing a window whose program had reported
progress via OSC 9;4 then leaves the timer running, and once the
progress goes stale clear_progress_if_needed() raises:
AttributeError: 'Window' object has no attribute 'screen'
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.
When the connection of an existing ControlMaster to the server dies
without the master noticing, for example after a network change or
suspend, new sessions using it hang. ssh -O check does not detect this
as it only talks to the master over its local socket.
Check the master in parallel with starting the session, using a request
that requires a round trip to the server, so that there is no added
latency when the master is healthy. If the master does not respond in
time, kill the stuck session, stop the master and start the session
again over a new connection. Similarly time out the port forward request
used by forward_remote_control and retry it with a new master.
Fixes#10691
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.
The output file for a regular file was only created when the
decompressor first emitted data, which never happens for an empty file.
So empty files were not created and existing destination files were
left with their old contents. Open the output file as soon as the first
chunk for a regular file arrives instead.
Closes#10689
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.