GNU bug report logs -
#65604
[PATCH] Display the exit code if the last command failed in Eshell
Previous Next
Reported by: Davide Masserut <dm <at> mssdvd.com>
Date: Tue, 29 Aug 2023 22:45:01 UTC
Severity: normal
Tags: patch
Fixed in version 30.1
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#65604: [PATCH] Display the exit code if the last command failed in Eshell
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 65604 <at> debbugs.gnu.org.
--
65604: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65604
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Version: 30.1
On 9/2/2023 11:54 AM, Davide Masserut via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
>
>> The prompt regexp is (thankfully) almost irrelevant in Emacs 30
>> now. It only matters for paragraph-movement commands, which we could
>> probably just remap to the actual Eshell-specific commands to navigate
>> forward and backward through the prompts. I should probably just make
>> a patch for this and finally get rid of that regexp entirely.
>
> I didn't know that, thanks.
I've now made it fully-obsolete, so it doesn't do anything anymore (now,
Eshell implements its own paragraph navigation based on fields).
> Sorry, I meant that if we decided to show a relative long message like
> "Running" in the mode-line, then we should show it only when it lasts
> for more than, let's say, 0.5s. This would prevent the mode-line from
> moving to right for just a fraction of a second when running fast
> commands like cd or ls.
Hmm, that's true. One benefit of the current mode-line implementation
for Eshell is that the indicator always takes up the same width. I'll
keep thinking about this.
>> ... in any case, maybe the simplest way forward here is to put the
>> (non-zero) exit status in the prompt like your original patch, and
>> then separately, I can try to improve the customizability of the
>> prompt, as well as thinking about what to do with the mode-line.
>
> I have updated the patch.
Thanks. I rebased it on top of my changes and pushed it to master as
3d08d0dd80a. Closing this bug now.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
Tags: patch
There are commands that fail without printing any messages, but
set specific error codes.
This patch extends the default prompt function to show the exit
code of the previous failed command.
Before:
~ $ false
~ $
After:
~ $ false
~ [1] $
I believe this is a good default, since it is displayed only when
a error occurs and hopefully makes debugging easier by showing the
error code without further input.
In GNU Emacs 30.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.17.8) of 2023-08-29 built on T480s
Repository revision: ed77dc17f657d99ccf23778c14f06f7226f478f0
Repository branch: master
System Description: Arch Linux
Configured using:
'configure -C --prefix /home/davide/.local --with-pgtk
--with-native-compilation --enable-link-time-optimization
--enable-locallisppath=/usr/share/emacs/site-lisp/
'CFLAGS=-march=native -O2''
[0001-Display-the-exit-code-if-the-last-command-failed-in-.patch (text/patch, attachment)]
This bug report was last modified 1 year and 256 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.