From c9e584fb9009faff2b1f2e38b4c7ab86a7d150b1 Mon Sep 17 00:00:00 2001 From: Josh Yan Date: Wed, 15 May 2024 16:45:24 -0700 Subject: [PATCH] updated double-width display --- cmd/cmd.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/cmd.go b/cmd/cmd.go index 1606e9f1..91a77c79 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -745,6 +745,7 @@ func displayResponse(content string, wordWrap bool, state *displayResponseState) if wordWrap && termWidth >= 10 { for _, ch := range content { if state.lineLength+1 > termWidth - 5 { + if runewidth.StringWidth(state.wordBuffer) > termWidth - 10 { fmt.Printf("%s%c", state.wordBuffer, ch) state.wordBuffer = ""