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,841
  • 4
  • 24
  • 22

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
  • 31,429
  • 5
  • 79
  • 58