Right Side Elements Are Rendered Off Screen in Windows Terminal
GabrielFerrarini opened this issue · comments
I'm using the Hack Nerd Font
font and have zsh-syntax-highlighting
and zsh-autosuggestions
plugins installed.
These are my right element prompts =
(
status
command_execution_time
node_version
context
newline
time
)
This is my terminal when I open it and go to a node folder:
This is my terminal after I get to root privileges:
The same issue happens with different configurations (1 line, different icons, different spacing, compact vs concise, etc).
From the screenshot it seems like VS Code incorrectly renders some glyphs. Specifically, it renders some glyphs as double-width when they should be single-width. You can verify this with the following command:
PROMPT=$'\uF31B \uF015 > ' RPROMPT=$'< \uF31B \uF015' zsh -df
Once prompt appears, note where the cursor is. Now hit ctrl-r
. In a correct terminal the cursor shouldn't move but it will probably move for you. You can also type ls
and hit tab
. The cursor also shouldn't move but it will likely move for you, indicating that the terminal is faulty.
Some terminals have an option to enable this brokenness. It's called something like "Treat ambiguous-width characters as double width". This is an euphemism for "render my ZSH broken" and it should never be turned on. If Windows Terminal has an option like this, you need to turn it off.
I cannot reproduce this problem, so we are either using different versions of Windows Terminal or different settings. The only thing I've changed in my settings is fontFace
, which I've set to MesloLGS NF
. Have you changed anything else?
I changed some stlying things only. And I`m using Version: 0.3.2171.0. I found this issue though microsoft/terminal#2066. Do you think it's related?
I found this issue though microsoft/terminal#2066. Do you think it's related?
Yes, that's definitely related. Ambiguous characters must be narrow in any terminal. Asking the font is wrong (unless the user explicitly enables "break ZSH" option).
Are you using MesloLGS NF
from powerlevel10k? I think it'll work correctly even in the presence of this bug in the Windows Terminal.
There are other bugs though. Quite a few of them. The new Windows Terminal is not yet in a state where could recommend it to anyone over the old Command Prompt.
The cursor remains before
>
...
That's an indication of broken terminal.
I'll try the Meslo font. I'm using the Hack NF at the moment.
Ok, with this font it works now. Thanks!
Good. Thanks for the confirmation.