code: func newLocalTerminal(ctx *ServerContext) (*terminal, error) {
  	var err error
  
  	t := &terminal{
  		log: log.WithFields(log.Fields{
  			trace.Component: teleport.ComponentLocalTerm,
  		}),
  		ctx: ctx,
  	}
  
  	// Open PTY and corresponding TTY.
  	t.pty, t.tty, err = pty.Open()
  	if err != nil {
  		log.Warnf("Could not start PTY %v", err)
  		return nil, err
  	}
  
  	// Set the TTY owner. Failure is not fatal, for example Teleport is running
  	// on a read-only filesystem, but logging is useful for diagnostic purposes.
  	err = t.setOwner()
  	if err != nil {
  		log.Debugf("Unable to set TTY owner: %v.\n", err)
  	}
  
  	return t, nil
  }
docs: // NewLocalTerminal creates and returns a local PTY.