mirror of
https://github.com/containers/skopeo.git
synced 2025-09-23 02:48:26 +00:00
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/sirupsen/logrus/releases) - [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md) - [Commits](https://github.com/sirupsen/logrus/compare/v1.5.0...v1.6.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
36 lines
689 B
Go
36 lines
689 B
Go
// +build windows
|
|
|
|
package sequences
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
var (
|
|
kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll")
|
|
setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode")
|
|
)
|
|
|
|
func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error {
|
|
const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4
|
|
|
|
var mode uint32
|
|
err := syscall.GetConsoleMode(syscall.Stdout, &mode)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if enable {
|
|
mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
|
} else {
|
|
mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
|
}
|
|
|
|
ret, _, err := setConsoleMode.Call(uintptr(stream), uintptr(mode))
|
|
if ret == 0 {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|