From c0c0d3afc6a03bcb5c1df10b70b862a650db9f9b Mon Sep 17 00:00:00 2001 From: mritd Date: Fri, 9 Mar 2018 00:10:52 +0800 Subject: [PATCH] Fix display problem when deleting UTF-8 characters sequence --- prompt.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prompt.go b/prompt.go index 07e2897..9fdfcb6 100644 --- a/prompt.go +++ b/prompt.go @@ -149,7 +149,8 @@ func (p *Prompt) Run() (string, error) { input = "" } if len(input) > 0 { - input = input[:len(input)-1] + r := []rune(input) + input = string(r[:len(r)-1]) } default: if eraseDefault {