Rename kitty-tool to kitten

It's easier to type, and cuter.

Also, most, if not all of the TUI parts of
kitty's kittens will eventually be re-written into kitten.

The only downside I can see is that we cant tab complete kitty
anymore, but hopefully there will be less reason to run kitty
from the shell as command line tools migrate to kitten.

Meowrrrr!!!
This commit is contained in:
Kovid Goyal
2023-01-14 15:40:34 +05:30
parent 60310ced05
commit 6b8e5ea225
35 changed files with 103 additions and 103 deletions

View File

@@ -209,14 +209,14 @@ _ksi_main() {
_ksi_prompt[ps0]+="\[\e]133;C\a\]"
fi
alias edit-in-kitty="kitty-tool edit-in-kitty"
alias edit-in-kitty="kitten edit-in-kitty"
if [[ "${_ksi_prompt[complete]}" == "y" ]]; then
_ksi_completions() {
builtin local src
builtin local limit
# Send all words up to the word the cursor is currently on
builtin let limit=1+$COMP_CWORD
src=$(builtin printf "%s\n" "${COMP_WORDS[@]:0:$limit}" | builtin command kitty-tool __complete__ bash)
src=$(builtin printf "%s\n" "${COMP_WORDS[@]:0:$limit}" | builtin command kitten __complete__ bash)
if [[ $? == 0 ]]; then
builtin eval "${src}"
fi
@@ -224,7 +224,7 @@ _ksi_main() {
builtin complete -F _ksi_completions kitty
builtin complete -F _ksi_completions edit-in-kitty
builtin complete -F _ksi_completions clone-in-kitty
builtin complete -F _ksi_completions kitty-tool
builtin complete -F _ksi_completions kitten
fi
# wrap our prompt additions in markers we can use to remove them using

View File

@@ -1,7 +1,7 @@
function __ksi_completions
set --local ct (commandline --current-token)
set --local tokens (commandline --tokenize --cut-at-cursor --current-process)
printf "%s\n" $tokens $ct | command kitty-tool __complete__ fish | source -
printf "%s\n" $tokens $ct | command kitten __complete__ fish | source -
end
complete -f -c clone-in-kitty -a "(__ksi_completions)"

View File

@@ -1,7 +1,7 @@
function __ksi_completions
set --local ct (commandline --current-token)
set --local tokens (commandline --tokenize --cut-at-cursor --current-process)
printf "%s\n" $tokens $ct | command kitty-tool __complete__ fish | source -
printf "%s\n" $tokens $ct | command kitten __complete__ fish | source -
end
complete -f -c kitty-tool -a "(__ksi_completions)"
complete -f -c kitten -a "(__ksi_completions)"

View File

@@ -1,7 +1,7 @@
function __ksi_completions
set --local ct (commandline --current-token)
set --local tokens (commandline --tokenize --cut-at-cursor --current-process)
printf "%s\n" $tokens $ct | command kitty-tool __complete__ fish | source -
printf "%s\n" $tokens $ct | command kitten __complete__ fish | source -
end
complete -f -c kitty -a "(__ksi_completions)"

View File

@@ -156,8 +156,8 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
end
end
function edit-in-kitty --wraps "kitty-tool edit-in-kitty"
kitty-tool edit-in-kitty $argv
function edit-in-kitty --wraps "kitten edit-in-kitty"
kitten edit-in-kitty $argv
end
function __ksi_transmit_data -d "Transmit data to kitty using chunked DCS escapes"

View File

@@ -18,14 +18,14 @@ script_path="$(command readlink -f "$0" 2> /dev/null)"
script_dir="$(command dirname "$script_path")"
install_dir="$(command dirname "$script_dir")/install-tool"
remote_kitty_version_file="$script_dir/../version"
local_kitty_version_file="$install_dir/installed-kitty-tool-version"
kitty_exe="$install_dir/kitty-tool"
local_kitty_version_file="$install_dir/installed-kitten-version"
kitty_exe="$install_dir/kitten"
local_kitty_version=""
[ -f "$kitty_exe" -a -x "$kitty_exe" ] && exec_kitty "$@"
# Use kitty-tool from the downloaded kitty installation, if available.
embed_exe="$(command dirname "$script_dir")/install/bin/kitty-tool"
# Use kitten from the downloaded kitty installation, if available.
embed_exe="$(command dirname "$script_dir")/install/bin/kitten"
[ -f "$embed_exe" -a -x "$embed_exe" ] && {
kitty_exe="$embed_exe"
exec_kitty "$@"
@@ -38,7 +38,7 @@ case "$(command uname)" in
'NetBSD') OS="netbsd";;
'OpenBSD') OS="openbsd";;
'DragonFlyBSD') OS="dragonfly";;
*) die "kitty-tool pre-built binaries are not available for the $(command uname) operating system";;
*) die "kitten pre-built binaries are not available for the $(command uname) operating system";;
esac
if command -v curl 2> /dev/null > /dev/null; then
@@ -56,7 +56,7 @@ elif command -v wget 2> /dev/null > /dev/null; then
command wget --quiet -O- "$1"
}
else
die "Neither curl nor wget available, cannot download kitty-tool"
die "Neither curl nor wget available, cannot download kitten"
fi
case "$(command uname -m)" in
@@ -74,20 +74,20 @@ release_version=$(fetch_quiet "https://sw.kovidgoyal.net/kitty/current-version.t
}
release_version="v$release_version"
# no kitty-tool available till 0.27.0
# no kitten available till 0.27.0
case "$release_version" in
v0.26.*) release_version="nightly";;
esac
url="https://github.com/kovidgoyal/kitty/releases/download/$release_version/kitty-tool-$OS-$arch"
url="https://github.com/kovidgoyal/kitty/releases/download/$release_version/kitten-$OS-$arch"
printf "\033[33mkitty-tool needs to be installed\033[m\n\n"
printf "\033[33mkitten needs to be installed\033[m\n\n"
command mkdir -p "$install_dir"
printf "Downloading kitty-tool from: \033[32m%s\033[m\n\n" "$url"
printf "Downloading kitten from: \033[32m%s\033[m\n\n" "$url"
download_dest="$(command mktemp "$kitty_exe.XXXXXXXXXX")"
fetch "$url" > "$download_dest" || {
command rm -f "$download_dest"
die "Failed to download kitty-tool"
die "Failed to download kitten"
}
command chmod 755 "$download_dest"
command mv "$download_dest" "$kitty_exe"

