6

Possible Duplicate:
How can I close a terminal without killing the command running in it?

If I open a terminal emulator, type firefox & and then close the terminal, the process it launched -Firefox- gets killed as it was its child.

How can I prevent this behavior?

deprecated
  • 2,361
  • 4
  • 24
  • 23

1 Answers1

7

Use the disown command. In zsh you can also use &| to background and disown in a single operation.

$ firefox &
[1] 74773
$ disown %1 # or "disown %firefox"
$ firefox &| # zsh only; bash will report "syntax error near unexpected token `|'"
geekosaur
  • 32,047