gmc
Posts: 123
Joined: Fri Mar 09, 2012 11:31 am
Location: Cheshire, UK
Contact: Website

[SOLVED] Colors in putty

Sat Aug 17, 2013 9:02 pm

Not sure if this is a setting on the R-Pi, when I putty into say my opensuse server I get the directories, scripts etc in different colors.

When I ssh to the pi its all in black and white? Any idea what th problem could be?
Last edited by gmc on Sun Aug 18, 2013 7:06 am, edited 1 time in total.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5048
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Colors in putty

Sat Aug 17, 2013 9:18 pm

It may be your PuTTY settings. In PuTTY's "Windows --> Colours" settings I've "ticked" all three "General options for colour usage" and get coloured text from the Pi.
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
MrBunsy
Posts: 185
Joined: Mon Feb 20, 2012 1:48 pm
Location: Southampton, UK
Contact: Website

Re: Colors in putty

Sat Aug 17, 2013 9:22 pm

Settings for this are in the .bashrc file. I can't find any particularly good links to give you, but the Arch wiki may help: https://wiki.archlinux.org/index.php/Color_Bash_Prompt

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5048
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Colors in putty

Sat Aug 17, 2013 9:38 pm

I should have asked: What OS are you running? Do you get coloured directorys etc. when you're logged directly on to the Pi and using a monitor? If not, then MrBunsy is "on the right track". For me Raspbian Wheezy normally gives coloured text in "ls -laF" listings etc. without me having to add or change anything in .bashrc (or similar) ie. it appears to be "the default option".
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
ddxfish
Posts: 75
Joined: Wed Aug 07, 2013 5:17 pm
Location: Florida
Contact: Website AOL

Re: Colors in putty

Sun Aug 18, 2013 1:45 am

edit ~/.bashrc (or .bash_profile if you are using interactive logon)

add these to spice up the color a bit, it is your linux install, not putty most likely.

ls to be listed in color

Code: Select all

alias ls='ls -al --color'
your user prompt in color

Code: Select all

export PS1="\[\e]0;\[email protected]\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[0;31m\]\[email protected]\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\]"
My Pi Guides: http://www.etcwiki.org/wiki/Category:Raspberry_Pi
My AIM screen name: ddxfish
Always happy to chat about the Pi!

gmc
Posts: 123
Joined: Fri Mar 09, 2012 11:31 am
Location: Cheshire, UK
Contact: Website

Re: Colors in putty

Sun Aug 18, 2013 6:46 am

Thanks for all the tips.

Its odd, but its just started working. I did change the timezone and hosrname and there were a few reboots so am not sure if that fixed it, but I have all the colors back.

Putty'ing from Win8 to wheezy (the latest version, all patches installed)

Update: Ahhh...figured it out. I was running in sudo mode

Code: Select all

sudo -s
Everything is in b&w when I do this, doing a exit and returning to the pi user everything is back to normal. I've copied over the relevant color setting from pi's .bashrc to root's .bashrc and its fixed it.

Return to “General discussion”