Mac – “open” command starts separate Emacs.app processes, or none at all

catalinaemacs

I recently moved to a MacBook Pro with Catalina from a different MBP running Mojave. I use Emacs.app from https://emacsformacosx.com/. For all previous Mac OS versions, the command

open -a /Applications/Emacs.app myfile

would, initially, start a new Emacs process and open my file; if Emacs was already open, it would open a new buffer for that file.

Now, in Catalina, it either (a) starts a completely new copy of Emacs with that file open, or sometimes, if Emacs is running already, (b) does nothing, neither of which is what I want.

Any ideas how to get the old behavior back?

Best Answer

Might be easier to use ˋemacsclientˋ:

  • Add (server-start) to your .emacs file
  • Run emacsclient FILE to open a file in a running Emacs
Related Question