Skip to content

Commit

Permalink
Fix #40
Browse files Browse the repository at this point in the history
MaxInt was added only in 1.17, which broke compatibility with older Go versions. 
Should use `MinInt32` instead.
  • Loading branch information
buger committed Sep 7, 2021
1 parent 6532f8e commit b630d37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ func Width() int {
func Height() int {
ws, err := getWinsize()
if err != nil {
// returns math.MaxInt if we could not retrieve the height of console window,
// returns math.MinInt32 if we could not retrieve the height of console window,

This comment has been minimized.

Copy link
@kenzyme23

kenzyme23 Dec 22, 2021

terminal.go

This comment has been minimized.

Copy link
@kenzyme23

kenzyme23 Dec 22, 2021

return math.MinInt32

// like VSCode debugging console
if errors.Is(err, unix.EOPNOTSUPP) {
return math.MaxInt
return math.MinInt32
}
return -1
}
Expand Down

0 comments on commit b630d37

Please sign in to comment.