Bug Description
In the Hermes TUI/CLI input box, typing Chinese characters (and likely other East Asian wide characters such as Japanese/Korean) renders incorrectly.
The input area appears to calculate layout/cursor/line width as if the characters were single-width, which causes the input box to become visually wrong when entering CJK text.
This looks related to a previous Hermes TUI/input-box rendering bug around line layout / segmentation / width calculation that was fixed for normal English/ASCII input, but the fix does not appear to fully handle East Asian wide characters.
Expected Behavior
When typing Chinese / Japanese / Korean characters in the TUI input box:
- cursor position should stay aligned with the actual text
- wrapped lines should break at the correct visible columns
- the input box border/layout should remain visually correct
- editing should work the same way as with ASCII text
Actual Behavior
When typing Chinese characters in the TUI input box:
- the input box becomes visually wrong / misaligned
- cursor and/or wrapping appears incorrect
- the issue seems specific to East Asian wide characters rather than English text
Steps to Reproduce
- Start Hermes in the TUI / CLI interface
- Focus the normal input box
- Type Chinese text (for example:
你好你好你好你好 or a longer Chinese sentence)
- Continue typing until the line should wrap or the cursor moves across the input region
- Observe that the input box layout/cursor/rendering is incorrect
Example Repro Text
You can reproduce with something like:
你好,这是一个用于测试 Hermes TUI 输入框宽度计算的中文句子。
Or shorter repeated wide characters:
Expected Root Cause Area
Likely related to terminal/TUI width calculation for wide Unicode characters:
- East Asian width / fullwidth character handling
wcwidth / wcswidth behavior
- prompt_toolkit integration for cursor positioning / wrapping
- any custom line segmentation logic added in earlier TUI fixes
Why this may be related to an earlier bug
There was previously a Hermes TUI/input-box rendering bug involving line layout/segmentation that appears to have been fixed for English characters.
This report is specifically that the problem still exists for CJK/East Asian characters, suggesting the previous fix may have assumed single-column characters.
Environment
- Product: Hermes CLI / TUI
- Input language: Chinese (likely affects other East Asian scripts too)
- Character class likely involved: wide Unicode / East Asian width characters
Notes
This issue is about the local TUI input box rendering/editing experience, not model output.
It would be ideal to verify against:
- Chinese input
- Japanese kana/kanji
- Korean Hangul
- mixed ASCII + CJK input
- line wrapping and backspacing near wrap boundaries
Bug Description
In the Hermes TUI/CLI input box, typing Chinese characters (and likely other East Asian wide characters such as Japanese/Korean) renders incorrectly.
The input area appears to calculate layout/cursor/line width as if the characters were single-width, which causes the input box to become visually wrong when entering CJK text.
This looks related to a previous Hermes TUI/input-box rendering bug around line layout / segmentation / width calculation that was fixed for normal English/ASCII input, but the fix does not appear to fully handle East Asian wide characters.
Expected Behavior
When typing Chinese / Japanese / Korean characters in the TUI input box:
Actual Behavior
When typing Chinese characters in the TUI input box:
Steps to Reproduce
你好你好你好你好or a longer Chinese sentence)Example Repro Text
You can reproduce with something like:
Or shorter repeated wide characters:
Expected Root Cause Area
Likely related to terminal/TUI width calculation for wide Unicode characters:
wcwidth/wcswidthbehaviorWhy this may be related to an earlier bug
There was previously a Hermes TUI/input-box rendering bug involving line layout/segmentation that appears to have been fixed for English characters.
This report is specifically that the problem still exists for CJK/East Asian characters, suggesting the previous fix may have assumed single-column characters.
Environment
Notes
This issue is about the local TUI input box rendering/editing experience, not model output.
It would be ideal to verify against: