You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: term_windows.go
    path of file: ./repos/govendor/vendor/github.com/Bowery/prompt
    
    the code of the file until where you have to start completion: // Copyright 2013-2015 Bowery, Inc.

package prompt

import (
	"os"
	"syscall"
	"unsafe"
)

// Flags to control the terminals mode.
const (
	echoInputFlag      = 0x0004
	insertModeFlag     = 0x0020
	lineInputFlag      = 0x0002
	mouseInputFlag     = 0x0010
	processedInputFlag = 0x0001
	windowInputFlag    = 0x0008
)

// Error number returned for an invalid handle.
const errnoInvalidHandle = 0x6

var (
	kernel                     = syscall.NewLazyDL
    
func newTerminal(in *os.File) (*terminal, error) {
	term := &terminal{fd: in.Fd()}

	err := syscall.GetConsoleMode(syscall.Handle(term.fd), &term.origMode)
	if err != nil {
		return term, nil
	}
	mode := term.origMode
	term.supportsEditing = true

	// Set new mode flags.
	mode &^= (echoInputFlag | insertModeFlag | lineInputFlag | mouseInputFlag |
		processedInputFlag | windowInputFlag)

	ret, _, err := setConsoleMode.Call(term.fd, uintptr(mode))
	if ret == 0 {
		return nil, err
	}

	return term, nil
}