-
Notifications
You must be signed in to change notification settings - Fork 54
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
want color output for mls like ls #351
Comments
GNU ls just takes the values and essentially spits out the control sequences. If you split the LS_COLORS value by semicolon, then you want to print the 'lc' value (default is '\e[', then the value for whatever filetype (no, or a glob match), then the 'rc' value (default is 'm', the filename, then the 'ec' value (I think the default is '\e[0m'. |
BSD is completely different of course. illumos doesn't assume all the world is xterm, and converts the LS_COLORS sequences back to color codes and then uses the terminfo database to output the correct sequence. |
^ Interesting.... so it appears they all do something different. hm. If |
You could probably go off the existence of either LSCOLOR (BSD) or LS_COLORS (GNU) and prefer which ever one is 'native' if both env vars are present. |
I'd have to look more into how
ls
handles it (and how various version ofls
handle it)... but I know off the top of my head there isLS_COLORS
andLSCOLORS
available as env variables... it would be cool ifmls
could use these variables if set, or have its ownMLSCOLORS
, and output color if stdout is a TTY.The text was updated successfully, but these errors were encountered: