Skip to content
New issue

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

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

Already on GitHub? # to your account

Icons are broken [WSL / Ubuntu] #379

Closed
AkimaLunar opened this issue Aug 7, 2020 · 13 comments
Closed

Icons are broken [WSL / Ubuntu] #379

AkimaLunar opened this issue Aug 7, 2020 · 13 comments

Comments

@AkimaLunar
Copy link

Description

Type of issue: Font-related

I have tried a bunch of different Nerd fonts to no avail. All the font icons work fine in the Spaceship prompt, which makes me think it might be a icon mapping issue specific to my system (WSL2).

System:
Windows 10 Pro 2004 19041.421
WSL2 Ubuntu 18.04.4 LTS
Hyper / VS Code

image

@avdv
Copy link
Collaborator

avdv commented Aug 8, 2020

Hi.

What version of colorls are you using? And what is the output of locale?

@pergpau
Copy link

pergpau commented Aug 20, 2020

Same issue and setup, on WSL2.
Using Hyper with zsh.

➜ colorls --version
1.4.2

➜ locale
LANG=en_US.UTF8
LANGUAGE=
LC_CTYPE="en_US.UTF8"
LC_NUMERIC="en_US.UTF8"
LC_TIME="en_US.UTF8"
LC_COLLATE="en_US.UTF8"
LC_MONETARY="en_US.UTF8"
LC_MESSAGES="en_US.UTF8"
LC_PAPER="en_US.UTF8"
LC_NAME="en_US.UTF8"
LC_ADDRESS="en_US.UTF8"
LC_TELEPHONE="en_US.UTF8"
LC_MEASUREMENT="en_US.UTF8"
LC_IDENTIFICATION="en_US.UTF8"
LC_ALL=

@avdv
Copy link
Collaborator

avdv commented Aug 24, 2020

How did you configure fontFamily for Hyper, which nerd font did you install? Does colorls work in other terminal emulators?

@AkimaLunar
Copy link
Author

Here is what I've got, @avdv. Thanks!

➜ colorls --version
1.4.2
➜ locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

(1) How did you configure fontFamily for Hyper, which nerd font did you install?

    // font family with optional fallbacks
    fontFamily: '"Source Code Pro for Powerline", monospace',

(2) Does colorls work in other terminal emulators?

  • Doesn't work in Hyper.js
  • Doesn't work in VS Code

@avdv
Copy link
Collaborator

avdv commented Sep 7, 2020

 // font family with optional fallbacks
    fontFamily: '"Source Code Pro for Powerline", monospace',

This is not a Nerd font. The corresponding Nerd font is called "SauceCodePro Nerd Font" (renamed because of legal reasons), see here.

@AkimaLunar
Copy link
Author

Thanks, @avdv! That was it! I thought Powerline and nerd font were the same thing 🤦‍♀️ Thanks for helping!

@avdv
Copy link
Collaborator

avdv commented Sep 8, 2020

Closing, since this should be resolved.

@avdv avdv closed this as completed Sep 8, 2020
@pergpau
Copy link

pergpau commented Sep 9, 2020

I still have the same problem with these font settings in Hyper. It works fine on my laptop with Ubuntu desktop.
// font family with optional fallbacks
fontFamily: '"Fira Code", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',

@avdv
Copy link
Collaborator

avdv commented Sep 9, 2020

I still have the same problem with these font settings in Hyper. It works fine on my laptop with Ubuntu desktop.
// font family with optional fallbacks
fontFamily: '"Fira Code", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',

You need to install a Nerd Font first. Then you should add that font to the setting in hyper. All Nerd Fonts have "Nerd Font" in their name.

@pergpau
Copy link

pergpau commented Sep 10, 2020

Thanks, I got it fixed now!
It was a Nerd font downloaded from here https://www.nerdfonts.com/font-downloads but for some reason Fira Code wouldn't work. I switched to the one called FuraCoda and now it works :)

@bluebrown
Copy link

I dont get it to work either. I tried out a bunch of different fonts, they work via windows terminal partwise but not with the regular ubuntu terminal.

For example here I have set FiraCode NerdFont

settings showing foracode nerdfont

But In my terminal the smbol is not showing, only that question mark box:

terminal with broken fonts

@avdv
Copy link
Collaborator

avdv commented Jan 25, 2023

@bluebrown try to use a different variant instead of "Mono". Especially the "Windows Compatible" variants maybe?

@otaolafranc
Copy link

otaolafranc commented Jun 10, 2023

Hello, I am having a similar issue? I am using WSL with ubuntu, and FiraCode, I followed this tutorial: https://www.youtube.com/watch?v=2LEnBXH8xV0&t=2s
The thing is that, I have two possibilities to open the linux terminal:

  • right click, and 'Open in terminal' which will open the linux terminal in the root directory (not expected behavior, I explain at the end of the phrase) and the fonts and icons will work correctly. what is really annoying of this is that it opens the terminal in the root directory and not in the current directory where I did the right click
  • shit+right click and 'Open linux shell here' which will open the linux terminal in the current folder (so correct behavior), the fonts and some icons will not load correctly.
    here is an image if the difference in behavior:
    image
    in my .bashrc I have added the following lines:

export BREW_HOME="/home/linuxbrew/.linuxbrew/bin"
export PATH="$PATH:$BREW_HOME"
#eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" I also tried with this line uncommented and the first two commented
eval "$(oh-my-posh init bash --config $(brew --prefix oh-my-posh)/themes/unicorn.omp.json)"

the fonts, I downloaded from: https://www.nerdfonts.com/font-downloads and also installed inside the linux terminal using oh-my-posh font install and selecting FiraCode
I would like to use the oh-my-posh as it makes the terminal really pretty, but in terms of usability I need to be able to open the terminal in the current folder :/
any helps with this issue?
thanks
EDIT:
okey I still don't know the exact issue, but I make it work, the thing is that the 'ubuntu' profile from CanonicalGroupLimited, when we open it it opens in the ~ directory, eventhought in the app is clarified to open it in the current folder. and secondly I found that when using 'Open linux shell here' the icons are not loaded, so what solved was to use the windows profile as default in terminal, so it will open in the correct place and when using 'open in terminal' will load correctly the icons. the reason for all these I don't know, I assume that is something in the json profile that I am missing but I didn't understood, here are the two of them (and yes I tried with coping the "startingDirectory": null to the profile that does not have it.... the one that has it is the one that 'works', from the terminal options everything looked the same for the two profiles.)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants