mirror of https://github.com/chzyer/readline.git
31 lines
391 B
Go
31 lines
391 B
Go
// +build windows
|
|
|
|
package readline
|
|
|
|
import "syscall"
|
|
|
|
func GetStdin() int {
|
|
return int(syscall.Stdin)
|
|
}
|
|
|
|
func init() {
|
|
isWindows = true
|
|
}
|
|
|
|
// get width of the terminal
|
|
func GetScreenWidth() int {
|
|
info, _ := GetConsoleScreenBufferInfo()
|
|
if info == nil {
|
|
return -1
|
|
}
|
|
return int(info.dwSize.x)
|
|
}
|
|
|
|
func DefaultIsTerminal() bool {
|
|
return true
|
|
}
|
|
|
|
func DefaultOnWidthChanged(func()) {
|
|
|
|
}
|