How do I get emacs to open in the terminal when it is being used as the config editor?
Solution 1:
From @steeldriver comment:
git config --global core.editor "emacs -nw"
Solution 2:
Most utilities, including git
respect an environment variable named EDITOR which you can set to any editor you want, including options. export EDITOR='emacs -nw'
will have them run emacs in non windowed mode.
In the case of emacs
, it has a handy server mode you can start with M-x server-start
and then run emacsclient
as an editor to open a file in the already running emacs instance. This is handy since it allows you to retain access to the emacs kill ring and other features. It also accepts the -nw
switch so that it will open a new emacs frame in the terminal window rather than in the gui emacs frame, so it will still look and feel like a text mode emacs session, but still share the kill ring and buffers with the other window(s).