I often execute shell commands via M-!
and their output is then shown in the buffer *Shell Command Output*
. How can I make this buffer display the end (rather than the beginning) so that I can see whether the shell command successfully terminated?
I saw here that when compiling via M-x compile
, one can use (setq compilation-scroll-output t)
to display the end of the compilation buffer. That behaviour would be great for *Shell Command Output*
.
(let ((compilation-scroll-output t)) (compile "while :; do echo \"Hello-World\"; sleep 1; done"))
M-x compile
in this case?shell-command
to make it behave as you desire. There are several variations of how that function operates depending upon the circumstances ... Someone may be inclined to write-up a solution for you ... this question; however, is (in my opinion) an exact duplicate of the linked thread ... which has a solution that may not be what you are looking for.M-x compile
in this case is also a bit more consistent in how I use it in other cases. Also, I often useM-!
to create a new file (touch foo.txt
) and there is no need to show the buffer in this case, for example (which would probably require a bit of work as you say). So, nice, thanks for pointing that out.