mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-28 12:56:31 -04:00
32 lines
1002 B
Go
32 lines
1002 B
Go
//go:build windows
|
|
|
|
package core
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
var (
|
|
EntryRoot = Home + "\\AppData\\Local\\libmutton\\entries" // Path to libmutton entry directory
|
|
ConfigDir = Home + "\\AppData\\Local\\libmutton\\config" // Path to libmutton configuration directory
|
|
ConfigPath = ConfigDir + "\\libmutton.ini" // Path to libmutton configuration file
|
|
)
|
|
|
|
const (
|
|
PathSeparator = "\\" // Platform-specific path separator
|
|
IsWindows = true // Platform indicator
|
|
)
|
|
|
|
// enableVirtualTerminalProcessing ensures ANSI escape sequences are interpreted properly on Windows.
|
|
// TODO Remove after migration off of GPG, as pinentry is responsible for disabling ANSI escape sequence interpretation.
|
|
func enableVirtualTerminalProcessing() {
|
|
stdout := syscall.Handle(os.Stdout.Fd())
|
|
|
|
var originalMode uint32
|
|
syscall.GetConsoleMode(stdout, &originalMode)
|
|
originalMode |= 0x0004
|
|
|
|
syscall.MustLoadDLL("kernel32").MustFindProc("SetConsoleMode").Call(uintptr(stdout), uintptr(originalMode))
|
|
}
|