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.
An empty only_window_ids meant every window was selectable, so for example
select-window --exclude-active in a single window tab returned the active
window. Use None to mean unrestricted instead.
Closes#10683
Store fixed OS window titles at creation time so they can be queried,
and add an only_if_overridden flag to get_os_window_title so callers
can distinguish a custom title from the cached active window title.
The detach_tab chooser now uses the custom OS window title if any,
falling back to the tab's effective title.
This also fixes launch --os-window-title=current not copying a fixed
title and Wayland CSD titles of fixed title windows not being
re-rendered on font size changes.
Closes#10681
When tab_title_max_length is set, size the vertical tab bar to fit the
decorations drawn by the current tab_bar_style instead of always adding
eight cells. Also allow powerline tabs in vertical tab bars to show a
title in a narrow tab bar, since the separator has a column of its own.
Fixes#10680
Apply the --exclude-active filter in RemoteCommand.windows_for_payload so
every command using it honors the flag, instead of each command filtering
by hand. Extend the send-key test to cover --match, --match-tab and the
default active window fallback.
Exclude the active window before dispatching keys when requested. Add a
regression covering both values of the option with distinct active and
invoking windows, and update the changelog.
A parent directory without search permission prevents changing the
permissions of its children, so apply the deferred chmods in reverse
order, as GNU tar does. Also add a test and changelog entry for #10676.
Keys whose snapshot no longer exists, for example because it was deleted
by a cache cleaner or because the keychain was locked when deleting it,
are deleted when saving at logout, when claiming snapshots at startup and
when removing all snapshots. This is done with the snapshot lock held, so
snapshots being saved or restored are never affected. Only keys with the
format of the ids kitty creates are deleted.
Every snapshot is encrypted with AES-256-GCM using a random key, stored
in the login keychain under a random id. The name of every file is
authenticated, so files cannot be swapped. The key is deleted before the
snapshot whenever it is removed, so copies of the snapshot left on disk
or in backups cannot be read.
The keychain is never allowed to show any UI. If storing the key fails
nothing is saved, if reading it fails the snapshot is deleted, with the
error logged in both cases.
The key is generated, stored and read only in C, in mlocked memory that
is cleared when freed, via a new random_secret() and the Keychain
functions in cocoa_window.m.
A new option restore_session_after_logout. When macOS asks kitty to quit
because the user is logging out, restarting or shutting down, every kitty
instance saves a snapshot: its session, including OS Window geometry, the
scrollback of every window and the command line, working directory and
environment of the instance.
The next kitty started without a session or command to run claims all
snapshots, restores the one saved by an instance with the same command
line itself and starts a separate kitty instance for each of the others,
so every instance keeps its own command line arguments and environment.
Snapshots are deleted only after their windows have been created. A
snapshot that fails to restore twice, for example because kitty crashed,
is deleted. Snapshots from an earlier logout that were never restored are
deleted when saving, using the wall clock start time of the process.
Restored scrollback is parsed before the child is allowed to run, after
the window has its final size. Only the scrollback and screen are saved,
not the scrollback pager history. Before parsing, everything except SGR,
OSC 8 and OSC 66 is removed, so a modified snapshot cannot run escape
codes such as OSC 52, and the restored output has no shell integration
marks. Programs other than the shell are not started again.
A quit is treated as being for a logout only if it is confirmed within
LOGOUT_CONFIRMATION_TIMEOUT of the logout request, and not if the quit
was cancelled in between.
Fixes#1197
The geometry of fullscreen OS Windows is the one from before they were made
fullscreen. On macOS this is now also recorded when using native fullscreen
via the window buttons/menu.
This applies to --position, remember_window_position and positions from
sessions, which could otherwise place the window on a monitor that is no
longer connected.
When an on_quit watcher aborted a quit, the application quit request was
left as CONFIRMABLE_CLOSE_REQUESTED, so process_pending_closes() called
boss.quit() on every tick.