When I upgraded to Lion suddenly my colorful SSH prompts on remote linux machines became dull and black and white. It took me some time to figure out what was going out, so at first I edited my Ubuntu .bashrc file and uncommented
force_color_prompt=yes. But this didn’t seem right. So after some digging I found the problem – in Snow Leopard Terminal.app by default was identifying itself as xterm-color, but now in Lion it is xterm-256color, which the remote Ubuntu did not recognize. So to fix it without changing anything on the remote machines, do the following:
- Open Terminal.app Preferences
- Go to the Settings tab
- In your default theme go to the Advanced tab
- On the first line Declare terminal as: select xterm-color, instead of the default xterm-256color
- Reopen Terminal.app and voilà – the colored SSH command prompt is back!