Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple shells on Emacs

Tags:

emacs

I am using Emacs 23.3.1 on windows 7. I know that I can run shell from emacs using M-x shell. I would like to have multiple shell windows in the same time, but typing M-x shell a second time just opens me the same shell window.

Is there a way to have different shell windows?

like image 466
S4M Avatar asked Sep 26 '22 19:09

S4M


People also ask

How do I run a shell command in Emacs?

You can execute an external shell command from within Emacs using ` M-! ' ( 'shell-command' ). The output from the shell command is displayed in the minibuffer or in a separate buffer, depending on the output size.

How do I get shells in Emacs?

You can start an interactive shell in Emacs by typing M-x shell . By default, this will start the standard Windows shell cmd.exe . Emacs uses the SHELL environment variable to determine which program to use as the shell.

Is Emacs its own shell?

Emacs comes with its own shell (as in, like bash or zsh ) written in entirely in Emacs-Lisp.

What is Emacs shell?

Eshell is a shell-like command interpreter implemented in Emacs Lisp. It invokes no external processes except for those requested by the user.


1 Answers

C-u M-x shell will do it.

It will prompt for a name for the new shell, just hit return for the default (which will be something like *shell*<2>.

Also works with eshell.

Another trick, if you use eshell: just as M-x eshell takes you back to *eshell* (rather than starting a new eshell), if you use a numeric prefix argument it will take you to that eshell buffer. For instance, C-3M-xeshell will take you to *eshell*<3>. Sadly if you use shell (rather than eshell), this trick doesn't seem to work (in my Emacs 24.0.50.1 at least.)

like image 229
Matt Curtis Avatar answered Oct 14 '22 05:10

Matt Curtis