Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set my $EDITOR variable to be emacs with no window, so the command to call it would be emacs -nw. However if I set it like this:

export EDITOR="/Applications/ -nw"

I get the following error

zsh: no such file or directory: /Applications/ -n

share|improve this question
Have you checked if the programs take environment variables of configuration files to set such switches? – vonbrand Jan 23 '13 at 18:59
up vote 3 down vote accepted

I believe this doesn't work because the shell would try to open a binary with the space included in the file name, so Emacs -nw, and not open Emacs and then pass -nw as the options.

How about making $EDITOR a small (executable) script, e.g. in ~/bin/EDITOR?

/Applications/ -nw -- "$@"

Then, simply add to your shell's configuration:

export EDITOR=~/bin/EDITOR

Now, EDITOR will call the script with the appropriate arguments, expanded in $@.

share|improve this answer

As explained here:, zsh treats the expanded variable as a single word (that has space characters in it).

Possible solutions are:

share|improve this answer

Your Answer


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.