Handle running detached from the spawning terminal

puts throws an exception if the process is detached from the spawning
terminal.