From 00b905fad1df55475f9f19f254d7e385d6560c1a Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sun, 2 Nov 2025 20:19:02 -0800 Subject: [PATCH] Prevent ehsell-starship extensions from applying to hidden files --- elisp/eshell-starship.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/elisp/eshell-starship.el b/elisp/eshell-starship.el index 34fd11d..7afd52a 100644 --- a/elisp/eshell-starship.el +++ b/elisp/eshell-starship.el @@ -856,6 +856,12 @@ That is, if EXT is \"pkg.tar.gz\", this will return (eshell-starship--permute-extension (eshell-starship--file-name-extension file)))) +(defun eshell-starship--hidden-file-p (name) + "Return non-nil if the file with NAME is hidden. +Name must be the name of a file, not a path. Thus, is cannot have any '/' +characters in it." + (and (cl-plusp (length name)) (= (aref name 0) ?.))) + (defun eshell-starship--modules-for-dir (dir) "Return a list of modules that are applicable to DIR." (let ((is-remote (eshell-starship--remote-for-modules-p dir))) @@ -872,7 +878,8 @@ That is, if EXT is \"pkg.tar.gz\", this will return (copy-sequence (eshell-starship--module-by :dirs name)) (apply 'append (eshell-starship--module-by :files name) - (eshell-starship--extension-modules-for-file name))))) + (unless (eshell-starship--hidden-file-p name) + (eshell-starship--extension-modules-for-file name)))))) (directory-files-and-attributes dir nil nil t))) (let ((default-directory dir)) (cl-loop for (name is-dir module) in eshell-starship--extra-module-files