confetty/confetti/confetti_windows.go
Yasuhiro Matsumoto 02c40b05f9 Support Windows
2021-11-02 17:54:59 -04:00

23 lines
344 B
Go

//go:build windows
// +build windows
package confetti
import (
"syscall"
"golang.org/x/term"
)
func InitialModel() model {
h, err := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE)
if err != nil {
panic(err)
}
width, height, err := term.GetSize(int(h))
if err != nil {
panic(err)
}
return InitialModelWithSize(width, height)
}