code: func (t *terminal) Close() error {
  	var err error
  	// note, pty is closed in the copying goroutine,
  	// not here to avoid data races
  	if t.tty != nil {
  		if e := t.tty.Close(); e != nil {
  			err = e
  		}
  	}
  	go t.closePTY()
  	return trace.Wrap(err)
  }
docs: // Close will free resources associated with the terminal.