aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2019-09-05 21:39:32 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2019-09-05 21:53:12 -0700
commitb94160df725a52af53f113bf27de7a7b8723174c (patch)
tree9e86b227d4683f26da9b393410df1bedc2e95074 /vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
parent456ebaf423ce2122bf8faa36da464c5d90361204 (diff)
Update dependencies
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh/terminal/util_windows.go')
-rw-r--r--vendor/golang.org/x/crypto/ssh/terminal/util_windows.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
index 6cb8a95..5cfdf8f 100644
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
+++ b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
@@ -64,13 +64,15 @@ func Restore(fd int, state *State) error {
return windows.SetConsoleMode(windows.Handle(fd), state.mode)
}
-// GetSize returns the dimensions of the given terminal.
+// GetSize returns the visible dimensions of the given terminal.
+//
+// These dimensions don't include any scrollback buffer height.
func GetSize(fd int) (width, height int, err error) {
var info windows.ConsoleScreenBufferInfo
if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil {
return 0, 0, err
}
- return int(info.Size.X), int(info.Size.Y), nil
+ return int(info.Window.Right - info.Window.Left + 1), int(info.Window.Bottom - info.Window.Top + 1), nil
}
// ReadPassword reads a line of input from a terminal without local echo. This