mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* fix(deps): update module github.com/olekukonko/tablewriter to v1 | datasource | package | from | to | | ---------- | --------------------------------- | ------ | ------ | | go | github.com/olekukonko/tablewriter | v0.0.5 | v1.1.2 | Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> * Fixed compilation errors due to breaking changes --------- Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> Co-authored-by: Oleg Kozliuk <[email protected]>
35 lines
608 B
Go
35 lines
608 B
Go
//go:build windows && !appengine
|
|
// +build windows,!appengine
|
|
|
|
package runewidth
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
var (
|
|
kernel32 = syscall.NewLazyDLL("kernel32")
|
|
procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP")
|
|
)
|
|
|
|
// IsEastAsian return true if the current locale is CJK
|
|
func IsEastAsian() bool {
|
|
if os.Getenv("WT_SESSION") != "" {
|
|
// Windows Terminal always not use East Asian Ambiguous Width(s).
|
|
return false
|
|
}
|
|
|
|
r1, _, _ := procGetConsoleOutputCP.Call()
|
|
if r1 == 0 {
|
|
return false
|
|
}
|
|
|
|
switch int(r1) {
|
|
case 932, 51932, 936, 949, 950:
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|