Try splitting the frame repeating some times the command C-x 3
.
Then try open the shell with M-x shell
.
It will open in a random window and not the one which you have typed the command from. Why?
Try splitting the frame repeating some times the command C-x 3
.
Then try open the shell with M-x shell
.
It will open in a random window and not the one which you have typed the command from. Why?
The following works well in my GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2017-12-09
(add-to-list 'display-buffer-alist
`(,(rx bos "*shell*")
display-buffer-same-window))
However, with the answer provided by @bertfred I get the error
(wrong-type-argument window-live-p nil)
EDIT:
Here is the content of the *Backtrace*
buffer after M-x shell
with @bertfred's suggested display-buffer-alist
:
Debugger entered--Lisp error: (wrong-type-argument window-live-p nil)
select-window(nil nil)
pop-to-buffer(#<buffer *shell*>)
shell(nil)
funcall-interactively(shell nil)
call-interactively(shell record nil)
command-execute(shell record)
execute-extended-command(nil "shell" "shell")
funcall-interactively(execute-extended-command nil "shell" "shell")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)