Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right Side Elements Are Rendered Off Screen in Windows Terminal #165

Closed
GabrielFerrarini opened this issue Aug 12, 2019 · 7 comments
Closed

Comments

@GabrielFerrarini
Copy link

GabrielFerrarini commented Aug 12, 2019

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:
terminal1

This is my terminal after I get to root privileges:
terminal2

The same issue happens with different configurations (1 line, different icons, different spacing, compact vs concise, etc).

The issue does't happen in the VSCode integrated terminal.
image

image

@romkatv
Copy link
Owner

romkatv commented Aug 12, 2019

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?

@GabrielFerrarini
Copy link
Author

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?

@GabrielFerrarini
Copy link
Author

As for the command, this is what I get:

image

The cursor remains before > and does not move. In VSCode it appears after > ando also does not move.

@romkatv
Copy link
Owner

romkatv commented Aug 12, 2019

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.

@GabrielFerrarini
Copy link
Author

I'll try the Meslo font. I'm using the Hack NF at the moment.

@GabrielFerrarini
Copy link
Author

GabrielFerrarini commented Aug 12, 2019

Ok, with this font it works now. Thanks!

@romkatv
Copy link
Owner

romkatv commented Aug 12, 2019

Good. Thanks for the confirmation.

@romkatv romkatv closed this as completed Aug 12, 2019
romkatv added a commit that referenced this issue Jul 29, 2020
fcebf0b0 support armv8l; see #165; thanks, @ppoffice!
c2e03bc5 use fully-qualified remote ref name; see powerlevel10k/issues/915
dc827169 Merge branch 'master' of github.com:romkatv/gitstatus
4ad671ca build: set -march=armv8 when compiling for Apple's arm64 architecture

git-subtree-dir: gitstatus
git-subtree-split: fcebf0b0f7aff181f2ecc441458d8fc443125ad0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants