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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Aug 2015 12:03:22 +0300

> Date: Mon, 27 Jul 2015 11:46:56 +0100
> From: Artur Malabarba <[email-masked]>
> 
> 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.