Sunday, April 28, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1737  / 3 Years ago, fri, may 28, 2021, 4:40:46

I have been using Emacs shell mode for some time, but one thing keeps bothering me. After I split the window vertically with Ctrl+3, invoke M-x shell and fill the window with commands and output, whenever I execute a command, the pointer jumps to the middle of the screen, where there are usually outputs of previous command. I could Alt+> to jump to where the new prompt is, but that is tedious. However, Emacs works well if I do not split the window, i.e. keeps the pointer at the bottom of the screen.



Another fact (not the same question) that I happened to found is that I could keep all the outputs in the upper half of the screen, while leaving the lower half blank. Is this triggered by some shortcut?



For clarification, I just want my Emacs shell's output behave like a common shell like bash, i.e. keeps the pointer at the bottom. The pointer in emacs sometimes jumps to the middle of the screen after I enter a command.



Hopefully I have made myself understood.


More From » command-line

 Answers
7

Question solved in this link.



That is, add the following code to ~/.emacs



(remove-hook 'comint-output-filter-functions
'comint-postoutput-scroll-to-bottom)



after pressing c-l c-l in shell-mode.


[#34800] Friday, May 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
coffekne

Total Points: 114
Total Questions: 122
Total Answers: 126

Location: Mauritania
Member since Sun, Oct 17, 2021
3 Years ago
;