Emacs will open another shell in the current window.

One little thing that pushed me emacs

When opening a shell in a buffer, I do:

Mx shell

So far so good

But if I want to open another shell, I will switch to another buffer and:

Cu Mx shell

but it always opens in another window - not the one I'm in now

This is annoying, does anyone know how to fix it?

EDIT

I should have added that I have several buffers open in several split windows, for example. my frame is divided into 3 sections - I want the new shell to open in the same section that currently has focus, i.e. the one I'm dialing, not an alternative

I think what happens when I make Cu Mx shell , that a new shell buffer opens in the next window, that is, the one you would move if you press Cx o . I want it to open in the same window

+6
source share
1 answer

Emacs runs interactive shells in dedicated buffers. It cannot start a shell, for example, in a TeX buffer.

The Mx shell creates a new shell if it is not already, and Cu Mx shell asks for the name of the new buffer. You can also rename the shell buffer to facilitate the operation of several shells, see the link above.

EDIT: The new shell buffer is displayed using pop-to-buffer-same-window (in Emacs24). It’s best to add *Shell* to display-buffer-alist - but not there.

In Emacs23, the *Shell* buffer mapping is controlled by special-display-function (because *Shell* has a match in special-display-buffer-names or special-display-regexps ). Set special-display-function to display-buffer-same-window (or something similar) and you should be golden.

However, the final solution is to upgrade Emacs to v24; since you are on a Linux system, this should be simple.

+2
source

Source: https://habr.com/ru/post/957120/


All Articles