bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature request / patch: ls colors for directories


From: Kirk Kelsey
Subject: feature request / patch: ls colors for directories
Date: Wed, 12 Dec 2007 13:49:43 -0500

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]