athityakumar / colorls

A Ruby gem that beautifies the terminal's ls command, with color and font-awesome icons. :tada:
MIT License
4.88k stars 387 forks source link

Icons are broken [WSL / Ubuntu] #379

Closed AkimaLunar closed 4 years ago

AkimaLunar commented 4 years ago

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 commented 4 years ago

Hi.

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

pergpau commented 4 years ago

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 commented 4 years ago

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

AkimaLunar commented 4 years ago

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?

avdv commented 4 years ago
 // 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 commented 4 years ago

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

avdv commented 4 years ago

Closing, since this should be resolved.

pergpau commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 1 year ago

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 commented 1 year ago

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

otaolafranc commented 1 year ago

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:

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.)