summaryrefslogtreecommitdiff
path: root/vendor/github.com
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-04 13:21:07 -0500
committerGitHub <noreply@github.com>2022-02-04 13:21:07 -0500
commit8c5b47f459c27ae8f7acbed68cb3259ca55a24da (patch)
tree352acc08a0f98a7c12b5278f51fa305f7f378775 /vendor/github.com
parentec390d5d35cf22345bc96476ba8b978d6e027990 (diff)
parent54cf0f05e3f32bf87365aaea7f87c6c079dc4d48 (diff)
downloadpodman-8c5b47f459c27ae8f7acbed68cb3259ca55a24da.tar.gz
podman-8c5b47f459c27ae8f7acbed68cb3259ca55a24da.tar.bz2
podman-8c5b47f459c27ae8f7acbed68cb3259ca55a24da.zip
Merge pull request #13146 from cevich/dependabot_goterm
Bump github.com/buger/goterm from 1.0.1 to 1.0.4
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/buger/goterm/.gitignore1
-rw-r--r--vendor/github.com/buger/goterm/terminal.go9
-rw-r--r--vendor/github.com/buger/goterm/terminal_nosysioctl.go10
-rw-r--r--vendor/github.com/buger/goterm/terminal_sysioctl.go17
-rw-r--r--vendor/github.com/buger/goterm/terminal_windows.go17
5 files changed, 45 insertions, 9 deletions
diff --git a/vendor/github.com/buger/goterm/.gitignore b/vendor/github.com/buger/goterm/.gitignore
index 1377554eb..986544fb0 100644
--- a/vendor/github.com/buger/goterm/.gitignore
+++ b/vendor/github.com/buger/goterm/.gitignore
@@ -1 +1,2 @@
*.swp
+.idea \ No newline at end of file
diff --git a/vendor/github.com/buger/goterm/terminal.go b/vendor/github.com/buger/goterm/terminal.go
index 1ba6493ad..d1e82085e 100644
--- a/vendor/github.com/buger/goterm/terminal.go
+++ b/vendor/github.com/buger/goterm/terminal.go
@@ -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")
diff --git a/vendor/github.com/buger/goterm/terminal_nosysioctl.go b/vendor/github.com/buger/goterm/terminal_nosysioctl.go
index 9b988ffd5..f4f4d5efc 100644
--- a/vendor/github.com/buger/goterm/terminal_nosysioctl.go
+++ b/vendor/github.com/buger/goterm/terminal_nosysioctl.go
@@ -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)
+}
diff --git a/vendor/github.com/buger/goterm/terminal_sysioctl.go b/vendor/github.com/buger/goterm/terminal_sysioctl.go
index 33148ede0..8b48b405c 100644
--- a/vendor/github.com/buger/goterm/terminal_sysioctl.go
+++ b/vendor/github.com/buger/goterm/terminal_sysioctl.go
@@ -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)
+}
diff --git a/vendor/github.com/buger/goterm/terminal_windows.go b/vendor/github.com/buger/goterm/terminal_windows.go
index 37c56ae69..e8236b697 100644
--- a/vendor/github.com/buger/goterm/terminal_windows.go
+++ b/vendor/github.com/buger/goterm/terminal_windows.go
@@ -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)
+}