Run emacs as separate process from terminal Run emacs as separate process from terminal unix unix

Run emacs as separate process from terminal


You can start any program in the background by appending an ampersand to the command, emacs &.

There's a whole framework for working with backgrounded processes, see for example man jobs, disown, fg, bg, and try Ctrl-Z on a running process, which will suspend it and give you the terminal, allowing you to resume that process either in the foreground or background at your pleasure. Normally when your shell closes, all those programs will end, disown allows you to tell a program to keep running after you end your session.


The emacs --help command is giving you a tip:

   --batch             do not do interactive display; implies -q

So run emacs --batch (or maybe emacs --executesomecommand ).

If you have a desktop (or some X11 display) and want emacs to open an X11 windows and give you back a shell prompt, run it in the background (e.g. emacs &) as many commented.

And I find very useful to start programs (or shells) within emacs, e.g. with Emacs commands: M-x shell, or M-x compile (for make etc...), or M-x gdb for a debugger.

You usually start one single emacs at the beginning of a working day. You could use emacsclient (or set your EDITOR environment variable to it) for other editions using the same emacs.


I'd like to add that Windows does have an equivalent to *nix's & for starting programs in a separate process:

start /b emacs Main.hs