We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63b692b commit e559fb2Copy full SHA for e559fb2
cmd/llm/chat.go
@@ -42,8 +42,9 @@ func (cmd *ChatCmd) Run(globals *Globals) error {
42
if !cmd.NoStream {
43
opts = append(opts, llm.WithStream(func(cc llm.Completion) {
44
if text := cc.Text(0); text != "" {
45
- text = strings.ReplaceAll(text, "\n", " ")
46
- fmt.Print("\r" + text)
+ count := strings.Count(text, "\n")
+ fmt.Print(strings.Repeat("\033[F", count) + strings.Repeat(" ", count) + "\r")
47
+ fmt.Print(text)
48
}
49
}))
50
0 commit comments