Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell-integration/bash/kitty.bash
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ _ksi_main() {
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 kitten __complete__ bash)
src=$(builtin printf "%s\n" "${COMP_WORDS[@]:0:$limit}" | KITTY_SHELL_INTEGRATION_COMPLETION=1 builtin command kitten __complete__ bash)
if [[ $? == 0 ]]; then
builtin eval "${src}"
fi
Expand Down
2 changes: 1 addition & 1 deletion shell-integration/fish/vendor_completions.d/kitten.fish
Original file line number Diff line number Diff line change
@@ -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 kitten __complete__ fish | source -
printf "%s\n" $tokens $ct | KITTY_SHELL_INTEGRATION_COMPLETION=1 command kitten __complete__ fish | source -
end

complete -f -c kitten -a "(__ksi_completions)"
2 changes: 1 addition & 1 deletion shell-integration/fish/vendor_completions.d/kitty.fish
Original file line number Diff line number Diff line change
@@ -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 kitten __complete__ fish | source -
printf "%s\n" $tokens $ct | KITTY_SHELL_INTEGRATION_COMPLETION=1 command kitten __complete__ fish | source -
end

complete -f -c kitty -a "(__ksi_completions)"
4 changes: 4 additions & 0 deletions shell-integration/ssh/kitten
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ embed_exe="$(command dirname "$script_dir")/install/bin/kitten"
exec_kitty "$@"
}

# If called in a shell completion context with no kitten binary available, do nothing
# to avoid downloading kitten and showing spurious output during tab completion.
[ -n "$KITTY_SHELL_INTEGRATION_COMPLETION" ] && exit 0

case "$(command uname)" in
'Linux') OS="linux";;
'Darwin') OS="darwin";;
Expand Down
2 changes: 1 addition & 1 deletion shell-integration/zsh/completions/_kitty
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
(( ${+commands[kitten]} )) || 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 kitten __complete__ zsh "_matcher=$_matcher" <<<$cmd) || builtin return
src=$(KITTY_SHELL_INTEGRATION_COMPLETION=1 builtin command kitten __complete__ zsh "_matcher=$_matcher" <<<$cmd) || builtin return
builtin eval "$src"
Loading