summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-07 11:22:15 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-01-07 11:32:11 +0900
commitd914d40b2e7bfaeda966f2bd539bd45aef8cebe0 (patch)
treef95f7eaa7f789dff8de509827fab789ed20fe052
parent818134247ddcde74d7d33c534c7696c9481f3028 (diff)
Use ASCII on Windows with east asian locale
-rw-r--r--go.mod2
-rw-r--r--pkg/gui/gui.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/go.mod b/go.mod
index c2270c9a0..118c2b621 100644
--- a/go.mod
+++ b/go.mod
@@ -19,7 +19,7 @@ require (
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect
- github.com/mattn/go-runewidth v0.0.7 // indirect
+ github.com/mattn/go-runewidth v0.0.7
github.com/mgutz/str v1.2.0
github.com/nicksnyder/go-i18n/v2 v2.0.3
github.com/onsi/ginkgo v1.10.3 // indirect
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index ba379fc56..5b2f9cc14 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -5,6 +5,7 @@ import (
"io/ioutil"
"math"
"os"
+ "runtime"
"sync"
// "io"
@@ -28,6 +29,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/theme"
"github.com/jesseduffield/lazygit/pkg/updates"
"github.com/jesseduffield/lazygit/pkg/utils"
+ "github.com/mattn/go-runewidth"
"github.com/sirupsen/logrus"
)
@@ -782,6 +784,8 @@ func (gui *Gui) Run() error {
}
defer g.Close()
+ g.ASCII = runtime.GOOS == "windows" && runewidth.IsEastAsian()
+
if gui.Config.GetUserConfig().GetBool("gui.mouseEvents") {
g.Mouse = true
}