changing colors listed in ls-FGa

Something odd happened when using Terminal Homebrew. The Directories were showing up in a bright color. However, I do not remember doing anythingh via ls-color, no changes to my .profile etc. When I changed it back to default, the bright color was gone, and the nasty, hard to see dark blue was back.

I sort of thought that I had done it via preferences but I simply do not remember what I did. It's heck being 67 with ADD, I suppose.

I am using an old Mac G5, and a new Macbook Pro.

Also, there is no .bashrc that I can find. I had thought there was always one of those??

I appreciate your help,

trav

PowerMac G5/1.8 GHz old 1 cpu 2003, Mac OS X (10.5.6), Using Macs since Skinny Mac, and Apple IIs before that

Posted on Mar 1, 2014 10:51 AM

Reply
3 replies

Mar 1, 2014 4:31 PM in response to danuke

Not knowing what "Terminal Homebrew" is, I cannot directly address whether or not "Terminal Homebrew" allows customizing your standard Black, Red, Green, Yellow, Blue, Magenta, Cyan, White colors, However, I know you can customize the colors in Mac OS X Applications -> Utilities -> Terminal, and I can also do this with the iTerm or iTerm2 terminal emulators.


If changing your "Terminal Homebrew" settings back to default, corrected the problem, then it would either something you accidentally did to the "Terminal Homebrew" preferences, or the code is not stable, and it stepped on its own preferences for you 🙂 Not knowing anything about "Terminal Homebrew" I do not know how mature the code base is. I personally use iTerm and iTerm2 which has been around for a long time. I could most likely switch back to the Mac OS X Terminal app, as it has many of the iTerm/iTerm2 features I like these days, but old habits live on, so I continue to what I have been using.


If you like the color shades, but do not like what colors are associated with different file types, you can define your own LSCOLORS environment variable as per "man ls".


export LSCOLORS="AbadacbfexheagBedeAbAb"


This of couse would be best stored in your .bash_profile (or .bash_login (or .profile)). Since you said you changed the "Terminal Homebrew" to it defaults, I assume the color change was not related to LSCOLORS.


With respect to .bashrc. By default your home directory does not contain any shell initialization files for any flavor shell you like using (bash being the current Mac OS X default).


Bash initialization shell rules are spelled out in "man bash", but in brief, when you first create a terminal session (what looks like a login to the shell), bash will look for and execute the first one of the following found:


.bash_profile

.bash_login

.profile


Once you have an active Terminal session, if you create a subshell, bash will look for and execute the .bashrc initialization file.


If none of the above file exist bash will not complain.


If you want the .bashrc initialization script executed when you start a terminal session, you MUST source it from your .bash_profile (or .bash_login (or .profile)).

There are also global bash initialization files in /etc/ that may be executed, however, for a typical Mac users, it is best to leave them along, as they could be replaced during a system upgrade, or it is something easily forgotten when migrating to a new Mac, where as most people do remember to bring along the contents of their home directory.


With respect to being 67, many of the better contributers in these forums are not spring chickens either 😝

Mar 2, 2014 11:02 AM in response to BobHarris

Thank you for your reply.

I guess that I did not express things clearly; Homebrew is found in the Mac Terminal Preferences under settings. So as far as I can tell it should be stable. It remains a mystery as to how I managed to change those directory listing colors though. I never went through anything as complicated as the LSCOLOR kinda of thing.Then again, my brain often reboots when I blink my eyes.


I made a .profile file with BBedit.


I appreciate the global bash init. file heads up, and do not intend to mess with them. Although, I don't know if there will ever be any changes to OSX 10.5.8 again. 😉

Mar 2, 2014 3:14 PM in response to danuke

I think 10.5.8 Leopard is archaeologically stable :)


My confusion about "Homebrew" was that there is a project called Homebrew that is similar to MacPorts.com and fink that provide ports of open source packages to Mac OS X, so I assumed you had installed your own open source terminal emulator, possibily based on an X11 xterm code base. So I was guilty of ***-u-me-ing :)


If you find the default ls -FGa colors difficult to see, I suggest you take my example export command and start experimenting, using the man bash section on LSCOLORS to explain the contents of the string. It can be fun, and makes reading ls output so much easier. My first colorized ls, was a script that parsed the ls -F output and inserted color escape sequences. It was a fun exercise until I got my hands on the GNU sources for ls, and went wild making my own Tru64 UNIX version of colorized ls :)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

changing colors listed in ls-FGa

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.