ZSH: prompt line not wrapping correctly
See original GitHub issueDetails
- OS version: MacOS Catalina
Steps to reproduce
- Run the demo, it starts with a
bash
- type a lot of text, note that the prompt line wraps correctly, deleting characters works as expected
- Press
CTRL+C
, startzsh
- type a lot of text, note that the prompt line does not wrap, deleting characters will eventually erase the wrong line
This doesn’t happen in Terminal.app
or iTerm
. It also does not happen in VSCode 1.39.2
I tried xterm@3.0.0 demo and it also shows this wrong behaviour.
Can anyone reproduce?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Long lines wrap problem with zsh terminal
There are "zero width" characters in your prompt that must be flagged as such. None of your COLOR_* strings change the cursor position....
Read more >iTerm2 - text not wrapping with emoji in zsh prompt
I am making a personal theme for oh-my-zsh! but with my current prompt the text doesn't wrap onto a new line and instead...
Read more >Bash terminal not wrapping text correctly - linux - Super User
This seems somewhat related: Wrapping the tput output in \[ \] is recommended by the Bash man page. This helps Bash ignore non-printable ......
Read more >Known Issues - Warp Documentation
The native Prompt does not support multi-line at this time and does not support right sided prompts. Improving the native Prompt is on...
Read more >Zsh and Fish's simple but clever trick for highlighting missing ...
For example, some terminals will wrap to the next line if you are at ... It's actually not overwritten by the prompt but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Turns out this seems to be somewhat Mac specific. The
LC_CTYPE
environment variable was not set, which will mess up encoding. Manually setting it to “en_US.UTF-8” or “UTF-8” fixes the problem. VSCode and Terminus both have special handling for this kind of problem:https://github.com/Eugeny/terminus/blob/3d013195cec7e848e9c4404b090efca6332ab2eb/terminus-terminal/src/services/sessions.service.ts
https://github.com/microsoft/vscode/blob/c58aaab8a1cc22a7139b761166a0d4f37d41e998/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts#L101-L175
I’m closing this as it’s not xterm.js related.
@jerch Coming from this problem, your description above (and also what’s in the new encoding guide) exactly replicates what I’ve seen! Thanks for the explanation, it all makes sense now!