mirror of
https://github.com/containers/podman.git
synced 2025-12-01 02:27:13 +08:00
Merge pull request #13146 from cevich/dependabot_goterm
Bump github.com/buger/goterm from 1.0.1 to 1.0.4
This commit is contained in:
1
vendor/github.com/buger/goterm/.gitignore
generated
vendored
1
vendor/github.com/buger/goterm/.gitignore
generated
vendored
@@ -1 +1,2 @@
|
||||
*.swp
|
||||
.idea
|
||||
9
vendor/github.com/buger/goterm/terminal.go
generated
vendored
9
vendor/github.com/buger/goterm/terminal.go
generated
vendored
@@ -199,15 +199,6 @@ func Width() int {
|
||||
return int(ws.Col)
|
||||
}
|
||||
|
||||
// Height gets console height
|
||||
func Height() int {
|
||||
ws, err := getWinsize()
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
return int(ws.Row)
|
||||
}
|
||||
|
||||
// CurrentHeight gets current height. Line count in Screen buffer.
|
||||
func CurrentHeight() int {
|
||||
return strings.Count(Screen.String(), "\n")
|
||||
|
||||
10
vendor/github.com/buger/goterm/terminal_nosysioctl.go
generated
vendored
10
vendor/github.com/buger/goterm/terminal_nosysioctl.go
generated
vendored
@@ -1,3 +1,4 @@
|
||||
//go:build plan9 || solaris
|
||||
// +build plan9 solaris
|
||||
|
||||
package goterm
|
||||
@@ -10,3 +11,12 @@ func getWinsize() (*winsize, error) {
|
||||
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
// Height gets console height
|
||||
func Height() int {
|
||||
ws, err := getWinsize()
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
return int(ws.Row)
|
||||
}
|
||||
|
||||
17
vendor/github.com/buger/goterm/terminal_sysioctl.go
generated
vendored
17
vendor/github.com/buger/goterm/terminal_sysioctl.go
generated
vendored
@@ -1,8 +1,11 @@
|
||||
//go:build !windows && !plan9 && !solaris
|
||||
// +build !windows,!plan9,!solaris
|
||||
|
||||
package goterm
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"math"
|
||||
"os"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@@ -17,3 +20,17 @@ func getWinsize() (*unix.Winsize, error) {
|
||||
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
// Height gets console height
|
||||
func Height() int {
|
||||
ws, err := getWinsize()
|
||||
if err != nil {
|
||||
// returns math.MinInt32 if we could not retrieve the height of console window,
|
||||
// like VSCode debugging console
|
||||
if errors.Is(err, unix.EOPNOTSUPP) {
|
||||
return math.MinInt32
|
||||
}
|
||||
return -1
|
||||
}
|
||||
return int(ws.Row)
|
||||
}
|
||||
|
||||
17
vendor/github.com/buger/goterm/terminal_windows.go
generated
vendored
17
vendor/github.com/buger/goterm/terminal_windows.go
generated
vendored
@@ -1,8 +1,11 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package goterm
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"math"
|
||||
"os"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
@@ -21,3 +24,17 @@ func getWinsize() (*winsize, error) {
|
||||
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
// Height gets console height
|
||||
func Height() int {
|
||||
ws, err := getWinsize()
|
||||
if err != nil {
|
||||
// returns math.MinInt32 if we could not retrieve the height of console window,
|
||||
// like VSCode debugging console
|
||||
if errors.Is(err, windows.WSAEOPNOTSUPP) {
|
||||
return math.MinInt32
|
||||
}
|
||||
return -1
|
||||
}
|
||||
return int(ws.Row)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user