GNU bug report logs - #21139
25.0.50; shell-mode doesn't respect comint-scroll-to-bottom-on-output/input

Previous Next

Package: emacs;

Reported by: bruce.connor.am <at> gmail.com

Date: Mon, 27 Jul 2015 10:48:02 UTC

Severity: minor

Tags: confirmed

Found in version 25.0.50

Done: Artur Malabarba <bruce.connor.am <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 21139 in the body.
You can then email your comments to 21139 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#21139; Package emacs. (Mon, 27 Jul 2015 10:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to bruce.connor.am <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 Jul 2015 10:48:02 GMT) Full text and rfc822 format available.

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

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Mon, 27 Jul 2015 11:46:56 +0100
1. Set `comint-scroll-to-bottom-on-output` and
`comint-scroll-to-bottom-on-input` to nil via the customize interface
(or via `setq-default`)
2. Run `M-x shell`
3. Run a couple of shell commands so you have enough output to fill
the screen (`ls -al ~/` should do it).
4. Hit `C-l` twice so point is at the top of the screen.
5. Type `date` on the prompt and hit `RET`.
6. The window scrolls until point is at the bottom.


It would seem that, by setting those variables to nil, the window
should not scroll. If this is not intended to be the case, then these
variables' docstrings are unclear to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Mon, 27 Jul 2015 15:45:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: bruce.connor.am <at> gmail.com
Cc: 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Mon, 27 Jul 2015 11:44:17 -0400
Artur Malabarba wrote:

> 1. Set `comint-scroll-to-bottom-on-output` and
> `comint-scroll-to-bottom-on-input` to nil via the customize interface
> (or via `setq-default`)
> 2. Run `M-x shell`
> 3. Run a couple of shell commands so you have enough output to fill
> the screen (`ls -al ~/` should do it).
> 4. Hit `C-l` twice so point is at the top of the screen.
> 5. Type `date` on the prompt and hit `RET`.
> 6. The window scrolls until point is at the bottom.

I think this is a misunderstanding.
Try (in a shell buffer with more than one page of output present):

sleep 5; date

and scroll Emacs to the top of the shell buffer before the sleep ends.
Compare the behaviour with comint-move-point-for-output nil and non-nil.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Mon, 27 Jul 2015 17:02:02 GMT) Full text and rfc822 format available.

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

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Mon, 27 Jul 2015 18:01:20 +0100
> I think this is a misunderstanding.
> Try (in a shell buffer with more than one page of output present):
>
> sleep 5; date
>
> and scroll Emacs to the top of the shell buffer before the sleep ends.
> Compare the behaviour with comint-move-point-for-output nil and non-nil.

Thanks, that helped understant what the output variable is supposed to
do, and it does match the docstring (which explains that it's about
the point, not the window).

But what about the input variable?
If I set it to nil, the window still scrolls whenever I hit RET. And
the docstring seems to say it shouldn't:

> Controls whether input to interpreter causes window to scroll.
> If nil, then do not scroll.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Tue, 28 Jul 2015 19:56:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: bruce.connor.am <at> gmail.com
Cc: 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Tue, 28 Jul 2015 15:55:37 -0400
Artur Malabarba wrote:

> But what about the input variable?

I assume it's supposed to work like in a terminal emulator:
scroll back to look at earlier output, typing new input does not jump to
the end.
But in Emacs, when you scroll back to look at earlier output and start
typing, if this option is nil then input is entered at point, not the
end of the buffer. The whole thing seems kind of nonsensical.
It only works sensibly if the option is non-nil.




Added tag(s) confirmed. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 28 Jul 2015 19:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Sat, 08 Aug 2015 09:04:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: bruce.connor.am <at> gmail.com
Cc: 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Sat, 08 Aug 2015 12:03:22 +0300
> Date: Mon, 27 Jul 2015 11:46:56 +0100
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> 
> 1. Set `comint-scroll-to-bottom-on-output` and
> `comint-scroll-to-bottom-on-input` to nil via the customize interface
> (or via `setq-default`)
> 2. Run `M-x shell`
> 3. Run a couple of shell commands so you have enough output to fill
> the screen (`ls -al ~/` should do it).
> 4. Hit `C-l` twice so point is at the top of the screen.
> 5. Type `date` on the prompt and hit `RET`.
> 6. The window scrolls until point is at the bottom.
> 
> 
> It would seem that, by setting those variables to nil, the window
> should not scroll. If this is not intended to be the case, then these
> variables' docstrings are unclear to me.

