vifm / vifm.vim

Vim plugin that allows use of vifm as a file picker
335 stars 19 forks source link

Icons aren't rendered when vifm is invoked from vim #48

Closed lockejan closed 4 years ago

lockejan commented 4 years ago

Hi, I'm using alacritty 0.4.3 (c723247) on OSX 10.15.5 with tmux 3.1b

vifm -v gives me:

Version: 0.10.1
Git info: built out of repository
Compiled at: Aug  1 2019 13:13:13

Support of extended keys is on
Parsing of .desktop files is enabled
Without GTK+ library
Without magic library
Without X11 library
Without dynamic loading of X11 library
With file program
With -n option for cp and mv
With remote command execution

My vifm config includes the icon settings from this post: vifm-issue 164 So in a regular vifm session (right side on img) icons are rendered as expected. However when I'm invoking vifm from inside vim icons arent rendered at all (left side on img). Im using MesloLGS Nerd Font Mono as my terminal font.

Any ideas why this is happening or how I can debug this? I tried this with iterm

image

xaizek commented 4 years ago

Hello,

The picture looks like UTF-8 sequences were interpreted as something else, therefore I suspect it might be encoding/locale issues. You can try comparing locales inside Vim's terminal and in a regular terminal as well as Vim's settings related to encoding.

lockejan commented 4 years ago

Thanks for helping me out here, even though I was looking at the wrong place for a solution. Indeed locale/encoding was the problem here. My terminal env:

❯ locale LANG="" LC_COLLATE="C" LC_CTYPE="UTF-8" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL=

I had to explicitly set LC_ALL and LANG in my shell or terminal config to fix it. I still wonder how vifm outside of vim managed to interprete the icons correctly then in the first place.

xaizek commented 4 years ago

I still wonder how vifm outside of vim managed to interprete the icons correctly then in the first place.

The issue was probably with Vim re-encoding characters. Terminal understands it if Vifm prints them as is, but Vim in the middle transformed them somehow.