3

I recently started using Arch Linux and just installed Powerline and Fish (version 3.0.0) last week. In my terminal, which is Termite (version 14), there's a large (horizontal) space between the shell prompt and where my cursor is when inputting commands that is quite bothersome.

As additional information, I'm using OMF with the bobthefish theme. When I first installed and used the theme, I didn't notice any change, so I don't know if it's working properly. It does say that it is the active theme though.

It wasn't like this before I installed Powerline. Unfortunately, I haven't been able to find any other discussions on similar problems.

This is how it currently looks in a default-sized terminal:
enter image description here

And in a maximized terminal:
enter image description here

I was thinking that it could be a problem with my font, as I just checked and my font in the termite .config file is Hack at size 9. When I use a Powerline font, however, it doesn't render correctly in the terminal. I tried doing both this way:

font = "Ubuntu\ Mono\ derivative\ Powerline" 11

And this way:

font = Ubuntu Mono derivative Powerline 11

In the terminal config file, but neither display properly. Perhaps the powerline fonts are not in the correct folder. They are located in

~/.local/share/fonts

In fact, other fonts, located in /usr/share/fonts also don't render correctly.

3
  • You should always include the version of all relevant software in your question. In this case fish and termite. Commented Feb 15, 2019 at 18:43
  • 2
    Welcome to Super User! You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you registered and created a second account, which will also interfere with your ability to comment within your thread and to accept an answer. See Merge my accounts to get your accounts merged, which will solve the problem.
    – fixer1234
    Commented Feb 15, 2019 at 23:30
  • Hello, I really appreciate the help. I finally was able to get the accounts merged. Apologies for the delay; I've been really swamped with school projects. I was also wondering if superuser was the right place to ask this question or if I should have picked another site. Additionally, I forgot to mention I'm using the theme "bobthefish" I'll update my post. Commented Feb 22, 2019 at 23:56

3 Answers 3

3

This occurs when fish and your terminal don't agree on the width of specific characters.

It is almost always emoji chars since the width of many emoji code points has changed as the Unicode standard has evolved. Complicating matters are magical code points such as U+FE0F which themselves don't have any width but affect the preceding code point.

The simplest solution is to pick different characters. Alternatively, there are various workarounds you can employ to change how fish and your terminal calculate the width of problematic chars.

See, for example, https://github.com/fish-shell/fish-shell/issues/5583

4
  • Thanks for the help! I've looked into it, but have been unable to have any success. I'm a total noob at fish and customizing terminals in general. I'm unable to get anything from using wcwidth or fish_emoji_width. After using set $fish_emoji_width=2 it lists a lot of configuration entires, but when echoing fish_emoji_width, it still only prints a whitespace. Also, most unicode characters are not rendering well and am having difficulty printing them. Any other ideas? Commented Feb 23, 2019 at 0:00
  • @QhapaqQowi Your syntax for setting a variable is incorrect. It wouldn't even be correct for a POSIX shell like bash. The correct syntax is set fish_emoji_width 2. Note the lack of a dollar or equal sign. Also, if you're having problems with non-ASCII chars in general you should check your locale is correctly set. If you type locale you should see something like LANG="en_US.UTF-8"; i.e., a UTF-8 locale. Commented Feb 24, 2019 at 0:00
  • Wow, well that's embarassing haha. Thank you for the edification! I've been trying to learn more about these things. I updated the locale as you mentioned and it worked!!! Somehow I thought I tried it earlier without success, but I realized that it didn't persist throughout terminal sessions. I've fixed it though, and it behaves properly and persists. Thank you so much; I really appreciate it! Commented Feb 24, 2019 at 4:17
  • I've adjust set fish_emoji_width 2 into my fish.config but still there is large whitespace in my terminal :| could you please tell me how to solve it?
    – Amir
    Commented Feb 29, 2020 at 14:19
2

Had the same issue, fixed with reconfigure locales. Seems to be width can also be calculated badly due to non-UTF / UTF locales, try to run:

dpkg-reconfigure locales

(I resolved issue via Saltstack configuration)

0

As they said above I add set fish_emoji_width 2 to the end of fish.config file, however the problem still continued... In my case I have two different languages configured in locale:

$ locale

It was necessary uncomment the line with my locales in: /etc/locale.gen (edit as root)

To save the changes made in the previous file run:

$ sudo locale-gen

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .