Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Linux Mint, MATE version. I have a weird problem that occurs quite frequently when scrolling down through log files in terminal: the machine pauses for a second or two, and when it comes back my system colors have been scrambed. That is, the ANSI colours have all been mixed up - red thinks it's yellow, yellow thinks it's green etc. This affects not just terminal but several other desktop apps too: Caja (the nautilus replacement), Geany (text editor), and Gedit.

The color assignment seems random and sometimes results in unusable combinations, like white being replaced with black (not useful on a black background). I need to reboot to get the colors back.

What i assume is happening is that some strings of characters in the log file are not being escaped properly and are hitting something in the system, but i'm not technical enough to try and debug this. Is there any command i could enter which would reset all of the colors back, does anyone know?

Grateful for any advice, max

EDIT - attached screenshotenter image description here

EDIT - I'm using MATE Terminal 1.2.1

share|improve this question
have you tried command reset in the terminal? – mnmnc Jan 7 '13 at 10:58
Does the problem persist if you open a new terminal? – terdon Jan 8 '13 at 18:22
@mnmnc - yep, no effect. terdon - yes it persists if i open a new terminal. It's just done it again for the first time in ages. – Max Williams Jan 21 '13 at 17:03

Issuing binary characters to the terminal screen is risky, as some control sequences are interpreted as commands that change the terminal mode, and not only for colors. This is because the Linux terminal emulates the antique VT100 console (with additions). See this post for a good explanation of the problem.

To sanitize your tty use one or several of the following commands :

  • reset
  • stty sane
  • tput init
  • tput reset

A surer way might be to use the stty command to save and reset all your setting at once:

  1. Use stty -g to print the current settings in stty-readable format
  2. Copy the resulting string
  3. Add to your shell init file (.bashrc or whatever) the alias (s for sane) as :
    alias s='stty <output string from step 2>'
  4. Now when confusion occurs, just type : s Enter
share|improve this answer
Thanks, i'll try this next time it happens and comment to let you know. – Max Williams Jan 7 '13 at 13:30
Ok, it's just happened! I tried all the commands in your list and also the longer 4-step process you describe. No luck. – Max Williams Jan 21 '13 at 17:06
BTW, i am using MATE Terminal 1.2.1 – Max Williams Jan 21 '13 at 17:09
I have no experience with MATE Terminal, sorry. – harrymc Jan 21 '13 at 17:26
I should try a different terminal i think... – Max Williams Jan 23 '13 at 14:13

Your Answer


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.