1

Compiled emacs25.1 from source on MacOS. Emacs works fine when opened by click the icon.

But when open it from terminal by emacs or emacsclient -a. All the key stokes is responded in terminal instead of the Emacs frame.

Does anyone known solutions for this issue?

1 Answer 1

2

Assuming that you've configured with --with-ns (because you said it works if you open Emacs by clicking on the app icon), then you can start Emacs from the console in a couple of different ways. If you just want to start Emacs as an app then you can use the open command, so something like open nextstep/Emacs.app. The open command has a variety of arguments which can change its behaviour. For example, it will attempt to use an already running instance of the application if possible (you can override this with the -n argument), and by default won't wait until the application has exited (you can override this with the -w argument). If you want to open some files as well then you'd need to use the --args argument to open to tell it that the remaining arguments should go to Emacs - for example: open Emacs.app --args foo.txt.

If you want to see standard output and error from the Emacs executable itself you can also run the binary directly (or in a debugger) from the terminal without using open, with something like ./Emacs.app/Contents/MacOS/Emacs foo.txt.

1
  • It's probably worth pointing out that running 'emacs' on macOS will probably run the version shipped with the OS which is terminal only.
    – Alan Third
    Apr 10, 2017 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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