8

I installed Emacs using sudo apt-get install emacs. The problem is that when I launch Emacs from the command line (e.g. emacs main.c) it opens Emacs with a GUI. I prefer the command line version which runs in the terminal emulator.

How can I install (or change some default) so that Emacs will open in the command line instead of a GUI?

3 Answers 3

20

If you would like to start Emacs in the terminal and without any X11 graphics support, just call it with the -nw command line switch:

emacs -nw #...other options

You can set up a shell alias if you're doing this frequently.

This works also in the cases where you don't have control over what is installed.

1
  • 2
    Additionally, if the $DISPLAY environment variable is not set, emacs will use the terminal version.
    – KeithB
    Jun 21, 2011 at 20:29
12

Installing emacs-nox instead of emacs should do the trick.

2
  • 5
    In Debian/Ubuntu, the "no X" flavor of Emacs has a version number embedded: so the package name is emacs23-nox. Jun 21, 2011 at 10:29
  • ^This (what riccardo said)
    – user46399
    May 8, 2014 at 16:55
1

Starting emacs with emacs -nw should do the trick.

You must log in to answer this question.