lf icon indicating copy to clipboard operation
lf copied to clipboard

Icons aren't displaying properly

Open kamui-fin opened this issue 4 years ago • 17 comments

I used the wiki article for adding icons to lf through the LF_ICONS env variable. I also have nerd fonts already installed, yet, it doesn't seem to be displaying properly. This screenshot is with the st terminal but i've also tried it on the kitty terminal and it still doesn't display the icons properly.

image

Is this a bug or could I have configured something wrong?

kamui-fin avatar Feb 17 '21 23:02 kamui-fin

@kamui-7 This is not intended behavior. Can you try this without setting any icons? (e.g. LF_ICONS= lf) If it's working, can you try with a minimal example? (e.g. LF_ICONS='di=:*.c=' lf). Also what shell are you using? This might also be an encoding issue. Are you using utf-8 in your terminal? Also what are your language variables? (e.g. LC_ALL, LC_CTYPE, and LANG)

gokcehan avatar Feb 21 '21 16:02 gokcehan

The same problem.

LANG=en_US.UTF-8 LF_ICONS='di=:*.c=' lf

图片

LANG=zh_CN.UTF-8 LF_ICONS='di=:*.c=' lf

图片

cubercsl avatar Sep 16 '21 16:09 cubercsl

what shell are you using in lf? if it is zsh make sure to check this out

ndavd avatar Sep 29 '21 18:09 ndavd

what shell are you using in lf? if it is zsh make sure to check this out

I am using fish in alacritty.

cubercsl avatar Sep 30 '21 07:09 cubercsl

I have exactly the same issue when using Japanese locales.

btrkeks avatar Mar 31 '22 20:03 btrkeks

@GenjiFujimoto I can produce similar glitches with tcell hello world example with different locales so I suspect this is a tcell issue.

gokcehan avatar Apr 02 '22 11:04 gokcehan

I am seeing some, but not all, icons display incorrectly. Namely, the directory icon and the jpeg icon:

lf

I am seeing this in both kitty and alacritty. I believe this is related to lf because when I cat the icons file the directory icon displays correctly in the same terminal:

icons_file

Also, if it helps, My terminal it kitty, my shell is zsh 5.9, my font is JetBrains Mono and my LANG is en_US.utf8. My current config correctly display Nerdfont icons in every other application except lf

My lf version is r27

pezcore avatar Jul 27 '22 22:07 pezcore

Hello have you found the solution to this? I've the same setup as yours except that my font is Codelia patched with NerdFont, my directory icon is the one that's not working.

copypasteonly avatar Aug 28 '22 16:08 copypasteonly

I've investigated this a bit, but found no solution. It seems that the reason for this behavior is that the symbol lf's icons.example uses to show directories is not a valid Unicode symbol. Only some hacked fonts (e.g. Nerdist) show it as a folder. Other fonts show it as the J-like squiggle shown on @pezcore's screenshot. (Most fonts show nothing at all).

In my case, also on Kitty throug tmux (Debian, running on Chrome OS which may or may not interfere with fonts), I've noticed that (Update:) selecting the J-like symbol in tmux's copy mode (^B [) turns it into a folder symbol.

(Update: I previously said this, but couldn't reproduce it: "if I paste the folder symbol into Vim (or open the icons.example file) and move the cursor over it, it turns into the J-like squiggle.")

You can try to find out why Kitty seemingly falls back to another font and how to force Kitty to use Nerd fonts everywhere. In any case, this seems like a Kitty or font problem, not an lf problem.

ilyagr avatar Aug 28 '22 20:08 ilyagr

@kamui-fin this can be because you are using Nerd Font Mono instead of Nerf Font (regular)

For example, JetBrainsMono Nerd Font will be displayed properly, but JetBrainsMono Nerd Font Mono will be the same as for you (at least on my machine)

Try to change your font, maybe this will help

mymmrac avatar Sep 18 '22 11:09 mymmrac

Maybe you can try using custom icon definitions. I have not even used icons bit to me it looks straightforward. I have seen implementation in Luke Smith's dotfiles.

DusanLesan avatar Sep 18 '22 16:09 DusanLesan

@cubercsl Sorry for the bump, but can you post the output of grep -v ^# /etc/locale.gen? I had this issue earlier and setting LANG was insufficient. Uncommenting the relevant line (en_US.UTF-8 UTF-8) in the foregoing file fixed my issue. Seemed to have something to do with system locale.

PierrotAWB avatar Nov 11 '22 18:11 PierrotAWB

I am seeing some, but not all, icons display incorrectly. Namely, the directory icon and the jpeg icon:

lf

I am seeing this in both kitty and alacritty. I believe this is related to lf because when I cat the icons file the directory icon displays correctly in the same terminal:

icons_file

Also, if it helps, My terminal it kitty, my shell is zsh 5.9, my font is JetBrains Mono and my LANG is en_US.utf8. My current config correctly display Nerdfont icons in every other application except lf

My lf version is r27

I found maybe a hacked solution

go to your kitty.conf and set: symbol_map U+1000-U+ffee JetBrainsMono Nerd Font that's all

MagnesiaReal avatar Dec 15 '22 21:12 MagnesiaReal

@GenjiFujimoto I can produce similar glitches with tcell hello world example with different locales so I suspect this is a tcell issue.

Thanks for the hint ,I think it is the tcell's issue.

https://github.com/microsoft/terminal/issues/370#issue-408548048 https://github.com/gdamore/tcell/issues/531#issue-1240220589

In CJK environment ,Ambiguous width character will be glyphs to a different width.

I fix it by set the envirement export RUNEWIDTH_EASTASIAN=0 in my $HOME/.xprofile.

export LANG="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"

export GDK_SCALE=2
export GDK_DPI_SCALE=0.5
export QT_AUTO_SCREEN_SCALE_FACTOR=

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

export GOROOT=/usr/lib/go
export GOPATH=$HOME/go
export GOBIN=$HOME/go/bin
export PATH=$PATH:$GOROOT/bin:$GOBIN
export GO111MODULE=on

export RUNEWIDTH_EASTASIAN=0

lf_2

OS: ArchLinux x86_64 Locale: LANG=zh_CN.UTF-8 Terminal Emulator: Alacritty

coma409 avatar Feb 17 '23 07:02 coma409

I am seeing some, but not all, icons display incorrectly. Namely, the directory icon and the jpeg icon:

lf

I am seeing this in both kitty and alacritty. I believe this is related to lf because when I cat the icons file the directory icon displays correctly in the same terminal:

icons_file

Also, if it helps, My terminal it kitty, my shell is zsh 5.9, my font is JetBrains Mono and my LANG is en_US.utf8. My current config correctly display Nerdfont icons in every other application except lf

My lf version is r27

currently having this exact issue

pingarelho avatar Nov 14 '23 23:11 pingarelho

Experiencing this issue as well. Currently only noticed with jpeg files. Instead of the picture icon it displays a rocket icon.

2023-11-29_00-18 2023-11-29_00-25

What I did is copy-paste a lot of the contents of the example file into my icons file in the lf directory. The I added the line set icons in my lfrc.

promitheas17j avatar Nov 28 '23 22:11 promitheas17j