2022-02-01 01:26:17 +03:00
|
|
|
//go:build windows
|
2021-04-05 16:58:36 +03:00
|
|
|
// +build windows
|
|
|
|
|
|
|
|
package lipgloss
|
|
|
|
|
|
|
|
import (
|
2021-04-06 22:12:44 +03:00
|
|
|
"sync"
|
2021-04-05 16:58:36 +03:00
|
|
|
|
2022-02-01 01:26:17 +03:00
|
|
|
"github.com/muesli/termenv"
|
2021-04-05 16:58:36 +03:00
|
|
|
)
|
|
|
|
|
2021-04-06 22:12:44 +03:00
|
|
|
var enableANSI sync.Once
|
|
|
|
|
2021-04-05 16:58:36 +03:00
|
|
|
// enableANSIColors enables support for ANSI color sequences in the Windows
|
|
|
|
// default console (cmd.exe and the PowerShell application). Note that this
|
|
|
|
// only works with Windows 10. Also note that Windows Terminal supports colors
|
|
|
|
// by default.
|
2021-04-06 22:12:44 +03:00
|
|
|
func enableLegacyWindowsANSI() {
|
|
|
|
enableANSI.Do(func() {
|
2022-02-01 01:26:17 +03:00
|
|
|
_, _ = termenv.EnableWindowsANSIConsole()
|
2021-04-06 22:12:44 +03:00
|
|
|
})
|
2021-04-05 16:58:36 +03:00
|
|
|
}
|