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

Prompt glitches with emojis #7237

Closed
TheEdoRan opened this issue Aug 4, 2020 · 2 comments
Closed

Prompt glitches with emojis #7237

TheEdoRan opened this issue Aug 4, 2020 · 2 comments
Milestone

Comments

@TheEdoRan
Copy link

Environment

Fish version: 3.1.2
OS: Arch Linux
Terminal: kitty, via tmux

Computer is an ASUS VivoBook Pro N580GD, with Intel graphics + NVIDIA GTX 1050. I use nvidia-prime package, which automatically configures offloading. I almost exclusively use integrated graphics only (these tests were made with integrated graphics).

Bug

fish_emoji_bug

When pasting emojis (it could happen with other unicode characters), viewing history or triggering completion with them, the prompt glitches and it's impossible to see which characters are being typed (in case of completion).

Tests

  • The first test had the fish_emoji_width variable set to 1; with this configuration, prompt behaves as it should with emojis like flags (which I think are double width), but emojis like faces mess it up, duplicating characters.

  • The second test had the fish_emoji_width variable set to 2 (the default); with this configuration, prompt behaves as it should with emojis like faces (single width), but messes up with double-width, like flags.

Additional information

Plugins/other modifications

I use fisher as a plugin manager, with several plugins and some configuration put in ~/.config/fish/conf.d folder.
I tried removing all the content from ~/.config/fish and from ~/.local/share/fish.

The tests had the same results with no configuration and the default fish prompt.

Fonts

  • Emoji font is noto-fonts-emoji, but I tried with ttf-joypixels too. I also tried completely uninstalling emoji fonts, and viewing history, the prompt behaves incorrectly anyway.
  • Monospace font is Hack Nerd Font, but I made the same tests with several other fonts, including non-nerd fonts ones, with the same exact results.

Terminal

In these tests I used kitty terminal, but I tried with Alacritty and gnome-terminal too. I also tried with/without tmux, all with the same exact results.

Locale

Output of locale command:

LC_CTYPE="it_IT.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_COLLATE="it_IT.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_MESSAGES="it_IT.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_NAME="it_IT.UTF-8"
LC_ADDRESS="it_IT.UTF-8"
LC_TELEPHONE="it_IT.UTF-8"
LC_MEASUREMENT="it_IT.UTF-8"
LC_IDENTIFICATION="it_IT.UTF-8"
LC_ALL=

I also tried with en_US.UTF-8 set as locale, with the same results.

Other shells

I made the same tests (history, normal typing, but no completion) with bash and zsh too.
The glitch does not occur in any of these other shells.

@ridiculousfish
Copy link
Member

ridiculousfish commented Aug 4, 2020

Thanks for filing. Flags are a combination of two code points, it looks like widecharwidth incorrectly believes these became doublewidth in Unicode 9, when in fact they are narrow. This should be fixable.

@ridiculousfish
Copy link
Member

I was able to fix this for terminals that render flags as width 2, including kitty. Terminals with width 1 flags are still broken unfortunately but I will still close this. Thank you for filing, this was a good catch!

@ridiculousfish ridiculousfish added this to the fish 3.2.0 milestone Aug 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants