From 1da79e1ac48ef615f21aa5009e186d2c41878d2a Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 12 Sep 2025 20:19:33 +0200 Subject: [PATCH] Use default completion in eshell to mimic standard shell behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using vertico to complete file names feels irritating – I just want to have completion automatically until a common prefix and will navigate from there with additional input or wildcards. --- init.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 099b834..b2fdbf9 100644 --- a/init.el +++ b/init.el @@ -2787,6 +2787,8 @@ Note that this workaround is incomplete, as explained in this comment." (require 'em-hist) (require 'em-glob)) + (require 'db-eshell) + (setenv "PAGER" "cat") (add-to-list 'eshell-command-completions-alist @@ -2842,7 +2844,12 @@ Note that this workaround is incomplete, as explained in this comment." #'(lambda () (setq-local pcomplete-termination-string ""))) - (require 'db-eshell))) + ;; Use default completion functions to allow partial completion of candidates that can + ;; then be extended with wildcards and the like. This is what I am used to in shells + ;; outside of Emacs. + (add-hook 'eshell-mode-hook + #'(lambda () + (setq-local completion-in-region-function #'completion--in-region))))) (use-package em-prompt :commands (eshell-previous-prompt