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

Missing colors after installing nerd-fonts #365

Closed
tnorthcutt opened this issue May 4, 2020 · 34 comments
Closed

Missing colors after installing nerd-fonts #365

tnorthcutt opened this issue May 4, 2020 · 34 comments

Comments

@tnorthcutt
Copy link
Contributor

I recently moved to a new machine, and as a result, icons were missing in the output of lsd (instead I saw a [?] icon).

Today I followed the instructions in this comment to install and configure nerd-fonts for iTerm2, which worked. However, now the color output of lsd is gone.

I tried uninstalling and reinstalling lsd (with brew uninstall lsd and brew install lsd), but that did not result in a change.

Current output:
CleanShot 2020-05-04 at 07 03 27@2x


iTerm2 settings:
CleanShot 2020-05-04 at 07 04 08@2x

@tnorthcutt tnorthcutt added the kind/bug Something isn't working label May 4, 2020
@meain
Copy link
Member

meain commented May 4, 2020

What are the values for $TERM and $LS_COLORS?

@tnorthcutt
Copy link
Contributor Author

@meain $TERM is xterm-256color; echo $LS_COLORS produces no output

@meain
Copy link
Member

meain commented May 6, 2020

Could you check if lsd --color always works?

@tnorthcutt
Copy link
Contributor Author

@meain lsd --color always results in the same output as a regular ls (which is aliased to lsd): icons and bolding, but no colors.

@meain
Copy link
Member

meain commented May 7, 2020

Hey, so far I don't have much of a clue as to what is happening. Could you give a few more details.

  • lsd --version
  • your shell (if zsh, are you using oh-my-zsh?)
  • value of which lsd
  • is there any color with lsd -l for items like date and user?

@tnorthcutt
Copy link
Contributor Author

@meain Absolutely! I appreciate your attempts to help 😄

  • lsd --version: 0.17.0
  • zsh, and yes using oh-my-zsh
  • which lsd: /usr/local/bin/lsd
  • lsd -l: yes, color for some things! Output below:

CleanShot 2020-05-07 at 08 15 35@2x

@meain
Copy link
Member

meain commented May 7, 2020

I have a feeling that LS_COLORS might be set as blank(just spaces) string or something.
Could you try doing unset LS_COLORS and run lsd after that.

If that works, awesome.
Else, maybe try setting LS_COLORS to the one below and call lsd. If that works, I guess you can use this is a temporary workaround until we figure what is happening.

rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:

@devanshuDesai
Copy link

devanshuDesai commented May 9, 2020

Facing the exact same issue on 0.17.0. iTerm2 + Solarized Background + Zsh + Agnoster.
For the record, colorls works perfectly fine on this configuration but exa doesn't.

@meain
Copy link
Member

meain commented May 9, 2020

@devanshuDesai could you see if my previous comment fixes anything? #365 (comment)

@devanshuDesai
Copy link

@meain Getting a "not found" error on my source ~/.zshrc when I try setting $LS_COLORS to your string

@meain
Copy link
Member

meain commented May 9, 2020

Not sure how you got "not found" error.
How are you setting LS_COLORS? Just in case, this is how you would do it.
export LS_COLORS='rs=0.....9'

Also, did unset LS_COLORS && lsd work?

@devanshuDesai
Copy link

devanshuDesai commented May 9, 2020

yes, that is exactly how I set it. And no unsetting did not work.
EDIT: Never mind. I was accidently setting that value to $ZSH instead of $LS_COLORS. No, this did not resolve the issue

@lcosmin
Copy link

lcosmin commented May 11, 2020

Happens here too, no LS_COLORS set. It seems to me that lsd uses a different shade of blue for folders (in my case, see screenshots) than the normal ls, and when switching to the solarized theme, that color gets clobbered.

So, I'd say the issue is a combination between lsd and the solarized theme.

Regular iTerm theme (dark background):

Screenshot 2020-05-11 at 08 23 49

Solarized theme:
Screenshot 2020-05-11 at 08 24 06

@mixomat
Copy link

mixomat commented May 15, 2020

@lcosmin yes, that seems to be the issue, I'm also using the iterm2 solarized dark theme, other themes work just fine

@meain
Copy link
Member

meain commented May 18, 2020

The issue is that the default colors we are using is conflicting with the colorschemes you are using. At least in case of solarized it is muting the blue color that we are using for folders.

One thing that you could do is to change the value of dir in LS_COLORS. The default value is as mentioned #365 (comment). You could change the number to the right of di to change what color get applied for directories.

@Kastakin
Copy link

Kastakin commented May 18, 2020

I sttumbled here having similar issue on a Linux machine working with zsh + oh-my-zsh:

I solved the issue with:
DISABLE_LS_COLORS="true"

in my .zshrc file. It should be a commented line generated automatically during the oh-my-zsh installation process, uncomment it and you will be fine!

@devanshuDesai
Copy link

@Kastakin I tried disabling it. No luck.

@ericmtzmtz
Copy link

I sttumbled here having similar issue on a Linux machine working with zsh + oh-my-zsh:

I solved the issue with:
DISABLE_LS_COLORS="true"

in my .zshrc file. It should be a commented line generated automatically during the oh-my-zsh installation process, uncomment it and you will be fine!

Hi, can you share your conf file?
I tried with uncomment but don't work.

@yangxyo
Copy link

yangxyo commented Jun 18, 2020

The issue is that the default colors we are using is conflicting with the colorschemes you are using. At least in case of solarized it is muting the blue color that we are using for folders.

One thing that you could do is to change the value of dir in LS_COLORS. The default value is as mentioned #365 (comment). You could change the number to the right of di to change what color get applied for directories.

I change the di to 4, the folders show blue.

It's none of solarized's business.

