code: func NewTerminal(ctx *ServerContext) (Terminal, error) {
  	// It doesn't matter what mode the cluster is in, if this is a Teleport node
  	// return a local terminal.
  	if ctx.srv.Component() == teleport.ComponentNode {
  		return newLocalTerminal(ctx)
  	}
  
  	// If this is not a Teleport node, find out what mode the cluster is in and
  	// return the correct terminal.
  	if ctx.ClusterConfig.GetSessionRecording() == services.RecordAtProxy {
  		return newRemoteTerminal(ctx)
  	}
  	return newLocalTerminal(ctx)
  }
docs: // NewTerminal returns a new terminal. Terminal can be local or remote
  // depending on cluster configuration.