13

I want to disable all color in my shell. Not ls, not nano, not vi, nothing. What's the best way to achieve this?

migrated from stackoverflow.com Apr 6 '11 at 1:38

This question came from our site for professional and enthusiast programmers.

7

if you are using PUTTY to remotely access the shell, then:
- on the left panel, click Colors
- uncheck the three boxes on the right panel (they are checked by default)

  • I'll have to switch to a terminal program that lets me do this. Thanks. – Poe Apr 6 '11 at 1:57
  • 1
    Geekosaur's answer is better for you, really. – ocodo Apr 6 '11 at 3:21
  • @slomojo his answer didn't work with my terminal client – Poe Apr 6 '11 at 9:46
  • 1
    Oh, interesting, which client is it? – ocodo Apr 6 '11 at 10:37
  • I'm using iTerm (OS X) and still getting color if I export TERM=vt220, and in 'ls' even after unsetting LS_COLORS – Poe Apr 7 '11 at 3:42
13

unset LS_COLORS; export TERM=xterm should do it, or at least get you most of the way there. You may need to change that to say TERM=vt220 for some overly "smart" programs.

  • 3
    Definitely recommend VT220 over XTERM. – ocodo Apr 6 '11 at 3:20
  • 6
    "xterm" is a color terminal, to disable colors you need TERM=xterm-mono – Idelic Apr 11 '11 at 21:37
4
xterm -cm

This will start an xterm with no colors.

  • This won't work if you have LS_COLORS set FYI. – lzap Oct 14 '16 at 14:22
1

I encountered the same problem while writing an SSH robot in Python (colors came out as jibberish when run through Visual Studio). The simplest solution was to open a new shell inside the other shell that was running.

sh

This opened a fresh shell without any of my settings and all printouts was monochrome. It also reset the prompt which was a bonus for my intended purpose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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