Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 10 down vote accepted

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

share|improve this answer
    
Awesome thanks! (I have to wait 5 minutes before I can mark this answer as accepted.) –  rightfold Jun 21 '11 at 10:28
5  
In Debian/Ubuntu, the "no X" flavor of Emacs has a version number embedded: so the package name is emacs23-nox. –  Riccardo Murri Jun 21 '11 at 10:29
    
^This (what riccardo said) –  Achmed Durangi May 8 at 16:55

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.

share|improve this answer
2  
Additionally, if the $DISPLAY environment variable is not set, emacs will use the terminal version. –  KeithB Jun 21 '11 at 20:29

Starting emacs with emacs -nw should do the trick.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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