4

Would it be possible to download a GUI version of Emacs which includes its own terminal emulator for any terminal-related commands like executing shell scripts? I.e., it would not use the local system's terminal but would include its own sandboxed terminal.

8

Yes, there are many, and several of them come with Emacs. Which you will prefer depends on your precise needs.

shell and eshell will both give you shells with no terminal–emulation at all. shell runs your normal shell, while eshell runs a shell made entirely in Emacs lisp, with better integration with the Emacs internals (for example, you can redirect the output of a command to an Emacs buffer, as well as to a file).

term will let you run a shell (or any other program) inside a terminal emulator. The one downside here is that most Emacs keybindings are altered while in this mode, so that you can operate ordinary programs that expect a wide variety of inputs.

If you are willing to install packages, then vterm is a good one. The terminal emulation is compiled into a loadable module rather than being written in Emacs lisp, so it is faster.

You will want to read chapter 38 Running Shell Commands from Emacs in the Emacs manual for more information about shell, eshell, term and a few other related topics. You can also read the Emacs manual, and potentially many others, while inside of Emacs. Use C-h i to open the Info viewer; it starts you out at an index of all available manuals.

3
  • Oh yea, I’d forgotten about that.
    – db48x
    Sep 14 at 22:44
  • Thank you. A few follow-up questions: Is "shell" a command? eshell runs a shell made entirely in Emacs lisp. How does this shell differ from bash? Is it given an internal filesystem? What packages can or cannot be installed into it? Does it use commands like ls, cd, or completely different commands? I'll read the docs now. Thank you
    – John Smith
    Sep 15 at 8:03
  • Yes. You can run it with M-x shell. Same with the others.
    – db48x
    Sep 15 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.