windows bug fix 02

This commit is contained in:
2024-09-29 21:52:17 +02:00
parent dd8f1fbc1f
commit b2b5c9c00d
3 changed files with 7 additions and 6 deletions
+3 -1
View File
@@ -2,7 +2,9 @@ module github.com/orus-dev/osui
go 1.23.1
require golang.org/x/term v0.24.0 // direct
require (
github.com/nathan-fiscaletti/consolesize-go v0.0.0-20220204101620-317176b6684d // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // direct
)
+2
View File
@@ -1,3 +1,5 @@
github.com/nathan-fiscaletti/consolesize-go v0.0.0-20220204101620-317176b6684d h1:NqRhLdNVlozULwM1B3VaHhcXYSgrOAv8V5BE65om+1Q=
github.com/nathan-fiscaletti/consolesize-go v0.0.0-20220204101620-317176b6684d/go.mod h1:cxIIfNMTwff8f/ZvRouvWYF6wOoO7nj99neWSx2q/Es=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
+2 -5
View File
@@ -9,6 +9,7 @@ import (
"runtime"
"strings"
"github.com/nathan-fiscaletti/consolesize-go"
"github.com/orus-dev/osui/colors"
"golang.org/x/term"
)
@@ -174,9 +175,5 @@ func LogicValueInt(b bool, _if, _else int) int {
}
func GetTerminalSize() (int, int) {
w, h, err := term.GetSize(int(os.Stdin.Fd()))
if err != nil {
panic(err)
}
return w, h
return consolesize.GetConsoleSize()
}