Can the Linux console display 16 colors?256 color in Linux consolePrint console colorsChange colors in...

Robbers: The Hidden OEIS Substring

Why would guns not work in the dungeon?

Turning arguments into exponents

Why were Er and Onan punished if they were under 20?

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?

Managing and organizing the massively increased number of classes after switching to SOLID?

Did any of the founding fathers anticipate Lysander Spooner's criticism of the constitution?

How might the United Kingdom become a republic?

Print the last, middle and first character of your code

Double-sided action figure, early 80s?

Was lunar module "pilot" Harrison Schmitt legally a "pilot" at the time?

Is Arc Length always irrational between two rational points?

The monorail explodes before I can get on it

Was I subtly told to resign?

Drawing color tiles using Tikz

Why are they 'nude photos'?

Rhombuses, kites etc

Why isn't there research to build a standard lunar, or Martian mobility platform?

What's the maximum time an interrupt service routine can take to execute on atmega328p?

how to convert unix epoch microseconds into Java time stamp

What are some examples of special things about Russian?

Supporting developers who insist on using their pet language

If the railway suggests a 5-min connection window for changing trains in the Netherlands, does that mean it's definitely doable?

When did the Roman Empire fall according to contemporaries?



Can the Linux console display 16 colors?


256 color in Linux consolePrint console colorsChange colors in console/virtual terminalSerial Over Lan redirection stops at OS bootWhy do we need so many terminal emulator packages and what is their use?Detect how much of Unicode my terminal supports, even through screenterminal color theory256 colors in console (tty)Linux console can't display any language other than English while the terminal under Gnome canSuitables TERM variable values for a serial console






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I'm reading the manual page terminfo and I wonder if the Linux console may
use the terminal type linux-16color instead of the terminal type linux.



prompt% infocmp linux linux-16color
comparing linux to linux-16color.
comparing booleans.
comparing numbers.
colors: 8, 16.
ncv: 18, 42.
pairs: 64, 256.
comparing strings.
setab: 'E[4%p1%dm', 'E[4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m'.
setaf: 'E[3%p1%dm', 'E[3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;21%;m'.


I replaced the terminal typelinux in /etc/inittab by linux-16color but the Linux console seems to display only eight colors. I thought the terminal type linux-16color could be specified to display sixteen colors, concerning the Linux console. I have also tried to set the environment variable TERM to linux-16color without success.



Can the Linux console display sixteen colors? Can the Linux console support the terminal type linux-16color?



See Also




  • Terminal code (ANSI/VT100)










