简体   繁体   中英

Fish Shell Fix Emoji Spacing iTerm2 MacOS

In iTerm2 using fish shell 2.7.1 emojis do not display properly

With Unicode 9 widths turned on in iTerm, emojis are wack

在此处输入图片说明 With Right Hand Prompt 在此处输入图片说明 Without Right Hand Prompt 在此处输入图片说明

Without Unicode 9 widths, emojis are smushed.

How can I fix this?

在此处输入图片说明

This is due to an outdated wc-width function in fish for determining how much space each character gets. This supposedly will be fixed in fish 3. If you want emojis to work properly in fish 2.xx:

  1. Build source from GitHub AND instead of cmake .. do cmake -DINCLUDED_WCWIDTH=OFF .. . This will use your system's wc-width function, which should be better when using MacOS.

  2. Add set -g fish_emoji_width 2 to ~/.config/config.fish . This will make emojis by default have a width of 2, which should fix spacing issues.

This issue is explained in-detail here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM