How do I reset the colors of my terminal?
Help! Somehow my terminal looks like this:
It's nearly impossible to read the text. How can I fix it without exiting the terminal?
command-line gnome-terminal
add a comment |
Help! Somehow my terminal looks like this:
It's nearly impossible to read the text. How can I fix it without exiting the terminal?
command-line gnome-terminal
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 usingcat
on a binary file.
– Nathan Osman
Apr 5 '14 at 4:22
1
I just tried tocat
a binary file, was quite an experience...
– Aditya
Apr 6 '14 at 1:00
add a comment |
Help! Somehow my terminal looks like this:
It's nearly impossible to read the text. How can I fix it without exiting the terminal?
command-line gnome-terminal
Help! Somehow my terminal looks like this:
It's nearly impossible to read the text. How can I fix it without exiting the terminal?
command-line gnome-terminal
command-line gnome-terminal
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 usingcat
on a binary file.
– Nathan Osman
Apr 5 '14 at 4:22
1
I just tried tocat
a binary file, was quite an experience...
– Aditya
Apr 6 '14 at 1:00
add a comment |
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 usingcat
on a binary file.
– Nathan Osman
Apr 5 '14 at 4:22
1
I just tried tocat
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
add a comment |
3 Answers
3
active
oldest
votes
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.
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
add a comment |
You can try this command also.It will reset your terminal color.
tput sgr0
add a comment |
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.
New contributor
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
You can try this command also.It will reset your terminal color.
tput sgr0
add a comment |
You can try this command also.It will reset your terminal color.
tput sgr0
add a comment |
You can try this command also.It will reset your terminal color.
tput sgr0
You can try this command also.It will reset your terminal color.
tput sgr0
edited Apr 5 '14 at 5:58
answered Apr 5 '14 at 4:29
Avinash Raj
51.2k41165214
51.2k41165214
add a comment |
add a comment |
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.
New contributor
add a comment |
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.
New contributor
add a comment |
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.
New contributor
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.
New contributor
New contributor
answered Dec 28 '18 at 21:23
rymo
1012
1012
New contributor
New contributor
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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