The variable comint-scroll-to-bottom-on-output
(a.k.a. comint-move-point-for-output) control whether _point_ moves.
In the scenario you described, point does not move, it stays at EOB.
What happens is that the window is scrolled to place point on the last
line of the window; this is controlled by another variable,
comint-scroll-show-maximum-output, which attempts to show as much of
the shell buffer as possible.  if you set it to nil, you will have
what you want in this scenario.

IOW, this doesn't look like a bug, but intended behavior, and you need
to customize another variable to have what you want.




Reply sent to bruce.connor.am <at> gmail.com:
You have taken responsibility. (Sat, 08 Aug 2015 18:02:02 GMT) Full text and rfc822 format available.

Notification sent to bruce.connor.am <at> gmail.com:
bug acknowledged by developer. (Sat, 08 Aug 2015 18:02:02 GMT) Full text and rfc822 format available.

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

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21139-done <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Sat, 8 Aug 2015 19:01:54 +0100
THanks Eli. Indeed, that's what I was looking for.
I'll close this now.

2015-08-08 10:03 GMT+01:00 Eli Zaretskii <eliz <at> gnu.org>:
>> Date: Mon, 27 Jul 2015 11:46:56 +0100
>> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
>>
>> 1. Set `comint-scroll-to-bottom-on-output` and
>> `comint-scroll-to-bottom-on-input` to nil via the customize interface
>> (or via `setq-default`)
>> 2. Run `M-x shell`
>> 3. Run a couple of shell commands so you have enough output to fill
>> the screen (`ls -al ~/` should do it).
>> 4. Hit `C-l` twice so point is at the top of the screen.
>> 5. Type `date` on the prompt and hit `RET`.
>> 6. The window scrolls until point is at the bottom.
>>
>>
>> It would seem that, by setting those variables to nil, the window
>> should not scroll. If this is not intended to be the case, then these
>> variables' docstrings are unclear to me.
>
> The variable comint-scroll-to-bottom-on-output
> (a.k.a. comint-move-point-for-output) control whether _point_ moves.
> In the scenario you described, point does not move, it stays at EOB.
> What happens is that the window is scrolled to place point on the last
> line of the window; this is controlled by another variable,
> comint-scroll-show-maximum-output, which attempts to show as much of
> the shell buffer as possible.  if you set it to nil, you will have
> what you want in this scenario.
>
> IOW, this doesn't look like a bug, but intended behavior, and you need
> to customize another variable to have what you want.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Sun, 09 Aug 2015 02:27:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: 21139 <at> debbugs.gnu.org
Cc: bruce.connor.am <at> gmail.com
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Sat, 08 Aug 2015 22:26:37 -0400
Artur Malabarba wrote:

> THanks Eli. Indeed, that's what I was looking for.
> I'll close this now.

But you previously asked about the -input functionality too, and I
agreed that it seemed broken to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Sun, 09 Aug 2015 09:06:01 GMT) Full text and rfc822 format available.

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

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Sun, 9 Aug 2015 10:05:07 +0100
2015-08-09 3:26 GMT+01:00 Glenn Morris <rgm <at> gnu.org>:
> Artur Malabarba wrote:
>
>> THanks Eli. Indeed, that's what I was looking for.
>> I'll close this now.
>
> But you previously asked about the -input functionality too, and I
> agreed that it seemed broken to me.

True. Sorry I forgot about your message. The behaviour I was looking
for is that of `comint-scroll-show-maximum-output'. But indeed, I
still don't completely understand what that `input' variable does.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Sun, 09 Aug 2015 14:50:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: bruce.connor.am <at> gmail.com
Cc: rgm <at> gnu.org, 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Sun, 09 Aug 2015 17:49:15 +0300
> Date: Sun, 9 Aug 2015 10:05:07 +0100
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> Cc: 21139 <at> debbugs.gnu.org
> 
> But indeed, I still don't completely understand what that `input'
> variable does.

