In previous emacs, "M-x shell" new a shell buffer in current windows.
but recently, I update my emacs to GNU Emacs 26.0.50.2. "M-x shell" new a shell buffer in the other windows. I search google and could not find answer. does anybody know how to prevent this behavior.
Add this line in your .emacs file:
(push (cons "\\*shell\\*" display-buffer--same-window-action) display-buffer-alist)
This fixed it for me. I'm using eMacs 25.2 (9.0) on a Mac, and was getting really annoyed by the shell opening up in another frame, or even a new frame when there was only one. This is the source where I got this answer from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With