Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

M-x shell open shell in other windows

Tags:

emacs

emacs24

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.

like image 419
yuandaxing Avatar asked Oct 28 '16 09:10

yuandaxing


1 Answers

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.

like image 78
Hoon Park Avatar answered Sep 21 '22 22:09

Hoon Park