GNU bug report logs - #76853
M-b not navigating to the previous word in the prompt string inside Eshell on emacs 30.1

Previous Next

Package: emacs;

Reported by: Hrishikesh S <hrish2006 <at> gmail.com>

Date: Sat, 8 Mar 2025 06:54:02 UTC

Severity: normal

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Hrishikesh S <hrish2006 <at> gmail.com>
Subject: bug#76853: closed (Re: bug#76853: M-b not navigating to the
 previous word in the prompt string inside Eshell on emacs 30.1)
Date: Mon, 10 Mar 2025 05:42:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#76853: M-b not navigating to the previous word in the prompt string inside Eshell on emacs 30.1

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 76853 <at> debbugs.gnu.org.

-- 
76853: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76853
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Kangas <stefankangas <at> gmail.com>
To: Hrishikesh S <hrish2006 <at> gmail.com>, Jim Porter <jporterbugs <at> gmail.com>
Cc: 76853-done <at> debbugs.gnu.org
Subject: Re: bug#76853: M-b not navigating to the previous word in the prompt
 string inside Eshell on emacs 30.1
Date: Mon, 10 Mar 2025 05:41:40 +0000
Hrishikesh S <hrish2006 <at> gmail.com> writes:

> I see.. Thanks for the response! I will try setting
> `'inhibit-field-text-motion` and test.
>
> I'm used to using `M-b` a lot when I'm inside eshell as it lets me copy
> parts of my current directory when running commands
> (e.g: copy the git branch I'm on before pushing, etc), so found the change
> to be a bit jarring. As long as there is a way
> to get back the old behavior, I have no complaints :)

Thanks, so I guess we can therefore close this bug.

I'm doing that with this message.

[Message part 3 (message/rfc822, inline)]
From: Hrishikesh S <hrish2006 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: M-b not navigating to the previous word in the prompt string inside
 Eshell on emacs 30.1
Date: Fri, 7 Mar 2025 13:58:35 -0800
[Message part 4 (text/plain, inline)]
In GNU Emacs 30.1, System Description:  macOS 15.2

which I installed by simply running "brew install emacs" on my work machine,
when I'm inside the eshell buffer, typing `M-b` does not take me back by a
word like how it used to be.

Apologies if the bug doesn't have enough information, but I was able to
verify this behavior on a fresh, clean install, without any of my
configuration or installed packages by running

"emacs -Q" and observing the same behavior.

I searched through existing bug reports and this seems like a new issue.

My relevant emacs config:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; eshell
;;
(require 'em-smart)
(setq eshell-history-size 10000)
(setq eshell-prompt-regexp "^[^#$]*[#$] ")


(defun curr-dir-git-branch-string (pwd)
  "Returns current git branch as a string, or the empty string if
PWD is not in a git repo (or the git command is not found)."
  (interactive)
  (when (and (eshell-search-path "git")
             (locate-dominating-file pwd ".git"))
    (let ((git-output (shell-command-to-string (concat "cd " pwd " && git
branch | grep '\\*' | sed -e 's/^\\* //'"))))
      (propertize (concat " ["
              (if (> (length git-output) 0)
                  (substring git-output 0 -1)
                "(no branch)")
              "]") 'face `(:foreground "green"))
      )))

(setq eshell-prompt-function
      (lambda ()
        (concat
         (propertize ((lambda (p-lst)
            (if (> (length p-lst) 3)
                (concat
                 (mapconcat (lambda (elm) (if (zerop (length elm)) ""
                                            (substring elm 0 1)))
                            (butlast p-lst 3)
                            "/")
                 "/"
                 (mapconcat (lambda (elm) elm)
                            (last p-lst 3)
                            "/"))
              (mapconcat (lambda (elm) elm)
                         p-lst
                         "/")))
          (split-string (pwd-repl-home (eshell/pwd)) "/")) 'face
`(:foreground "yellow"))
         (or (curr-dir-git-branch-string (eshell/pwd)))
         (propertize " # " 'face 'default))))

(setq eshell-highlight-prompt nil)


Thank you for all the work on emacs!


Regards,
Hrishi
[Message part 5 (text/html, inline)]

This bug report was last modified 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.