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

respect ~/.dircolors #17

Open
Kidlike opened this issue Jun 18, 2018 · 12 comments
Open

respect ~/.dircolors #17

Kidlike opened this issue Jun 18, 2018 · 12 comments

Comments

@Kidlike
Copy link

Kidlike commented Jun 18, 2018

I tried ls_extended but it seems that it doesn't respect my ~/.dircolors.

Am I missing something or is this not implemented ?

Would it be difficult to implement ?

Screenshot:
https://i.imgur.com/TNpbWJC.png

@Electrux
Copy link
Owner

It is not implemented yet. Although it might not be that difficult. I have never used ~/.dircolors myself so idk how it works. Do you mind posting that file?
Also, the alignment in the screenshot doesn't seem correct. Any idea why? Did u change code?

@Kidlike
Copy link
Author

Kidlike commented Jun 18, 2018

Here's the content of ~/.dircolors:

https://github.com/Kidlike/dircolors-zenburn/blob/55c1dee1e532c7469ffea7c4fc9619fc8c555d89/dircolors

(It should work out of the box)

I haven't changed any code.

But I have a somewhat complicated setup: https://github.com/Kidlike/dotfiles#terminal

tilda -> tmux -> xterm-256color -> bash

@Electrux
Copy link
Owner

Electrux commented Jun 18, 2018

Is the Term section required for coloring too? what does that do?

And i am guessing that alignment is incorrect due to lack of icon fonts perhaps 🤔

@Kidlike
Copy link
Author

Kidlike commented Jun 18, 2018

I think the TERM section is supported TERMs.

Hm... possibly because of Font. I'm using Source Code Pro.

@Kidlike
Copy link
Author

Kidlike commented Jun 18, 2018

I see now that nerd-fonts supports Source Code Pro as well, so I will give it a go. :)

@Kidlike
Copy link
Author

Kidlike commented Jul 2, 2018

I think the alignment issue was related to the fonts. After switching to nerd-fonts the alignment looks correct.
https://i.imgur.com/SyXwXqa.png

@Electrux
Copy link
Owner

Electrux commented Jul 2, 2018

ok yea, that's nice to know. Thanks :)

@Kidlike
Copy link
Author

Kidlike commented Jul 2, 2018

Any hope for ~/.dircolors ? :)

@Electrux
Copy link
Owner

Electrux commented Jul 5, 2018

yea i am sorry i haven't the time to implement it right now but i hope to do that soon :) thanks 👍

@Kidlike
Copy link
Author

Kidlike commented Jul 5, 2018

cool, I was just wandering where this stands. cheers ! :)

@Electrux
Copy link
Owner

Electrux commented Jul 8, 2018

hey can you, by any chance give me a brief explanation of the colors in this file and their conversion to the escape code of terminal? If you can that would be much appreciated :)

@Kidlike
Copy link
Author

Kidlike commented Jul 10, 2018

I think all numbers in this file come from ansi escape codes and colors.

The values are ; separated, and usually look like this (although number of attributes and order is not important).
attribute ; text-color -> 00;38;5;109
or
background-color; text-color -> 48;5;180;38;5;234

As per the above link, codes 38 and 48 are foreground/background setters respectively.
The format of the file isn't great, as it uses the same delimiter for both "parameters" and multiple attributes. e.g. 48;5;180 sets the background color to 180 and 38;5;234 sets the foreground color to 234.
I don't know what this 5 is, but it looks like it's required if you want 256-color.

There's some info here too : https://linux.die.net/man/5/dir_colors
mostly useful about the special terms like CHR, SOCK, TERM, etc.

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

2 participants