AFAICS, it moves point to EOB if it is not already there, when user
input is expected.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Mon, 10 Aug 2015 09:27:02 GMT) Full text and rfc822 format available.

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

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Mon, 10 Aug 2015 10:26:17 +0100
> AFAICS, it moves point to EOB if it is not already there, when user
> input is expected.

What's an exmaple of 'input is expected'? When the shell prompt is displayed?

I've set all 3 variables to nil, but my cursor is still moved to the
end of the buffer when the output+prompt are displayed, no matter
where it was before. (Tested by runnning 'sleep 2; date' and then
moving the point around.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Tue, 11 Aug 2015 18:52:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: bruce.connor.am <at> gmail.com
Cc: rgm <at> gnu.org, 21139 <at> debbugs.gnu.org
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Tue, 11 Aug 2015 21:51:45 +0300
> Date: Mon, 10 Aug 2015 10:26:17 +0100
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> Cc: Glenn Morris <rgm <at> gnu.org>, 21139 <at> debbugs.gnu.org
> 
> > AFAICS, it moves point to EOB if it is not already there, when user
> > input is expected.
> 
> What's an exmaple of 'input is expected'? When the shell prompt is displayed?
> 
> I've set all 3 variables to nil, but my cursor is still moved to the
> end of the buffer when the output+prompt are displayed, no matter
> where it was before. (Tested by runnning 'sleep 2; date' and then
> moving the point around.)

Not sure why you consider the scenario you described relevant for what
comint-scroll-to-bottom-on-input controls.  The scenario that I think
is relevant is this:

  . M-x shell
  . move point back to some place in the buffer other than the last
    shell prompt
  . type something

When comint-scroll-to-bottom-on-input is non-nil, point moves to the
last shell prompt before your input is inserted; when the variable is
nil, whatever you type is inserted where point was, without moving it
anywhere.

This behavior seems consistent with the doc string of
comint-preinput-scroll-to-bottom, the only function that references
that variable:

    Go to the end of buffer in all windows showing it.
  Movement occurs if point in the selected window is not after the process mark,
  and `this-command' is an insertion command.  Insertion commands recognized
  are `self-insert-command', `comint-magic-space', `yank', and `hilit-yank'.
  Depends on the value of `comint-scroll-to-bottom-on-input'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Wed, 12 Aug 2015 05:58:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21139 <at> debbugs.gnu.org, bruce.connor.am <at> gmail.com
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Wed, 12 Aug 2015 01:57:25 -0400
Eli Zaretskii wrote:

>   . M-x shell
>   . move point back to some place in the buffer other than the last
>     shell prompt
>   . type something
>
> When comint-scroll-to-bottom-on-input is non-nil, point moves to the
> last shell prompt before your input is inserted; when the variable is
> nil, whatever you type is inserted where point was, without moving it
> anywhere.

The latter behaviour makes no sense to me, as I already said, so I filed
my own report about that (not that I expect anything to result from it).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21139; Package emacs. (Wed, 12 Aug 2015 12:43:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 21139 <at> debbugs.gnu.org, bruce.connor.am <at> gmail.com
Subject: Re: bug#21139: 25.0.50;
 shell-mode doesn't respect comint-scroll-to-bottom-on-output/input
Date: Wed, 12 Aug 2015 15:42:26 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: bruce.connor.am <at> gmail.com,  21139 <at> debbugs.gnu.org
> Date: Wed, 12 Aug 2015 01:57:25 -0400
> 
> Eli Zaretskii wrote:
> 
> >   . M-x shell
> >   . move point back to some place in the buffer other than the last
> >     shell prompt
> >   . type something
> >
> > When comint-scroll-to-bottom-on-input is non-nil, point moves to the
> > last shell prompt before your input is inserted; when the variable is
> > nil, whatever you type is inserted where point was, without moving it
> > anywhere.
> 
> The latter behaviour makes no sense to me, as I already said, so I filed
> my own report about that (not that I expect anything to result from it).

Which bug is that?




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Sep 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 289 days ago.

Previous Next


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