Skip to content

kitten stub: suppress download during tab completion when binary absent - #10219

Closed
kovidgoyal with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-kittee-stub-script-issue
Closed

kitten stub: suppress download during tab completion when binary absent#10219
kovidgoyal with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-kittee-stub-script-issue

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

When kitten ssh installs the stub script on a remote and the actual kitten binary hasn't been downloaded yet, tab-completing any kitten-backed command triggers a download with a yellow warning — disruptive and unexpected in a completion context.

Changes

  • Completion hooks set KITTY_SHELL_INTEGRATION_COMPLETION=1 before invoking kitten __complete__ <shell>:

    • shell-integration/bash/kitty.bash — inline prefix on command kitten
    • shell-integration/zsh/completions/_kitty — inline prefix on command kitten
    • shell-integration/fish/vendor_completions.d/kitty.fish — inline prefix on command kitten
    • shell-integration/fish/vendor_completions.d/kitten.fish — same
  • Stub script exits silently when invoked in completion context without a binary (shell-integration/ssh/kitten): after the existing binary checks (which exec if found), bail out cleanly:

    [ -n "$KITTY_SHELL_INTEGRATION_COMPLETION" ] && exit 0

    This sits after the two exec_kitty paths, so a present binary is still used normally.

…nary not installed

When the kitten stub script (shell-integration/ssh/kitten) is invoked in
a shell completion context but the actual kitten binary has not yet been
downloaded, it previously tried to download kitten and showed a yellow
warning message. This was disruptive during tab completion.

Fix by:
- Having completion hooks (bash, zsh, fish) set KITTY_SHELL_INTEGRATION_COMPLETION=1
  in the environment when calling kitten for completions
- Having the stub script check for this env var and exit silently (exit 0)
  when the kitten binary is not yet available

Fixes: #10218
Copilot AI changed the title Fix kitten stub script to silently exit during tab completion when binary not installed kitten stub: suppress download during tab completion when binary absent Jul 3, 2026
Copilot AI requested a review from kovidgoyal July 3, 2026 17:53
@kovidgoyal

Copy link
Copy Markdown
Owner

@copilot: Actually rather than using an env var check if the first argument in complete and exit in that case, no need for an env var. Drop your previous commit and create a new one implementing this.

@kovidgoyal kovidgoyal closed this Jul 3, 2026
@kovidgoyal
kovidgoyal deleted the copilot/fix-kittee-stub-script-issue branch July 3, 2026 18:01
Copilot stopped work on behalf of kovidgoyal due to an error July 3, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants