readline/utils_windows.go

34 lines
413 B
Go
Raw Normal View History

2015-09-27 06:41:05 +03:00
// +build windows
package readline
2016-03-13 13:32:48 +03:00
import "syscall"
func SuspendMe() {
}
2016-03-13 13:32:48 +03:00
func GetStdin() int {
return int(syscall.Stdin)
}
func init() {
isWindows = true
}
2015-09-27 06:41:05 +03:00
// get width of the terminal
2016-03-13 13:32:48 +03:00
func GetScreenWidth() int {
2015-09-29 12:49:58 +03:00
info, _ := GetConsoleScreenBufferInfo()
if info == nil {
return -1
2015-09-29 12:49:58 +03:00
}
return int(info.dwSize.x)
2015-09-27 06:41:05 +03:00
}
2016-03-13 13:32:48 +03:00
func DefaultIsTerminal() bool {
return true
}
func DefaultOnWidthChanged(func()) {
}