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
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.
Reconcile the three ported kittens with 529 upstream commits. Only conflicts
were in the shrunk resize_window/broadcast/remote_file main.py stubs (upstream
reformatted their OPTIONS strings); resolved by keeping upstream's formatting
plus the Go-port stubs (shrunk main, remote_file handle_result shim, dropped
-h alias). Go build + kitten tests pass; dev build regenerates CLI cleanly;
Python suite at baseline (1 pre-existing unrelated failure).
Adds kittens/remote_file/main.go (ask menu, hostname-mismatch prompt,
save-path prompt with tab completion, edit/open/save actions) on top of the
ControlMaster/ssh helpers from the previous two commits, registers it in
tools/cmd/tool/main.go, and adds remote_file to shell-integration/ssh/kitty's
wrapped_kittens list so both `kitty +kitten remote_file` and ssh-session
invocations exec the Go binary directly. main.py is shrunk to option_text
(kept importable by kitty/cli_stub.py and used for --doc/--help generation),
is_ssh_kitten_sentinel (kept importable by kitty/window.py), and the
handle_result shim boss.py runs in-process to open the returned file.
Also drops the dead `-h` alias on --hostname: Python's CLI layer always
special-cases -h/--help ahead of user options, so it never worked as a
hostname shorthand, but the Go CLI layer hard-errors on the collision; removing
it is a no-op for existing behavior (boss.py only ever passes --hostname) and
unblocks `kitten remote-file --help`. Also adds the same reset_terminal()
calls Python makes between UI phases (ask menu -> action, hostname-mismatch
prompt, overwrite prompt, $EDITOR handoff) so the Go and Python screens match.
Manually verified parity against Python (ask menu, cancel, open/edit/save
download+upload round-trips, hostname-mismatch Y/N, save-path prompt and
overwrite O/A/R/N) using a fake-ssh test double, and confirmed post-wrap that
`kitty +kitten remote_file` execs the Go kitten binary.
Add a Go-based command_palette kitten that provides a searchable,
interactive overlay for browsing and triggering keyboard shortcuts
and actions.
- New Go kitten at kittens/command_palette/ with FZF fuzzy search,
grouped/flat views, and remote control action triggering
- Python collect_keys_data() does data collection, passed via stdin
- Navigation: arrows, ctrl+j/k (vim), ctrl+n/p (emacs), page up/down
- Enter triggers the selected action via RC command
- Help text displayed in footer for selected binding
- Added Go tests (main_test.go) and Python tests (command_palette.py)
If the user's bash profile contains 'set -u' / 'set -o nounset'
(to protect against typos in variable names; think "rm -Rf $TMp/*"),
starting a new kitty terminal resulted in a
bash: sourced: unbound variable
message. Also, the error disabled kitty's shell integration.
This PR fixes/supersedes bba4ce22, which was based on an incorrect
assumption.
If the user's bash profile contains 'set -u' (to protect against typos
in variable names; think "rm -Rf $TMp/*"), starting a new kitty terminal
resulted in a spurious `bash: sourced: unbound variable` message.
Remove usage of the `-P` option from the print inside the
`_ksi_precmd` and `_ksi_preexec` functions. Instead, the result of
`builtin print -Pn "%m"` is stored in the local variable `hostname`.
This mitigates accidental expansion of variables in the command to be
executed.
Fixes#8193.
On some Macs (e.g. M1, 2020), `uname` returns 'Darwin' and `uname -m`
retuns 'arm64', this case is not handled in shell-integration. As a
result, ssh kitten transfer fails with:
>> Unknown CPU architecture arm64
Fix this by adding the case for arch=arm64 in kitten and kitty
shell-integration scripts.
Tested this on Mac Pro (M1, 2020).
The upcoming fish 3.8 release will output OSC 133 sequences
unconditionally [1].
I tested ctrl-shift-{g,x,z} bindings both without and with kitty's
shell integration on top; everything seems to work.
Let's simplify kitty integration by removing the markers for the
upcoming fish >= 3.8.
I have hopes that the native OSC 133 implementation address #7200
though I'm not sure if I could reproduce this bug (I only saw a
similar bug when `fish_handle_reflow` was not enabled, which fish
also does now (same commit)).
cc @iacore let me know if you can reproduce #7200 with latest fish master.
[1]: 3b9e3e251b