Reparent a running program to a new terminal