code: func NewAnsiWriter(nFile int) io.Writer {
  	initLogger()
  	file, fd := winterm.GetStdFile(nFile)
  	info, err := winterm.GetConsoleScreenBufferInfo(fd)
  	if err != nil {
  		return nil
  	}
  
  	parser := ansiterm.CreateParser("Ground", winterm.CreateWinEventHandler(fd, file))
  	logger.Infof("newAnsiWriter: parser %p", parser)
  
  	aw := &ansiWriter{
  		file:           file,
  		fd:             fd,
  		infoReset:      info,
  		command:        make([]byte, 0, ansiterm.ANSI_MAX_CMD_LENGTH),
  		escapeSequence: []byte(ansiterm.KEY_ESC_CSI),
  		parser:         parser,
  	}
  
  	logger.Infof("newAnsiWriter: aw.parser %p", aw.parser)
  	logger.Infof("newAnsiWriter: %v", aw)
  	return aw
  }
docs: // NewAnsiWriter returns an io.Writer that provides VT100 terminal emulation on top of a
  // Windows console output handle.