View File

@@ -34,7 +34,7 @@ is_wrapped_kitten() {
test "(" "$1" = "+kitten" -a -n "$(is_wrapped_kitten "$2")" ")" -o "(" "$1" = "+" -a "$2" = "kitten" -a "$(is_wrapped_kitten "$3")" ")" && {
if [ "$1" = "+kitten" ]; then shift "1"; else shift "2"; fi
exec kitty-tool "$@"
exec kitten "$@"
}
lock_dir=""

View File

@@ -3,5 +3,5 @@
(( ${+commands[kitty]} )) || builtin return
builtin local src cmd=${(F)words:0:$CURRENT}
# Send all words up to the word the cursor is currently on.
src=$(builtin command kitty-tool __complete__ zsh "_matcher=$_matcher" <<<$cmd) || builtin return
src=$(builtin command kitten __complete__ zsh "_matcher=$_matcher" <<<$cmd) || builtin return
builtin eval "$src"

View File

@@ -107,7 +107,7 @@ _ksi_deferred_init() {
builtin autoload -Uz -- $comp_dir/_kitty
compdef _kitty kitty
compdef _kitty clone-in-kitty
compdef _kitty kitty-tool
compdef _kitty kitten
fi
# If compdef is not set, compinit has not run yet. In this case we must
@@ -386,7 +386,7 @@ _ksi_deferred_init() {
fi
builtin unset KITTY_IS_CLONE_LAUNCH KITTY_CLONE_SOURCE_STRATEGIES
alias edit-in-kitty="kitty-tool edit-in-kitty"
alias edit-in-kitty="kitten edit-in-kitty"
# Map alt+left/right to move by word if not already mapped. This is expected behavior on macOS and I am tired
# of answering questions about it.