From 6d1a8405871c87afccd2f495a2849a10c608787c Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Mon, 20 Jul 2020 01:36:22 +0300 Subject: [PATCH] handle unicode characters in 'push' command Related #250 --- ui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui.go b/ui.go index 4cd7f9f..8823291 100644 --- a/ui.go +++ b/ui.go @@ -816,7 +816,7 @@ func (ui *ui) pollEvent() termbox.Event { case key := <-ui.keyChan: ev := termbox.Event{Type: termbox.EventKey} - if len(key) == 1 { + if utf8.RuneCountInString(key) == 1 { ev.Ch, _ = utf8.DecodeRuneInString(key) } else { switch {