-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
Broken filename completion in eshell with Emacs 28.1 #2504
Comments
I suggest you use helm-eshell instead of generic completion-at-point: (cond ((= emacs-major-version 27)
(define-key eshell-mode-map (kbd "TAB") 'helm-esh-pcomplete))
((= emacs-major-version 28)
(define-key eshell-hist-mode-map (kbd "TAB") 'helm-esh-pcomplete))
(t (define-key eshell-mode-map [remap eshell-pcomplete] 'helm-esh-pcomplete))) See https://github.com/thierryvolpiatto/emacs-config/blob/main/init.el#L1600 for details. |
Thanks, it works with the slight addition of (require 'em-hist)
(cond ((= emacs-major-version 27)
(define-key eshell-mode-map (kbd "TAB") 'helm-esh-pcomplete))
((= emacs-major-version 28)
(define-key eshell-hist-mode-map (kbd "TAB") 'helm-esh-pcomplete))
(t (define-key eshell-mode-map [remap eshell-pcomplete] 'helm-esh-pcomplete))) |
ikappaki ***@***.***> writes:
What happened?
Completion at point (hitting <TAB>) on a subpath replaces the subpath
with the last subdirectory instead of completing
How to reproduce?
in Emacs 28.1, using the helm repo installed in d:/src as an example
directory layout when trying to complete the helm/images path from
Eshell:
1. M-x eshell, opens the eshell prompt
Welcome to the Emacs shell
d:/src $
2. d:/src $ helm/im<TAB>, replaces helm/im with `images'
d:/src $ images/
The expected behaviour (as in earlier Emacs versions) is to complete the path, e.g.:
d:/src $ helm/images/
Ok, I reproduced this bug (on Linux) and could fix it, however Emacs
seems confused when completing such a filename without a leading
meaningful shell command e.g. cd or ls, shell refuse to complete such
path even with this fix, probably its completion-at-point-functions
prevent this, don't know, anyway all others terms (xterm etc...) allow
this.
Note that pcomplete directly called from eshell complete this properly
(Try C-c TAB), helm-eshell as specified in other post handle this also
(you have better time always using this).
Will merge soon, looking if this fix doesn't trigger other bugs.
Thanks.
… Helm Version
Master branch
Emacs Version
Emacs-28/29
OS
Windows
Relevant backtrace (if possible)
No response
Minimal configuration
• [*] I agree using a minimal configuration
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.*Message ID: ***@***.***>
--
Thierry
|
This fix the default eshell completion based on completion-at-point which fails to complete a filename not preceded by a meaningful command like cd or ls. Pcomplete and helm-eshell are working properly in this case. Problem is that the base-size returned by completion-all-completions in this case is always zero (seems it assume we are trying to complete a command even if the metadata specify a file completion) To fix it we try here to recalculate the base-size from the last / found.
Seems fixed now, closing. |
I reverted the fix done here for now as it is not working with bash-completion (see #2532). |
This reverts commit 452dd1b.
What happened?
Completion at point (hitting
<TAB>
) on a subpath replaces the subpath with the last subdirectory instead of completingHow to reproduce?
in Emacs 28.1, using the helm repo installed in
d:/src
as an example directory layout when trying to complete thehelm/images
path from Eshell:M-x eshell
, opens the eshell prompthelm/im<TAB>
, replaceshelm/im
withimages
The expected behaviour (as in earlier Emacs versions) is to complete the path, e.g.:
Helm Version
Master branch
Emacs Version
Emacs-28/29
OS
Windows
Relevant backtrace (if possible)
No response
Minimal configuration
The text was updated successfully, but these errors were encountered: