I open some iTerm2 sessions via ttab
. I start these session for textual UI commands like top
or commands which might run for a long time like cp -r <large-dir> <backup-location>
.
After the command has finshed the iTerm session stays open with the (bash) shell prompt. I have to close it manually via Ctrl-D.
How can I tell iTerm to close the session automatically when the shell is back at its prompt?
I tried using a special profile for this (because ttab
can open the session in a specified iTerm profile), but I couldn't find a setting which closes the session when the shell is waiting at its prompt.
nohup <cmd> &