aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/vbauerster/mpb/v5/cwriter/writer_windows.go
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2021-04-12 09:45:08 +0000
committerGitHub <noreply@github.com>2021-04-12 09:45:08 +0000
commit3627c4b691a357fc531c2761f07ccfecf937dd12 (patch)
treeefb7643f74beadd946dc052f537743454a076462 /vendor/github.com/vbauerster/mpb/v5/cwriter/writer_windows.go
parent669311d8d8a8881571ccc81ce48b9202b15b9def (diff)
downloadpodman-3627c4b691a357fc531c2761f07ccfecf937dd12.tar.gz
podman-3627c4b691a357fc531c2761f07ccfecf937dd12.tar.bz2
podman-3627c4b691a357fc531c2761f07ccfecf937dd12.zip
Bump github.com/containers/image/v5 from 5.10.5 to 5.11.0
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.10.5 to 5.11.0. - [Release notes](https://github.com/containers/image/releases) - [Commits](https://github.com/containers/image/compare/v5.10.5...v5.11.0) Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/vbauerster/mpb/v5/cwriter/writer_windows.go')
-rw-r--r--vendor/github.com/vbauerster/mpb/v5/cwriter/writer_windows.go73
1 files changed, 0 insertions, 73 deletions
diff --git a/vendor/github.com/vbauerster/mpb/v5/cwriter/writer_windows.go b/vendor/github.com/vbauerster/mpb/v5/cwriter/writer_windows.go
deleted file mode 100644
index 1a69c81ac..000000000
--- a/vendor/github.com/vbauerster/mpb/v5/cwriter/writer_windows.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// +build windows
-
-package cwriter
-
-import (
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var kernel32 = windows.NewLazySystemDLL("kernel32.dll")
-
-var (
- procSetConsoleCursorPosition = kernel32.NewProc("SetConsoleCursorPosition")
- procFillConsoleOutputCharacter = kernel32.NewProc("FillConsoleOutputCharacterW")
-)
-
-func (w *Writer) clearLines() error {
- if !w.isTerminal {
- // hope it's cygwin or similar
- return w.ansiCuuAndEd()
- }
-
- var info windows.ConsoleScreenBufferInfo
- if err := windows.GetConsoleScreenBufferInfo(windows.Handle(w.fd), &info); err != nil {
- return err
- }
-
- info.CursorPosition.Y -= int16(w.lineCount)
- if info.CursorPosition.Y < 0 {
- info.CursorPosition.Y = 0
- }
- _, _, _ = procSetConsoleCursorPosition.Call(
- uintptr(w.fd),
- uintptr(uint32(uint16(info.CursorPosition.Y))<<16|uint32(uint16(info.CursorPosition.X))),
- )
-
- // clear the lines
- cursor := &windows.Coord{
- X: info.Window.Left,
- Y: info.CursorPosition.Y,
- }
- count := uint32(info.Size.X) * uint32(w.lineCount)
- _, _, _ = procFillConsoleOutputCharacter.Call(
- uintptr(w.fd),
- uintptr(' '),
- uintptr(count),
- *(*uintptr)(unsafe.Pointer(cursor)),
- uintptr(unsafe.Pointer(new(uint32))),
- )
- return nil
-}
-
-// 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
- }
- // terminal.GetSize from crypto/ssh adds "+ 1" to both width and height:
- // https://go.googlesource.com/crypto/+/refs/heads/release-branch.go1.14/ssh/terminal/util_windows.go#75
- // but looks like this is a root cause of issue #66, so removing both "+ 1" have fixed it.
- return int(info.Window.Right - info.Window.Left), int(info.Window.Bottom - info.Window.Top), nil
-}
-
-// IsTerminal returns whether the given file descriptor is a terminal.
-func IsTerminal(fd int) bool {
- var st uint32
- err := windows.GetConsoleMode(windows.Handle(fd), &st)
- return err == nil
-}