The "ls --color" option currently colors all normal directories alike. On some systems (e.g., darwin) directories with specific name extensions are used for specific purposes (application bundles, library frameworks). It would be helpful if 'ls' could differentiate these directories. I realize this may be a fairly niche feature but the changes to the code are few; essentially just extending the current extension matching to directories.

I've attached a patch that allows a directory to match an LS_COLOR defined extension. Directory extensions are kept separate from file extensions by including a final '/' so that a directory named 'foo.txt' would not be colored as a text file. As an example, including "*.app/=00;32" in the LS_COLORS environment variable will cause 'ls --color' to make any directory with a name ending in ".app" to be colored green without changing the behavior for other directories or files with names ending in ".app"

Thanks,
Kirk


Attachment: ls.c.diff
Description: Binary data


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to