How to open a window from mac terminal

This is the first time I ask about stackoverflow because I cannot find the answer anywhere. I use emacs to write all my code, and I just switched from ubuntu to mac os. One problem bothered me: how could you open the emacs window from a Mac terminal, as if you would open a firefox window from a terminal on a Linux system? I know how it works for a Linux system, so that whenever you enter a command from a terminal, the terminal searches for the binary in your PATH and executes it. Is it true for Mac that you can open the application as a window in the "/ Application" directory, and all the binaries opened from the terminal are in a form without a window? Many thanks!

+5
source share
5 answers

The pre-installed Emacs that ship with OS X are built without a GUI. Hence,

$ emacs   # in the shell/terminal

Will NOT open a graphics window and instead open a text / terminal version instead. Please note that this version (installed in /usr/bin/emacs) is also old and is at level 22.1.1 in Mountain Lion.

You can download the latest Emacs build to get the desired behavior (and also get the latest version of Emacs as a bonus). It is available in various places, including http://emacsforosx.com/ .

Most of these pre-installed Emacs are installed under /Applications, and to call from the terminal you will need to specify the full path to the binary file, which is usually equal to:

 /Applications/Emacs.app/Contents/MacOS/Emacs

.bashrc :

 alias emacs=/Applications/Emacs.app/Contents/MacOS/Emacs

emacs .

+4

, -

/path/to/some.app

+1

/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &

.

OS X 10.7.4 .

EDIT: , :

/Applications/Utilities/Terminal.app

,

open --new/Applications/Utilities/Terminal.app

, , , , , .

+1

Mac OS/X emacs : http://emacsformacosx.com/

-, :

  • open -a emacs
  • Install it to start server mode in your .emacs init, and then on the command line type emacsclient foofor the file foo.
+1
source

I would recommend either getting emacs via fink, or go here: http://emacsformacosx.com/

This will allow you to install a local version of emacs that passes through the X server, and therefore has a full GUI interface.

0
source

All Articles