-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
LS_COLOR #363
Comments
What exactly are you looking for? What would this utility do? How would you like to use it? |
Today I use ls_color to color files I display, be it when I "find" them or "grep" for them in divers bash scripts. the problem with ls_color is that it does half of what ls does, executables, link, ... are not colorozed properly. I am thinking of a command line too that can be used in a pipeline of course. In a list of files to colorize and out colored files A few options that I can think about is ': take full path in and output either:
the usual options, -0 -separator -a, etc... If you have everything at hand and want to do it, it would be nice, I'll otherwise write some perl module when I find time. |
So if I understand correctly, this would mean factoring out the code to colorize output (including figuring out which color to use for what) into a separate library, and then build a seperate application that reads a list of files from stdin and then prints colorized output to stdout? |
yes, like the ls_color command |
Even though this is not really related to |
Hi everyone, I would also need this kind of lib for my project lsd (lsd-rs/lsd#28). @nkh do you have started anything? If not I think I will propose a lib based on your code in the next days/week. |
@Peltoche No I haven't as I use lscolor from https://github.com/trapd00r/File-LsColor which does most of what I want. |
I have already started to work on this. I'll report back soon. |
I have published a first version of the Repo: https://github.com/sharkdp/lscolors @nkh This also includes a @Peltoche I'd be very happy to get your feedback (best way would be the new repo). I'm very open to API changes and other suggestions. |
Use my new [lscolors](https://github.com/sharkdp/lscolors) crate instead of the internal `lscolors` module - Speeds up `LS_COLORS` querying, leading to a nice 25% performance improvement when - Adds support for 24-bit colors and background colors closes #368 closes #363
@sharkdp good job, I have integrated it in my perl script and works like a charm. Now my script gets a bunch of paths and splits them to color the path and the files separately, because I want both colors, but if a "path/file.ext" is given to lscolors, the whole thing gets colored like "file.ext". I don't know if it is what you want. Another point, which may make is useful for more people is to accept input as arguments (in addition to) getting input from stdin. |
That is expected, for now. The library only provides a "get ANSI style for a given path" function. However, for the binary, we could think about supporting the
Great idea => sharkdp/lscolors#4 |
I'm going to close this ticket. Please post further feedback / feature requests as tickets in the |
Use my new [lscolors](https://github.com/sharkdp/lscolors) crate instead of the internal `lscolors` module - Speeds up `LS_COLORS` querying, leading to a nice 25% performance improvement when - Adds support for 24-bit colors and background colors closes #368 closes #363
Hi,
Could you consider releasing an ls_color utility that does the coloring without the finding?
There is a perl ls_color but it does not work as advertised and is also slower
The text was updated successfully, but these errors were encountered: