Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash: kitten: command not found #7160

Closed
johnnypea opened this issue Feb 26, 2024 · 5 comments
Closed

bash: kitten: command not found #7160

johnnypea opened this issue Feb 26, 2024 · 5 comments
Labels

Comments

@johnnypea
Copy link

MacOS Sonoma 14.3.1
fish, version 3.7.0
kitty 0.32.2

Using kitten ssh but I'm not able to use kitten command in "Debian GNU/Linux 12 (bookworm)" bash shell.

bash: kitten: command not found

Thanks.

@johnnypea johnnypea added the bug label Feb 26, 2024
@kovidgoyal
Copy link
Owner

works fine for me sshing into a bash system. You can always just
manually install it, its a single file static binary available
pre-compiled for all platforms from the kitty releases page. Simply
download and put it somewhere in your PATH on the remote system.

@farhaanbukhsh
Copy link

@johnnypea I don't know if this helps but kitten might be there in kitty.app which is downloaded you can just do a symbolic link for me it was ln -s ~/.local/kitty.app/bin/kitten ~/.local/bin/

@harikattar
Copy link

harikattar commented Jan 2, 2025

I went digging for the root cause of this, and it's because debian hard overwrites PATH in /etc/profile:

if [ "$(id -u)" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi

which is sourced by:

            if [[ "$kitty_bash_inject" != *"no-profile"* ]]; then
                _ksi_sourceable "$KITTY_BASH_ETC_LOCATION/profile" && builtin source "$KITTY_BASH_ETC_LOCATION/profile"
                for _ksi_i in "$HOME/.bash_profile" "$HOME/.bash_login" "$HOME/.profile"; do
                    _ksi_sourceable "$_ksi_i" && { builtin source "$_ksi_i"; break; }
                done
            fi

so we lose the added path component which is sent in the environment. It may make sense to add the ...kitty-ssh-kitten/bin path at the very end of the injection script, so any path manipulation in system/user rc files doesn't remove it.

@kovidgoyal
Copy link
Owner

The injection scripts are meant for shell integration, not making kitten available in PATH. kitten needs to be available in PATH even when shell integration is disabled and thus no scripts are sourced. That is why it is injected via env var manipulation.

Debian really shouldn't be overriding PATH especially for user shells, this can really only be fixed properly in Debian.

I will note that no other major linux distro does this as far as I know. I checked Arch, Fedora and Ubuntu. Checked via

podman run --interactive fedora sh -c "cat /etc/profile; PATH=/some/user/add /bin/bash -ilc 'echo \$PATH'"

Outputs

/root/.local/bin:/root/bin:/usr/local/sbin:/usr/sbin:/some/user/add

as expected /some/user/add is present in PATH
Sombody should really report this to Debian.

@kovidgoyal
Copy link
Owner

I guess waiting for Debian to fix this is pointless, so I will fix it at least for the case of the ssh kitten when shell integration is enabled. If the user disables shell integration then the fix wont work, but ...

@kovidgoyal kovidgoyal reopened this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants