Closed scopatz closed 3 years ago
I guess that shouldn't be that hard to implement, will look into it!
Cool thanks!
@scopatz From what I can see, the xonsh colors don't allow specifying a modifier without a color. This prevents me from doing my current rules like "executables are bold" while keeping the default color of the shell.
I had the idea of specifying modifiers instead of ANSI escape codes, but that would remove the possibility of for example making symbolic links blue.
Do you know of a way I could properly handle this ?
Or maybe allow multiple color selection scheme, one using my current rules with ANSI escape codes, and another one using xonsh colors + $LS_COLORS, but that will be quite a lot of code to manage.
Yeah, I think we probably need to add just the modifiers to xonsh
Will be much easier to implement now that 2cdf19ed9bb74cc7c16b97325997cda9944ef4e7 is pushed: xlsd now uses standard xonsh color codes instead of ansi escape codes.
Awesome!
LS_COLORS should be supported since 7f7378ede21754bf31374aa479066db18ff502ac, please try it out and let me know!
Thanks @cafehaine! I have tried it out and it seems as though all the filenames are still in black and white. I am using the default $LS_COLORS
from xonsh
The executable and symlink colors were applied after the LS_COLORS, which means that the colors from LS_COLORS were overwritten. I've now changed the order so that LS_COLORS has priority over the executable/symlink styling.
Let me know if it still doesn't work after 6e411a2!
Huh, strange. I updated to 6e411a2 and it still isn't showing any colors. Anything I can do to help debug? I tripple checked that I am using the correct version
I'm not sure, what backend are you using when testing? I've only really tested with PTK but readline shoudn't cause any problem
Maybe you could add a print at line 206 in xlsd.xsh to see if any colors are applied?
Not sure what else could cause this.
I think I found the issue, I'm only applying the extension styling, but not the styling using fi
, ln
, and other file types.
So maybe that's what missing for you, I'll try to make that work.
Ahh yeah that is probably what is going on. I am just testing in my home dir and in the xonsh repo
I think I've finally got the expected result in 8a4583a, could you try this commit out?
Amazing! It works! Thanks so much!!
I realized what else was causing me issues here. Basically, this does not support LS_COLORS, so all file types come out with the same base text color. This should be relatively easy to add with the use of
$LS_COLORS
, which is a special mapping in xonsh from globs to xonsh color names, and the use ofxonsh.tools.print_color()
orformat_color()
.