how to properly close a trinity session from tty?