Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kolax

macrumors G3
Original poster
Mar 20, 2007
9,181
115
Whenever I SSH as root to a server using Terminal, I don't get any ANSI colours being used. If I SSH as non-root, ANSI colours are displayed.

Rather annoying as the ANSI colours make it much easier to see directories, files and executables.

Any ideas why this is?
 
Whenever I SSH as root to a server using Terminal, I don't get any ANSI colours being used. If I SSH as non-root, ANSI colours are displayed.

Rather annoying as the ANSI colours make it much easier to see directories, files and executables.

Any ideas why this is?

Different shells maybe? Different variables set for whichever shell you're using? Alias set up for the 'ls' command?
 
Whenever I SSH as root to a server using Terminal, I don't get any ANSI colours being used. If I SSH as non-root, ANSI colours are displayed.

Rather annoying as the ANSI colours make it much easier to see directories, files and executables.

Any ideas why this is?

Its complicated. Here's a starter: http://net.tutsplus.com/tutorials/tools-and-tips/how-to-customize-your-command-prompt/

A shorter version: The mac terminal logs each user into that user's preferred shell. Options are "bash", "tcsh", "zsh" etc. The default is "bash". For each one of those shells, there exists a ".bashrc", ".tcshrc", ".zshrc" etc. file that tells the shell how to behave. These ".{something}rc" files are unique to each user account. In your case, whatever shell your root and non-root accounts are using on the server when you SSH into that server, those shells have different ".{something}rc" files that tells the two accounts to behave differently. How to fix it is not trivial if you're not familiar with all that MAY be listed in the ".{something}rc files. The simplest option that might work for you is to alias "ls" to "ls -G" for example. The link above has a much more detailed explanation of how you can modify your shell's behaviour with colour.
 
Does look a lot of effort!

I checked that link out, and ended up getting iTerm along with the Solarised theme and the font he uses. Quite easy on the eye!

I'll get round to colourising ls soon, wish there was a quick easy fix!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.