image

I try all of them, the results are the same.

Before I add LS_COLORS:
image

It's really hard for me to change all of the numbers after rs=0:di=.... I hope this issue could be solved.

@yangxyo
Copy link

yangxyo commented Jun 18, 2020

ogham/exa#116 (comment)

With current implementation, we cannot customize directory color scheme of exa. Let's parse $LS_COLORS environment variable (or $LSCOLORS on BSD) and use it in the output.

Reference:

Such as:

export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43'

Or

https://github.com/trapd00r/LS_COLORS

I suggest writing something more in README.

@meain
Copy link
Member

meain commented Jun 19, 2020

@yangxyo
Selecting a colorscheme does not change the values of LS_COLORS. But there is a default list of values we use for lscolors which might have conflicting colors as solarized might use the same color that we use for folders for the background. I hope this makes things clearer.

Btw, you do not have to change all the values to the right of di. The fist value to the right of di will change the color of directory. Likewise the rest of it only needs to be changed if you have to change the colors of the other items. This is a good intro on LS_COLORS: http://www.bigsoft.co.uk/blog/2008/04/11/configuring-ls_colors.

You can set new LS_COLORS values by doing export LS_COLORS='....' in your bashrc or zshrc.

Also, here is another resource for generating lscolors: https://github.com/sharkdp/vivid

Here is an LS_COLORS value solarized: https://github.com/seebi/dircolors-solarized

@SansGuidon
Copy link

I face a similar issue, just after upgrading lsd from 0.16.0 to 0.17.0

@meain
Copy link
Member

meain commented Sep 12, 2020

Related #404

@foxale
Copy link

foxale commented Oct 23, 2020

I think there are many people that decided to go for this app not just for the sake of functionality it offers, but also because the coloring presented in the README was so appealing. It looks like the coloring is gone in 0.17.0 and 0.18.0, though.

Would it be possible to recreate the original default coloring as LS_COLORS variable and add to README? Any maybe even throw an explanation here and there for people upgrading from <0.16.0, that in order to have the colors back this and that needs to be manually set.

I guess this would resolve most of the related issues for many.

@zwpaper zwpaper added kind/feature New feature request and removed kind/bug Something isn't working labels Oct 24, 2020
@meain
Copy link
Member

meain commented Oct 25, 2020

@foxale That would be a good idea. Will add a way to reproduce the old colors using LSCOLORS in the readme.

@foxale
Copy link

foxale commented Nov 24, 2020

For those who don't want to wait, here is an approx. of the old theme:
LS_COLORS='di=38;5;33:ln=38;5;44:so=38;5;44:pi=38;5;44:bd=38;5;44:or=38;5;124:cd=38;5;172:ex=38;5;40:fi=38;5;184:no=38;5;245'

Preview:
image

This is based on src/color.rs/get_light_theme_colour_map(), which was responsible for the default color scheme back in 0.16.0. I don't think it's actually used anywhere now.

There are still some differences between 0.18.0 with this LS_COLORS configuration and 0.16.0, which cannot be configured using LS_COLORS only, but were hardcoded in source code. For example, the permission settings are colored differently.

0.16.0:
0.16.0

0.18.0 with this LS_COLORS configuration:
0.18.0 with LS_COLORS

Couple of thoughts:

  1. All colors could be made configurable; LS_COLORS does not cover them all
  2. All colors not covered by LS_COLORS could default to 0.16.0's style for users convenience
  3. An --old_color_scheme flag that would switch color scheme to already available mapping generated in get_light_theme_colour_map() would be a nice touch
  4. README.md is outdated

@zwpaper
Copy link
Member

zwpaper commented Nov 25, 2020

hi @foxale , thanks so much for the LS_COLORS configuration, this can really be helpful.

as the opinions you mentioned,

  1. the README part, a PR for updating and adding this configuration is always welcome!
  2. the configuration part, I am working on the theme configuration currently, it's functional working, a PR will be fired in days.

@robole
Copy link
Contributor

robole commented May 21, 2021

I encountered this issue today also.

I changed LS_COLORS in my .zshrc as per foxale's comment on 25 Nov 2020, and it fixed the colors for me.

A note in the README would save people a round-trip while issue #448 is in progress. Maybe reference the issue under FAQ/Colors until that's resolved?

@meain meain removed the kind/feature New feature request label Aug 21, 2021
@meain
Copy link
Member

meain commented Aug 21, 2021

Resolution: #365 (comment)

@meain meain closed this as completed Aug 21, 2021
@foxale
Copy link

foxale commented Aug 21, 2021

#365 (comment) provides only a temporary fix that doesn't cover all aspects of the problem. Shall we use separate github issues for the remaining 4 items pointed out in the discussed comment?

@meain
Copy link
Member

meain commented Aug 21, 2021

Most of the color issues will be taken care of once we land #452 . I don't think --old-color-scheme is a good idea, but we can probably add your comment into an FAQ section in the readme.

@pabloazurduy
Copy link

pabloazurduy commented Jul 5, 2022

hey everyone, quick question, there is no way of using themes in this env macos + iterm + zsh ? I tried with #365 (comment) and solved my problem, however, I would like to know if someone figured out how to use colors.theme from the .config file
thanks! :)

my current approach
install https://github.com/sharkdp/vivid
add the following lines to ~/.zshrc (use the theme that you want from vivid

# color theme ls
# other themes in https://github.com/sharkdp/vivid
export LS_COLORS="$(vivid generate snazzy)"

@meain
Copy link
Member

meain commented Jul 6, 2022

You cannot control the colors of files and folders with the theme, only the other blocks.

@pabloazurduy
Copy link

thanks @meain ! I thought that colors.theme changed everything! my bad.

Thanks again!

This was referenced Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests