Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

My local Linux machine has coloured terminal output like this;

enter image description here

When I SSH to a pfSense/BSD box it changes the colours like this;

enter image description here

Even when I SSH from to a machine that doesn't have a coloured local terminal output, and SSH from there to this pfSense/FreeBSD box it enables coloured output, and starts producing unwanted coloured output/

Is there something I can change locally so that when I SSH to the pfSense box from either my local machine or via an intermediary machine, my client will ignore the remote colour settings. Ideally I want to stay in black and white, two tone standard background and text colour only?

share|improve this question
    
What terminal application are you using? –  gertvdijk Dec 20 '12 at 11:28
1  
Here I am running Mint Linux 13, so it's Xfce Terminal Emulator 0.4.8. –  jwbensley Dec 20 '12 at 11:32
    
I know this isn't what you are asking for, but have you considered changing your terminal settings to white [or light gray] text on a black background? That is the basic color scheme that most things are designed to work with. Or you could change your prompt settings on the remote machine (probably in .bash_profile) to have better colors or no colors at all. –  Random832 Dec 20 '12 at 15:57
    
Normally I do something like TERM=xterm-mono ssh user@host to get that setting in the remote environment. –  ott-- Dec 20 '12 at 17:11
add comment

4 Answers

Changing the TERM variable to some entry that is compatible but doesn't have colour support might work. Like:

TERM=xterm-old

Basically, you need a TERM known by the FreeBSD system termcap or terminfo database for which TERM=the-term tput colors doesn't return a positive number, and for GNU ls, one for which dicolors -p | grep -x 'TERM the-term' returns nothing. It may still not work for applications that output colour escape sequences regardless of whether the terminal claims to support it or not.

Alternatively, you could use GNU screen to disable colors, like (zsh syntax):

screen -c =(printf %s\\n "termcapinfo * 'AF=\E[1m:AB=\E[7m'") ssh ...

That would enable bold for every attempt to set the foreground colour and reverse for every attempt to set the background one.

I think it all boils down to the fact that FreeBSD assumes that the terminal background is black (or at least dark). Where you using xterm instead of xfce-terminal, you could dynamically change the background and foreground colour and/or the individual colours to set different colour profiles. That is done through escape sequences, but you can also use the xtermcontrol command that makes it easier.

share|improve this answer
    
Tried that - doesn't work for me. export TERM=vt100 preceding ls --color still shows colorized output. –  gertvdijk Dec 20 '12 at 12:22
    
@gertvdijk Good point. It seem there's a bug in GNU ls which by default hard codes vt100 as being a terminal with colour support. I've changed that do xterm-old which doesn't have that problem but might not have a terminfo entry on FreeBSD. –  Stephane Chazelas Dec 20 '12 at 12:28
    
Well, it doesn't prevent other programs from outputting colour as well - i.e. byobu. I'm on Ubuntu 12.04 btw. –  gertvdijk Dec 20 '12 at 12:29
1  
@gertvdijk. Like I said. It only works for well behaved programs that use $TERM and the termcap/terminfo databases (via curses or other terminal APIs) instead of hardcoding the escape sequences. –  Stephane Chazelas Dec 20 '12 at 13:07
add comment

Colours in your terminal appear because the tty sends ANSI-encoded control sequences to tell your terminal to change colours. Some, if not most terminal application can be configured to ignore this and just display all text in one colour.

In xterm, you can use the -cm option. For Konsole, one can change the mapping of all colours to the same. Your XFCE terminal application may have similar options.

share|improve this answer
add comment

You could use xterm -cm for ssh.

share|improve this answer
add comment

Type the following command to remove it $ ls --color=none

or use unalias to remove it

$ unalias ls

share|improve this answer
1  
Isn't that just for the ls commad though? –  jwbensley Dec 20 '12 at 11:31
    
ls is aliased to "ls --color=tty" –  Lennon Chia Dec 20 '12 at 11:34
    
Yes. I know. But all my terminal output is coloured output, not just the ls command, so as per my previous comment: isn't that just going to stop ls producing coloured output, everything else will still be coloured though? –  jwbensley Dec 20 '12 at 11:35
    
yes only the ls portion –  Lennon Chia Dec 20 '12 at 11:39
    
But I want to disable all terminal colours?! –  jwbensley Dec 20 '12 at 11:40
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.