Linux – How to start GUI linux programs from the command line, but separate from the command line

command linelinux

I've searched for this before, but have never been able to find an answer.

In Windows, if I have a console window open, type winmine, and press enter, Minesweeper will appear, completely separate from the cmd program. The Minesweeper instance is not tied to the command prompt in any way that I know of, with the exception of Minesweeper's parent being set to that instance of the command prompt. It's different in Linux, however.

In Linux, if I have a console window open, type emacs and press enter, Emacs will open, but it seems tied to the command line. Specifically, it appears that I can't use the command line anymore until that instance of Emacs is closed. Is there a way to replicate the Windows behavior in Linux?

Thanks!

Best Answer

In bash, detach is a built-in, used as follows:

emacs &
detach %+ # or % + the number in brackets printed after the above

In zsh, you can background and detach in a single operation:

emacs &|