GNU bug report logs - #61310
Eshell modifying and running output regression

Previous Next

Package: emacs;

Reported by: Morgan Smith <Morgan.J.Smith <at> outlook.com>

Date: Mon, 6 Feb 2023 04:24:01 UTC

Severity: normal

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61310 in the body.
You can then email your comments to 61310 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61310; Package emacs. (Mon, 06 Feb 2023 04:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Morgan Smith <Morgan.J.Smith <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 06 Feb 2023 04:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
To: jporterbugs <at> gmail.com, bug-gnu-emacs <at> gnu.org
Subject: Eshell modifying and running output regression
Date: Sun, 05 Feb 2023 23:18:00 -0500
Hello,

eshell allows you to modify the output of a command and run it.  It is a
beautiful thing.

Example:

$ ls
file.el
$

now go up and append "file" to the output and hit enter.

$ ls
file file.el
$ file file.el
color.el: Lisp/Scheme program, Unicode text, UTF-8 text
$


The ability is currently broken because "file.el" has the field property
set to "command-output" and the "file" command that I added has no
property field.  So currently the previous interaction would actually
yield:

$ ls
file file.el
$ file.el
file.el: command not found
$


This was broken in commit 558f04c39e036d2f681f72556627768d7bee9ab5.  Now
adding the field to eshell prompt makes a lot of sense and I like that.
I don't know much about fields but it looks like it is not necessary to
have a command-output field at all.  I propose we get rid of that.  If
you want to keep the field, can we make it sticky or something?  I just
want the above usecase fixed.


Thanks,

Morgan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61310; Package emacs. (Mon, 06 Feb 2023 05:52:04 GMT) Full text and rfc822 format available.

Message #8 received at 61310 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Morgan Smith <Morgan.J.Smith <at> outlook.com>, 61310 <at> debbugs.gnu.org
Subject: Re: bug#61310: Eshell modifying and running output regression
Date: Sun, 5 Feb 2023 21:51:45 -0800
[Message part 1 (text/plain, inline)]
On 2/5/2023 8:18 PM, Morgan Smith wrote:
> eshell allows you to modify the output of a command and run it.  It is a
> beautiful thing.

Interesting. I didn't realize this was possible in Eshell (I only 
thought you could re-run old *inputs*).

> I don't know much about fields but it looks like it is not necessary to
> have a command-output field at all.  I propose we get rid of that.  If
> you want to keep the field, can we make it sticky or something? 

The output field is actually necessary (or else Eshell would need to be 
cleverer about some things). The main issue is that if a command doesn't 
output a newline, the command's output can end up on the same line as 
the prompt:

  ~ $ *echo -n [output]
  [output]~ $

If the output had no field, C-a would move to the very beginning of the 
line, not to the beginning of the input field. Maybe this is a bug in 
how fields are handled, but changing field handling in general is 
probably too risky.

So instead, let's make the output field sticky as you say. Here's a fix 
for that plus regression tests so this won't break in the future.
[0001-Ensure-that-Eshell-users-can-run-lines-of-command-ou.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61310; Package emacs. (Mon, 06 Feb 2023 06:00:02 GMT) Full text and rfc822 format available.

Message #11 received at 61310 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Morgan Smith <Morgan.J.Smith <at> outlook.com>, 61310 <at> debbugs.gnu.org
Subject: Re: bug#61310: Eshell modifying and running output regression
Date: Sun, 5 Feb 2023 21:59:07 -0800
[Message part 1 (text/plain, inline)]
On 2/5/2023 9:51 PM, Jim Porter wrote:
> So instead, let's make the output field sticky as you say. Here's a fix 
> for that plus regression tests so this won't break in the future.

... and here's a fixed patch that un-breaks a couple other Eshell 
regression tests.
[0001-Ensure-that-Eshell-users-can-run-lines-of-command-ou.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61310; Package emacs. (Tue, 07 Feb 2023 18:18:02 GMT) Full text and rfc822 format available.

Message #14 received at 61310 <at> debbugs.gnu.org (full text, mbox):

From: miha <at> kamnitnik.top
To: Jim Porter <jporterbugs <at> gmail.com>, Morgan Smith
 <Morgan.J.Smith <at> outlook.com>, 61310 <at> debbugs.gnu.org
Subject: Re: bug#61310: Eshell modifying and running output regression
Date: Tue, 07 Feb 2023 19:20:33 +0100
[Message part 1 (text/plain, inline)]
You might also be interested in how comint deals with this. It can
handle the case when the user yanks something in the middle of output as
well. See function comint--mark-as-output, bug#3735 and bug#18135 for
more details.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61310; Package emacs. (Tue, 07 Feb 2023 23:39:01 GMT) Full text and rfc822 format available.

Message #17 received at 61310 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: miha <at> kamnitnik.top, Morgan Smith <Morgan.J.Smith <at> outlook.com>,
 61310 <at> debbugs.gnu.org
Subject: Re: bug#61310: Eshell modifying and running output regression
Date: Tue, 7 Feb 2023 15:37:59 -0800
[Message part 1 (text/plain, inline)]
On 2/7/2023 10:20 AM, miha--- via Bug reports for GNU Emacs, the Swiss 
army knife of text editors wrote:
> You might also be interested in how comint deals with this. It can
> handle the case when the user yanks something in the middle of output as
> well. See function comint--mark-as-output, bug#3735 and bug#18135 for
> more details.

Good call. Here's a patch that (mostly) copies those comint functions 
over to Eshell.
[0001-Ensure-that-Eshell-users-can-run-lines-of-command-ou.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61310; Package emacs. (Fri, 10 Feb 2023 06:40:02 GMT) Full text and rfc822 format available.

Message #20 received at 61310 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: miha <at> kamnitnik.top, Morgan Smith <Morgan.J.Smith <at> outlook.com>,
 61310 <at> debbugs.gnu.org
Subject: Re: bug#61310: Eshell modifying and running output regression
Date: Thu, 9 Feb 2023 22:39:52 -0800
On 2/7/2023 3:37 PM, Jim Porter wrote:
> Good call. Here's a patch that (mostly) copies those comint functions 
> over to Eshell.

Ok, pushed this as ab7c2f8092.




Reply sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Fri, 24 Feb 2023 18:00:02 GMT) Full text and rfc822 format available.

Notification sent to Morgan Smith <Morgan.J.Smith <at> outlook.com>:
bug acknowledged by developer. (Fri, 24 Feb 2023 18:00:02 GMT) Full text and rfc822 format available.

Message #25 received at 61310-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: miha <at> kamnitnik.top, Morgan Smith <Morgan.J.Smith <at> outlook.com>,
 61310-done <at> debbugs.gnu.org
Subject: Re: bug#61310: Eshell modifying and running output regression
Date: Fri, 24 Feb 2023 09:59:07 -0800
On 2/9/2023 10:39 PM, Jim Porter wrote:
> On 2/7/2023 3:37 PM, Jim Porter wrote:
>> Good call. Here's a patch that (mostly) copies those comint functions 
>> over to Eshell.
> 
> Ok, pushed this as ab7c2f8092.

Since no one has complained that my fix didn't work in the past couple 
weeks, I'm assuming all is well here. Closing. (But if it's still 
broken, just let me know.)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Mar 2023 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 4 days ago.

Previous Next


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