refactor(eshell): swap out {fish,bash}-completion for pcmpl-args

pcmpl-args' completion coverage isn't as complete at
{fish,bash}-completion, but it's much lighter, much faster, and builds
on top of pcomplete. Users will have to alias programs to
pcmpl-args-pcomplete-on-{help,man} to extend support.
This commit is contained in:
Henrik Lissner 2026-02-22 00:44:16 -05:00
parent 9c45601ff3
commit f6a57ed695
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 10 additions and 9 deletions

View file

@ -310,8 +310,12 @@ when inhibited to show history matches."
(add-hook 'eshell-syntax-highlighting-elisp-buffer-setup-hook #'highlight-quoted-mode))
(use-package! fish-completion
:unless (featurep :system 'windows)
:hook (eshell-mode . fish-completion-mode)
:init (setq fish-completion-fallback-on-bash-p t
fish-completion-inhibit-missing-fish-command-warning t))
(use-package! pcmpl-args
:after eshell
:config
(dolist (cmd '("doom" "nix-shell"))
(defalias (intern (concat "pcomplete/" cmd))
#'pcmpl-args-pcomplete-on-help))
(dolist (cmd '("fd" "rg" "exa" "emacsclient"))
(defalias (intern (concat "pcomplete/" cmd))
#'pcmpl-args-pcomplete-on-man)))

View file

@ -7,7 +7,4 @@
(package! esh-help :pin "417673ed18a983930a66a6692dbfb288a995cb80")
(package! eshell-did-you-mean :pin "80cd8c4b186a2fb29621cf634bcf2bcd914f1e3d")
(package! eshell-syntax-highlighting :pin "62418fd8b2380114a3f6dad699c1ba45329db1d2")
(unless (featurep :system 'windows)
(package! fish-completion :pin "1256f137a2039805d4e87f8e6c11a162ed019587")
(package! bash-completion :pin "762f28fefba487e15d626691310f3194804eb71a"))
(package! pcmpl-args :pin "bccbfe931a8383fb4ecc75551305057a9bd33700")