[GH-ISSUE #1275] strange new lines in chat response when using Chinese #47166

Closed
opened 2026-04-28 03:24:03 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @kiang on GitHub (Nov 25, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1275

Originally assigned to: @joshyan1 on GitHub.

I'm using ollama in Ubuntu 22.04. The command line chat interface has some problems if the response is using Chinese characters.

Just recorded a video to tell the issue:
https://youtu.be/Z3-zy90lO3w

Unexpected new line characters were inserted into the response and break the answering message. This problem was found in almost all recent versions.

Originally created by @kiang on GitHub (Nov 25, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1275 Originally assigned to: @joshyan1 on GitHub. I'm using ollama in Ubuntu 22.04. The command line chat interface has some problems if the response is using Chinese characters. Just recorded a video to tell the issue: https://youtu.be/Z3-zy90lO3w Unexpected new line characters were inserted into the response and break the answering message. This problem was found in almost all recent versions.
GiteaMirror added the clibug labels 2026-04-28 03:24:03 -05:00
Author
Owner

@Giftia commented on GitHub (Nov 27, 2023):

I am also have the same problem too on MacOS 14.1.1 with recent version of ollama.

<!-- gh-comment-id:1827427009 --> @Giftia commented on GitHub (Nov 27, 2023): I am also have the same problem too on `MacOS 14.1.1` with recent version of ollama.
Author
Owner

@1linguowei commented on GitHub (Dec 10, 2023):

Me, too. The bug has been a long time!!!

<!-- gh-comment-id:1848920853 --> @1linguowei commented on GitHub (Dec 10, 2023): Me, too. The bug has been a long time!!!
Author
Owner

@pdevine commented on GitHub (Jan 22, 2024):

Sorry about this one, guys. I believe there are two problems here:

  1. we're not detecting the edge of the screen correctly with multi-byte chars; and
  2. when we "brack track" to erase the extra characters at the line wrap, we're not counting the number of characters correctly
<!-- gh-comment-id:1904529256 --> @pdevine commented on GitHub (Jan 22, 2024): Sorry about this one, guys. I believe there are two problems here: 1. we're not detecting the edge of the screen correctly with multi-byte chars; and 2. when we "brack track" to erase the extra characters at the line wrap, we're not counting the number of characters correctly
Author
Owner

@pdevine commented on GitHub (Jan 22, 2024):

Also, for now, a workaround is to include the --nolinewrap flag when you're calling ollama run.

<!-- gh-comment-id:1904617484 --> @pdevine commented on GitHub (Jan 22, 2024): Also, for now, a workaround is to include the `--nolinewrap` flag when you're calling `ollama run`.
Author
Owner

@dhiltgen commented on GitHub (Jun 1, 2024):

Fixed in 0.1.39

https://github.com/ollama/ollama/releases

<!-- gh-comment-id:2143563246 --> @dhiltgen commented on GitHub (Jun 1, 2024): Fixed in 0.1.39 https://github.com/ollama/ollama/releases
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#47166