Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Help! Somehow my terminal looks like this:

enter image description here

It's nearly impossible to read the text. How can I fix it without exiting the terminal?

share|improve this question
What the heck did you did to get it that way? xD – Lucio Apr 5 '14 at 4:21
You can sometimes "accidentally" get this by using cat on a binary file. – Nathan Osman Apr 5 '14 at 4:22
I just tried to cat a binary file, was quite an experience... – Aditya Apr 6 '14 at 1:00
up vote 15 down vote accepted

The likely cause of this problem are ANSI Escape Codes. These allow scripts to change the foreground and background color of the terminal. You can even mimic the colors of the screenshot above by running the following command:

echo -e '\E[32;46m'

To reset the terminal colors, use the following command:

tput init

According to the manpage:

    init  If the terminfo database is present and an entry for the user's
          terminal exists (see -Ttype, above), the following will occur:

          (1) if present, the terminal's initialization strings will be
              output as detailed in the terminfo(5) section on Tabs and

          (2) any delays (e.g., newline) specified in the entry will be
              set in the tty driver,

          (3) tabs expansion will be turned on or off according to the
              specification in the entry, and

          (4) if tabs are not  expanded, standard  tabs  will  be  set
              (every 8 spaces).

          If an entry does not contain the information needed for any of
          the four above activities, that activity will silently be

This should restore your terminal to its original colors.

share|improve this answer
Could you just close it and open it again? – Sparhawk Apr 5 '14 at 4:42
Yes, but then all of my environment variables would be lost. – Nathan Osman Apr 5 '14 at 4:47
Good point. +1. – Sparhawk Apr 5 '14 at 4:47
reset will also work but I think it'll also reset the environment variables. – user249743 Apr 5 '14 at 18:28

You can try this command also.It will reset your terminal color.

tput sgr0

enter image description here

share|improve this answer

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.