mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-31 22:36:41 -04:00
Move packages out of src/
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//go:build windows
|
||||
|
||||
package backend
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// EntryRoot path to libmutton entry directory
|
||||
var EntryRoot = Home + "\\AppData\\Local\\libmutton\\entries"
|
||||
var ConfigDir = Home + "\\AppData\\Local\\libmutton\\config"
|
||||
var ConfigPath = ConfigDir + "\\libmutton.ini"
|
||||
|
||||
// PathSeparator defines the character used to separate directories in a path (platform-specific)
|
||||
const (
|
||||
PathSeparator = "\\"
|
||||
IsWindows = true
|
||||
)
|
||||
|
||||
// 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))
|
||||
}
|
||||
Reference in New Issue
Block a user