From a8afe14b93051178264db802d964c7f31a552e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Session=E5=B0=8F=E8=83=A1?= <102411014+SessionHu@users.noreply.github.com> Date: Wed, 5 Aug 2026 18:10:52 +0800 Subject: [PATCH] feat(command-not-found): add alpine support (#13864) --- plugins/command-not-found/README.md | 1 + plugins/command-not-found/command-not-found.plugin.zsh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/plugins/command-not-found/README.md b/plugins/command-not-found/README.md index 5079b1fb5..81f90adfa 100644 --- a/plugins/command-not-found/README.md +++ b/plugins/command-not-found/README.md @@ -32,5 +32,6 @@ It works out of the box with the command-not-found packages for: - [SUSE](https://www.unix.com/man-page/suse/1/command-not-found/) - [Gentoo](https://github.com/AndrewAmmerlaan/command-not-found-gentoo/tree/main) - [Void Linux](https://codeberg.org/classabbyamp/xbps-command-not-found) +- [Alpine Linux](https://pkgs.alpinelinux.org/package/edge/main/x86_64/command-not-found) You can add support for other platforms by submitting a Pull Request. diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index a85dbfdc3..59a86e7d5 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -74,3 +74,10 @@ if [[ -x /usr/bin/command-not-found ]]; then /usr/bin/command-not-found "$1" } fi + +# Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/command-not-found/APKBUILD +if [[ -x /usr/libexec/command-not-found ]]; then + command_not_found_handler() { + /usr/libexec/command-not-found "$1" + } +fi