Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: Terminal vs shell?

I have been reading how to use a shell inside EMACS, along the way I found the concept of Terminal, which is an abstraction for the old physical devices which interacted with the shell.
But, nowadays, I really can't understand which are the advantages regarding its use, so, can you please point me out a couple of situations or examples where one should use it instead of the shell in Emacs?

like image 208
utxeee Avatar asked Sep 01 '12 11:09

utxeee


People also ask

Is shell same as terminal?

The Shell is the name of the program that runs in the terminal (command line interpreter). It can be also seen as a program that processes commands and returns output because it is like an application running commands.

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.

Does Emacs have a terminal?

If you are working with a command line interface with no option to start GUI application, start Emacs directly in the terminal with emacs .


3 Answers

Running a term buffer is much closer to an actual terminal. Here are a few differences:

  • Shell mode provides very limited terminal emulation. Programs that take advantage of the terminal's full-screen capabilities (e.g. less, mtr, mutt, top) won't work properly. Terminal mode will generally handle these without any problem.
  • In shell mode, emacs provides tab completion. In terminal mode, the shell or command-line program provide it themselves.
  • Shell mode buffers the input and sends it to the process on newline. Terminal mode sends the characters to the running process immediately.
  • Shell mode works like a regular buffer with the usual emacs key bindings. Terminal mode doesn't intercept most control characters unless you explicitly put it into line mode.
like image 72
ataylor Avatar answered Nov 07 '22 07:11

ataylor


The shell is like another emacs buffer, so the same keys work in it which work in other buffers. It is not true for the terminal.

like image 35
user Avatar answered Nov 07 '22 09:11

user


You can launch the console programs that clear the screen like mc in terminal.

like image 39
Taras Avatar answered Nov 07 '22 08:11

Taras