share|improve this question























  • just trying, there's something strange with regard to e[30m and e[90m (when using ainsi codes). If you start a loop with 31..37 vs 91..97 (avoiding 30 and 90) you should see more than 8 colors. I have no idea what's the meaning

    – A.B
    Aug 24 '18 at 17:16













  • I do not know how the colors are managed (e.g. encoding). However, my virtual terminal supports sixteen foreground colors and eight background colors (using escape sequences e.g. E[40;95m. The recommended approach is to use terminfo-aware programs such as tput (see console_codes). By the way, the terminal description "linux" indicates that eight colors (0...7) are supported (foreground/background), e.g. tput setaf 5 or tput setab 5.

    – Fólkvangr
    Aug 27 '18 at 8:20




















1















I'm reading the manual page terminfo and I wonder if the Linux console may
use the terminal type linux-16color instead of the terminal type linux.



prompt% infocmp linux linux-16color
comparing linux to linux-16color.
comparing booleans.
comparing numbers.
colors: 8, 16.
ncv: 18, 42.
pairs: 64, 256.
comparing strings.
setab: 'E[4%p1%dm', 'E[4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m'.
setaf: 'E[3%p1%dm', 'E[3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;21%;m'.


I replaced the terminal typelinux in /etc/inittab by linux-16color but the Linux console seems to display only eight colors. I thought the terminal type linux-16color could be specified to display sixteen colors, concerning the Linux console. I have also tried to set the environment variable TERM to linux-16color without success.



Can the Linux console display sixteen colors? Can the Linux console support the terminal type linux-16color?



See Also




  • Terminal code (ANSI/VT100)










share|improve this question























  • just trying, there's something strange with regard to e[30m and e[90m (when using ainsi codes). If you start a loop with 31..37 vs 91..97 (avoiding 30 and 90) you should see more than 8 colors. I have no idea what's the meaning

    – A.B
    Aug 24 '18 at 17:16













  • I do not know how the colors are managed (e.g. encoding). However, my virtual terminal supports sixteen foreground colors and eight background colors (using escape sequences e.g. E[40;95m. The recommended approach is to use terminfo-aware programs such as tput (see console_codes). By the way, the terminal description "linux" indicates that eight colors (0...7) are supported (foreground/background), e.g. tput setaf 5 or tput setab 5.

    – Fólkvangr
    Aug 27 '18 at 8:20
















1












1








1


1






I'm reading the manual page terminfo and I wonder if the Linux console may
use the terminal type linux-16color instead of the terminal type linux.



prompt% infocmp linux linux-16color
comparing linux to linux-16color.
comparing booleans.
comparing numbers.
colors: 8, 16.
ncv: 18, 42.
pairs: 64, 256.
comparing strings.
setab: 'E[4%p1%dm', 'E[4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m'.
setaf: 'E[3%p1%dm', 'E[3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;21%;m'.


I replaced the terminal typelinux in /etc/inittab by linux-16color but the Linux console seems to display only eight colors. I thought the terminal type linux-16color could be specified to display sixteen colors, concerning the Linux console. I have also tried to set the environment variable TERM to linux-16color without success.



Can the Linux console display sixteen colors? Can the Linux console support the terminal type linux-16color?



See Also




  • Terminal code (ANSI/VT100)










share|improve this question














I'm reading the manual page terminfo and I wonder if the Linux console may
use the terminal type linux-16color instead of the terminal type linux.



prompt% infocmp linux linux-16color
comparing linux to linux-16color.
comparing booleans.
comparing numbers.
colors: 8, 16.
ncv: 18, 42.
pairs: 64, 256.
comparing strings.
setab: 'E[4%p1%dm', 'E[4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m'.
setaf: 'E[3%p1%dm', 'E[3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;21%;m'.


I replaced the terminal typelinux in /etc/inittab by linux-16color but the Linux console seems to display only eight colors. I thought the terminal type linux-16color could be specified to display sixteen colors, concerning the Linux console. I have also tried to set the environment variable TERM to linux-16color without success.



Can the Linux console display sixteen colors? Can the Linux console support the terminal type linux-16color?



See Also




  • Terminal code (ANSI/VT100)







linux colors console






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 24 '18 at 16:20









FólkvangrFólkvangr

3402 silver badges14 bronze badges




3402 silver badges14 bronze badges













  • just trying, there's something strange with regard to e[30m and e[90m (when using ainsi codes). If you start a loop with 31..37 vs 91..97 (avoiding 30 and 90) you should see more than 8 colors. I have no idea what's the meaning

    – A.B
    Aug 24 '18 at 17:16













  • I do not know how the colors are managed (e.g. encoding). However, my virtual terminal supports sixteen foreground colors and eight background colors (using escape sequences e.g. E[40;95m. The recommended approach is to use terminfo-aware programs such as tput (see console_codes). By the way, the terminal description "linux" indicates that eight colors (0...7) are supported (foreground/background), e.g. tput setaf 5 or tput setab 5.

    – Fólkvangr
    Aug 27 '18 at 8:20





















  • just trying, there's something strange with regard to e[30m and e[90m (when using ainsi codes). If you start a loop with 31..37 vs 91..97 (avoiding 30 and 90) you should see more than 8 colors. I have no idea what's the meaning

    – A.B
    Aug 24 '18 at 17:16













  • I do not know how the colors are managed (e.g. encoding). However, my virtual terminal supports sixteen foreground colors and eight background colors (using escape sequences e.g. E[40;95m. The recommended approach is to use terminfo-aware programs such as tput (see console_codes). By the way, the terminal description "linux" indicates that eight colors (0...7) are supported (foreground/background), e.g. tput setaf 5 or tput setab 5.

    – Fólkvangr
    Aug 27 '18 at 8:20



















just trying, there's something strange with regard to e[30m and e[90m (when using ainsi codes). If you start a loop with 31..37 vs 91..97 (avoiding 30 and 90) you should see more than 8 colors. I have no idea what's the meaning

– A.B
Aug 24 '18 at 17:16







just trying, there's something strange with regard to e[30m and e[90m (when using ainsi codes). If you start a loop with 31..37 vs 91..97 (avoiding 30 and 90) you should see more than 8 colors. I have no idea what's the meaning

– A.B
Aug 24 '18 at 17:16















I do not know how the colors are managed (e.g. encoding). However, my virtual terminal supports sixteen foreground colors and eight background colors (using escape sequences e.g. E[40;95m. The recommended approach is to use terminfo-aware programs such as tput (see console_codes). By the way, the terminal description "linux" indicates that eight colors (0...7) are supported (foreground/background), e.g. tput setaf 5 or tput setab 5.

– Fólkvangr
Aug 27 '18 at 8:20







I do not know how the colors are managed (e.g. encoding). However, my virtual terminal supports sixteen foreground colors and eight background colors (using escape sequences e.g. E[40;95m. The recommended approach is to use terminfo-aware programs such as tput (see console_codes). By the way, the terminal description "linux" indicates that eight colors (0...7) are supported (foreground/background), e.g. tput setaf 5 or tput setab 5.

– Fólkvangr
Aug 27 '18 at 8:20












1 Answer
1






active

oldest

votes


















3














The linux-16color terminal description uses the console's blink- and bold-attributes to map codes 0-15 into the 16 colors that the console is capable of doing. In the description, that is done using the 5 vs 25 and 1 vs 21 constants in the setaf and setab capabilities which you may notice in the console_codes(4) manual page.



You might find it easier to see using the -f option of infocmp:



    setab=E[4 
%p1%{8}%m%d
%?
%p1%{7}%>
%t;5
%e
;25
%;
m,


The sequence (reading top to bottom) does this:




  • sends an ASCII escape (the E) followed by [ and 4

  • checks if the first parameter is greater than 7


    • if yes, sends ; (a delimiter) and 5 (the blink attribute)

    • if no, sends ; 2 5 to turn blink off)



  • finishes the SGR by sending m


Those attributes happen to work with VGA drivers which don't (generally) cause the text to blink, or use a different font to show bold text. Instead, they allow extending the set of colors (in a nonstandard manner, of course). If you have a different display device (such as the virtual machines I work with), none of that applies anymore.



There's a complication since that was set up: configurations which load a Unicode-capable font (i.e., 512 glyphs versus the original 256) take over one of the bits used for those 16 colors, so you really only get 8 colors. That's mentioned here and there this for example, but was introduced since the manual page was last updated:




Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, bright colors are no longer available on the Linux console unless a framebuffer is used. If one wants to have bright colors without framebuffer and can live without characters not belonging to his language, it is still possible to use a language-specific 256-glyph font, as illustrated below:







share|improve this answer


























  • In my opinion, your explanation is too brief. Could you present the notation used for "string capabilities"? c.f. man terminfo, section "Parameterized Strings".

    – Fólkvangr
    Aug 27 '18 at 8:49
















Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f464670%2fcan-the-linux-console-display-16-colors%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














The linux-16color terminal description uses the console's blink- and bold-attributes to map codes 0-15 into the 16 colors that the console is capable of doing. In the description, that is done using the 5 vs 25 and 1 vs 21 constants in the setaf and setab capabilities which you may notice in the console_codes(4) manual page.



You might find it easier to see using the -f option of infocmp:



    setab=E[4 
%p1%{8}%m%d
%?
%p1%{7}%>
%t;5
%e
;25
%;
m,


The sequence (reading top to bottom) does this:




  • sends an ASCII escape (the E) followed by [ and 4

  • checks if the first parameter is greater than 7


    • if yes, sends ; (a delimiter) and 5 (the blink attribute)

    • if no, sends ; 2 5 to turn blink off)



  • finishes the SGR by sending m


Those attributes happen to work with VGA drivers which don't (generally) cause the text to blink, or use a different font to show bold text. Instead, they allow extending the set of colors (in a nonstandard manner, of course). If you have a different display device (such as the virtual machines I work with), none of that applies anymore.



There's a complication since that was set up: configurations which load a Unicode-capable font (i.e., 512 glyphs versus the original 256) take over one of the bits used for those 16 colors, so you really only get 8 colors. That's mentioned here and there this for example, but was introduced since the manual page was last updated:




Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, bright colors are no longer available on the Linux console unless a framebuffer is used. If one wants to have bright colors without framebuffer and can live without characters not belonging to his language, it is still possible to use a language-specific 256-glyph font, as illustrated below:







share|improve this answer


























  • In my opinion, your explanation is too brief. Could you present the notation used for "string capabilities"? c.f. man terminfo, section "Parameterized Strings".

    – Fólkvangr
    Aug 27 '18 at 8:49


















3














The linux-16color terminal description uses the console's blink- and bold-attributes to map codes 0-15 into the 16 colors that the console is capable of doing. In the description, that is done using the 5 vs 25 and 1 vs 21 constants in the setaf and setab capabilities which you may notice in the console_codes(4) manual page.



You might find it easier to see using the -f option of infocmp:



    setab=E[4 
%p1%{8}%m%d
%?
%p1%{7}%>
%t;5
%e
;25
%;
m,


The sequence (reading top to bottom) does this:




  • sends an ASCII escape (the E) followed by [ and 4

  • checks if the first parameter is greater than 7


    • if yes, sends ; (a delimiter) and 5 (the blink attribute)

    • if no, sends ; 2 5 to turn blink off)



  • finishes the SGR by sending m


Those attributes happen to work with VGA drivers which don't (generally) cause the text to blink, or use a different font to show bold text. Instead, they allow extending the set of colors (in a nonstandard manner, of course). If you have a different display device (such as the virtual machines I work with), none of that applies anymore.



There's a complication since that was set up: configurations which load a Unicode-capable font (i.e., 512 glyphs versus the original 256) take over one of the bits used for those 16 colors, so you really only get 8 colors. That's mentioned here and there this for example, but was introduced since the manual page was last updated:




Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, bright colors are no longer available on the Linux console unless a framebuffer is used. If one wants to have bright colors without framebuffer and can live without characters not belonging to his language, it is still possible to use a language-specific 256-glyph font, as illustrated below:







share|improve this answer


























  • In my opinion, your explanation is too brief. Could you present the notation used for "string capabilities"? c.f. man terminfo, section "Parameterized Strings".

    – Fólkvangr
    Aug 27 '18 at 8:49
















3












3








3







The linux-16color terminal description uses the console's blink- and bold-attributes to map codes 0-15 into the 16 colors that the console is capable of doing. In the description, that is done using the 5 vs 25 and 1 vs 21 constants in the setaf and setab capabilities which you may notice in the console_codes(4) manual page.



You might find it easier to see using the -f option of infocmp:



    setab=E[4 
%p1%{8}%m%d
%?
%p1%{7}%>
%t;5
%e
;25
%;
m,


The sequence (reading top to bottom) does this:




  • sends an ASCII escape (the E) followed by [ and 4

  • checks if the first parameter is greater than 7


    • if yes, sends ; (a delimiter) and 5 (the blink attribute)

    • if no, sends ; 2 5 to turn blink off)



  • finishes the SGR by sending m


Those attributes happen to work with VGA drivers which don't (generally) cause the text to blink, or use a different font to show bold text. Instead, they allow extending the set of colors (in a nonstandard manner, of course). If you have a different display device (such as the virtual machines I work with), none of that applies anymore.



There's a complication since that was set up: configurations which load a Unicode-capable font (i.e., 512 glyphs versus the original 256) take over one of the bits used for those 16 colors, so you really only get 8 colors. That's mentioned here and there this for example, but was introduced since the manual page was last updated:




Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, bright colors are no longer available on the Linux console unless a framebuffer is used. If one wants to have bright colors without framebuffer and can live without characters not belonging to his language, it is still possible to use a language-specific 256-glyph font, as illustrated below:







share|improve this answer















The linux-16color terminal description uses the console's blink- and bold-attributes to map codes 0-15 into the 16 colors that the console is capable of doing. In the description, that is done using the 5 vs 25 and 1 vs 21 constants in the setaf and setab capabilities which you may notice in the console_codes(4) manual page.



You might find it easier to see using the -f option of infocmp:



    setab=E[4 
%p1%{8}%m%d
%?
%p1%{7}%>
%t;5
%e
;25
%;
m,


The sequence (reading top to bottom) does this:




  • sends an ASCII escape (the E) followed by [ and 4

  • checks if the first parameter is greater than 7


    • if yes, sends ; (a delimiter) and 5 (the blink attribute)

    • if no, sends ; 2 5 to turn blink off)



  • finishes the SGR by sending m


Those attributes happen to work with VGA drivers which don't (generally) cause the text to blink, or use a different font to show bold text. Instead, they allow extending the set of colors (in a nonstandard manner, of course). If you have a different display device (such as the virtual machines I work with), none of that applies anymore.



There's a complication since that was set up: configurations which load a Unicode-capable font (i.e., 512 glyphs versus the original 256) take over one of the bits used for those 16 colors, so you really only get 8 colors. That's mentioned here and there this for example, but was introduced since the manual page was last updated:




Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, bright colors are no longer available on the Linux console unless a framebuffer is used. If one wants to have bright colors without framebuffer and can live without characters not belonging to his language, it is still possible to use a language-specific 256-glyph font, as illustrated below:








share|improve this answer














share|improve this answer



share|improve this answer








edited 31 mins ago









wjandrea

5984 silver badges14 bronze badges




5984 silver badges14 bronze badges










answered Aug 24 '18 at 20:10









Thomas DickeyThomas Dickey

54.8k5 gold badges110 silver badges186 bronze badges




54.8k5 gold badges110 silver badges186 bronze badges













  • In my opinion, your explanation is too brief. Could you present the notation used for "string capabilities"? c.f. man terminfo, section "Parameterized Strings".

    – Fólkvangr
    Aug 27 '18 at 8:49





















  • In my opinion, your explanation is too brief. Could you present the notation used for "string capabilities"? c.f. man terminfo, section "Parameterized Strings".

    – Fólkvangr
    Aug 27 '18 at 8:49



















In my opinion, your explanation is too brief. Could you present the notation used for "string capabilities"? c.f. man terminfo, section "Parameterized Strings".

– Fólkvangr
Aug 27 '18 at 8:49







In my opinion, your explanation is too brief. Could you present the notation used for "string capabilities"? c.f. man terminfo, section "Parameterized Strings".

– Fólkvangr
Aug 27 '18 at 8:49




















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • 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%2funix.stackexchange.com%2fquestions%2f464670%2fcan-the-linux-console-display-16-colors%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

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...