How do I reset the colors of my terminal?












19














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






  • 3




    You can sometimes "accidentally" get this by using cat on a binary file.
    – Nathan Osman
    Apr 5 '14 at 4:22






  • 1




    I just tried to cat a binary file, was quite an experience...
    – Aditya
    Apr 6 '14 at 1:00
















19














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






  • 3




    You can sometimes "accidentally" get this by using cat on a binary file.
    – Nathan Osman
    Apr 5 '14 at 4:22






  • 1




    I just tried to cat a binary file, was quite an experience...
    – Aditya
    Apr 6 '14 at 1:00














19












19








19


5





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















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?







command-line gnome-terminal






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 5 '14 at 14:04









Braiam

51.4k20136220




51.4k20136220










asked Apr 5 '14 at 4:18









Nathan Osman

20.9k32144237




20.9k32144237












  • What the heck did you did to get it that way? xD
    – Lucio
    Apr 5 '14 at 4:21






  • 3




    You can sometimes "accidentally" get this by using cat on a binary file.
    – Nathan Osman
    Apr 5 '14 at 4:22






  • 1




    I just tried to cat a binary file, was quite an experience...
    – Aditya
    Apr 6 '14 at 1:00


















  • What the heck did you did to get it that way? xD
    – Lucio
    Apr 5 '14 at 4:21






  • 3




    You can sometimes "accidentally" get this by using cat on a binary file.
    – Nathan Osman
    Apr 5 '14 at 4:22






  • 1




    I just tried to cat a binary file, was quite an experience...
    – Aditya
    Apr 6 '14 at 1:00
















What the heck did you did to get it that way? xD
– Lucio
Apr 5 '14 at 4:21




What the heck did you did to get it that way? xD
– Lucio
Apr 5 '14 at 4:21




3




3




You can sometimes "accidentally" get this by using cat on a binary file.
– Nathan Osman
Apr 5 '14 at 4:22




You can sometimes "accidentally" get this by using cat on a binary file.
– Nathan Osman
Apr 5 '14 at 4:22




1




1




I just tried to cat a binary file, was quite an experience...
– Aditya
Apr 6 '14 at 1:00




I just tried to cat a binary file, was quite an experience...
– Aditya
Apr 6 '14 at 1:00










3 Answers
3






active

oldest

votes


















25














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
Initialization,

(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
skipped.


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






  • 2




    reset will also work but I think it'll also reset the environment variables.
    – user249743
    Apr 5 '14 at 18:28



















6














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



tput sgr0


enter image description here






share|improve this answer































    0














    If you find your terminal in a state that none of reset, tput init, nor tput sgr0 can fix, try tput setaf 7 && tput setab 0 to force the text to white on black.






    share|improve this answer








    New contributor




    rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f443560%2fhow-do-i-reset-the-colors-of-my-terminal%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      25














      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
      Initialization,

      (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
      skipped.


      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






      • 2




        reset will also work but I think it'll also reset the environment variables.
        – user249743
        Apr 5 '14 at 18:28
















      25














      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
      Initialization,

      (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
      skipped.


      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






      • 2




        reset will also work but I think it'll also reset the environment variables.
        – user249743
        Apr 5 '14 at 18:28














      25












      25








      25






      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
      Initialization,

      (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
      skipped.


      This should restore your terminal to its original colors.






      share|improve this answer














      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
      Initialization,

      (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
      skipped.


      This should restore your terminal to its original colors.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 5 '14 at 4:26

























      answered Apr 5 '14 at 4:18









      Nathan Osman

      20.9k32144237




      20.9k32144237












      • 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






      • 2




        reset will also work but I think it'll also reset the environment variables.
        – user249743
        Apr 5 '14 at 18:28


















      • 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






      • 2




        reset will also work but I think it'll also reset the environment variables.
        – user249743
        Apr 5 '14 at 18:28
















      Could you just close it and open it again?
      – Sparhawk
      Apr 5 '14 at 4:42




      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




      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




      Good point. +1.
      – Sparhawk
      Apr 5 '14 at 4:47




      2




      2




      reset will also work but I think it'll also reset the environment variables.
      – user249743
      Apr 5 '14 at 18:28




      reset will also work but I think it'll also reset the environment variables.
      – user249743
      Apr 5 '14 at 18:28













      6














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



      tput sgr0


      enter image description here






      share|improve this answer




























        6














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



        tput sgr0


        enter image description here






        share|improve this answer


























          6












          6








          6






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



          tput sgr0


          enter image description here






          share|improve this answer














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



          tput sgr0


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 5 '14 at 5:58

























          answered Apr 5 '14 at 4:29









          Avinash Raj

          51.2k41165214




          51.2k41165214























              0














              If you find your terminal in a state that none of reset, tput init, nor tput sgr0 can fix, try tput setaf 7 && tput setab 0 to force the text to white on black.






              share|improve this answer








              New contributor




              rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0














                If you find your terminal in a state that none of reset, tput init, nor tput sgr0 can fix, try tput setaf 7 && tput setab 0 to force the text to white on black.






                share|improve this answer








                New contributor




                rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





















                  0












                  0








                  0






                  If you find your terminal in a state that none of reset, tput init, nor tput sgr0 can fix, try tput setaf 7 && tput setab 0 to force the text to white on black.






                  share|improve this answer








                  New contributor




                  rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  If you find your terminal in a state that none of reset, tput init, nor tput sgr0 can fix, try tput setaf 7 && tput setab 0 to force the text to white on black.







                  share|improve this answer








                  New contributor




                  rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered Dec 28 '18 at 21:23









                  rymo

                  1012




                  1012




                  New contributor




                  rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  rymo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f443560%2fhow-do-i-reset-the-colors-of-my-terminal%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