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!

Saturday, October 8, 2011

My forward slash key is misbehaving

I was doing some Java programming in Eclipse, and I wanted to type a comment for my code. Simple enough. Just type two forward slashes, followed by the actual comment.

Alas, my keyboard was not cooperating. When I typed a forward slash, I got an "e" with an accent above it. In the spirit of looking for my misplaced keys in the same place I've looked several times already, I kept typing the forward slash, somehow expecting it to magically fix itself. It did not.

So, time to ask my technical expert (Google). After a couple of attempts, I found this post that told me how to fix the problem.

If this happens to you, just press and hold the left Ctrl and left Shift keys simultaneously for about two to four seconds. That should fix it.

Time to get back to writing code...