How to reset system colors

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

Correct answer is (at least it worked in my case):

tput sgr0

From documentation:

tput sgr0 – Turn off all attributes