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

Unicode characters make the prompt disappear #6799

Closed
shreve opened this issue Mar 23, 2020 · 5 comments
Closed

Unicode characters make the prompt disappear #6799

shreve opened this issue Mar 23, 2020 · 5 comments
Labels

Comments

@shreve
Copy link

shreve commented Mar 23, 2020

$ fish --version
fish, version 3.1.0

$ echo $TERM
xterm-256color

Since upgrading to 3.1.0 my prompt has been behaving oddly. The right prompt would shift around and if I resized my window the left prompt would completely disappear.

I tried the blank environment and the issue went away.
I disabled Oh My Fish, reverting back to the default prompt and the issue also went away.
I tried to rebuild my prompt from scratch and the issue was gone until I added back in special characters.

2020-03-23--12-50-22--967x1165

The difference between these two sessions is the presence of ↓ in the left prompt.

One of the characters I had previously tried was an emoji, so I tried different values of $fish_emoji_width, but to no avail.

I'm currently using Konsole, but this also happens in Alacritty.

Even just the presence of a special character in the input seems to break rendering.
2020-03-23--13-42-36--927x554--10s

@faho
Copy link
Member

faho commented Mar 23, 2020

"↓" is not an emoji, it is a character of ambiguous width.

I.e. set fish_ambiguous_width to 1.

@faho faho added the question label Mar 23, 2020
@shreve
Copy link
Author

shreve commented Mar 23, 2020

That didn't result in any difference.

@faho
Copy link
Member

faho commented Mar 23, 2020

Set it to 2?

Otherwise the remaining possibility is that you have more than 1 ambiguous character in your prompt, and that they're rendered of different width.

Can you try reducing it to a simple prompt and share the code?

Also what OS is this on?

@faho
Copy link
Member

faho commented Mar 23, 2020

Oh, wait, this is a duplicate of #6736

You are using a C locale. Stop that and it'll work.

The 3.1.1 release will handle this better, but setting a C locale and using non-ASCII characters is still misconfiguration.

@shreve
Copy link
Author

shreve commented Mar 23, 2020

I had to reconfigure the locale and reboot (that's arch for you), but setting LANG=en_US.UTF-8 resolved this.
@faho Thank you for this, and thank you for all the work you do on fish.

@shreve shreve closed this as completed Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants