Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

The following code doesn't work as expected, i. e. dir names are not in color in view mode:

fileviewer */ tree -d -C

But programs that use terminal escape sequences directly can output color. For instance, this works OK:

fileviewer */ echo -e "\033[0;33mHello\033[0m"

The problem is that programs which rely on LS_COLORS mechanism to color its output fail to produce colorful output in vifm View mode.

For instance, exa/eza displays attributes in color as it should (it definitely uses escape sequences directly), but dir/file names in Win color of the active vifm colorscheme:

fileviewer */ eza -al --color=always

1 Answer

0 votes
by

tree prints escape sequences just like everything else. If $LS_COLORS doesn't have the value you expect, that's because your shell's configuration wasn't processed. You might want to move setting $LS_COLORS to ~/.profile or similar that gets applied on user login and thus to every application in a session.

You can try appending | hexdump -C to tree to see if there are any colors. If not, check $LS_COLORS and $TREE_COLORS inside Vifm with :echo $LS_COLORS and :echo $TREE_COLORS.

but dir/file names in Win color of the active vifm colorscheme

Because those parts of their output just isn't colored and window color gets applied.

by

I investigated the problem further and it seems that vifm doesn't support bright color codes (without bold modifier) in range 90-97. The problem has nothing to do with $LS_COLORS variable.

This code doesn't produce colored output in vifm View mode:

fileviewer */ echo -e "\033[0;92mHello\033[0m"
fileviewer .*/ echo -e "\033[0;92mHello\033[0m"

but this one does:

fileviewer */ echo -e "\033[0;32mHello\033[0m"
fileviewer .*/ echo -e "\033[0;32mHello\033[0m"

All terminals i use (foot, alacritty, kitty) support colors 90-97 that's why I didn't take a look at color values themselves.

by

You're right, that range of values isn't processed. Not sure I've noticed it before. Can handle it but colors will probably be bold, curses doesn't have "bright" attribute separate from "bold". There is "dim" attribute which didn't do anything as far as I remember.

by

Can handle it but colors will probably be bold

At least View output will be colored when it is expected to be :)

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...