code: func SaveState(fd uintptr) (*State, error) {
  	mode, e := winterm.GetConsoleMode(fd)
  	if e != nil {
  		return nil, e
  	}
  
  	return &State{mode: mode}, nil
  }
docs: // SaveState saves the state of the terminal connected to the given file descriptor.