Thursday, December 1, 2011

Changing that yucky cygwin prompt colour

We have a very cool script here at work that everybody uses when they want to upgrade their local database, run their local jboss server, load the data that's used by the app, etc.

The problem, for Windows users, is that it's a Linux script. :-(

No problem - cygwin to the rescue. The script runs just fine under cygwin. But the command shell colours basically (in my opinion) suck. Yucky green against a black background is hard for me to read.

So after a little research (i.e. Google search), I found a post that told me how to change that. And, even better,  it was easy.

All you have to do is go to the folder where you installed cygwin. Mine's c:\cygwin. Then go to the etc folder. In that folder, you'll find a file called profile. Open it in your favourite Windows text editor and change this line:


PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '


to:


PS1='\[\e]0;\w\a\]\n\[\e[255m\]\u@\h \[\e[255m\]\w\[\e[0m\]\n\$ '


and this line:


^[[32m${USER}@${HOSTNAME} ^[[33m${PWD}^[[0m


to:


^[[255m${USER}@${HOSTNAME} ^[[255m${PWD}^[[0m


And Bob's your uncle! Actually, Bob is my kids' uncle, but that's another story for another day.

I now have a cygwin prompt I can read. Woohoo!

No comments:

Post a Comment

Please feel free to leave a comment. I appreciate the feedback, positive or negative.