Talk:Color output in console

From ArchWiki
Jump to navigation Jump to search

Colour Chart for Colourised Output with less

Moved here from Talk:Man_page:

The sample code for Bash in Man_page#Using_less_.28Recommended.29 uses a 256 colour palette on some lines. I followed the existing link to Wikipedia: ANSI escape codes and, though a very good reference, did not suit my needs at the time because there is too much detail.
For someone such as myself who is basically happy with the sample code and wishes only to tweak the colours a little, a simple colour chart would offer a speedier route to gain the knowledge required. I used this colour chart to achieve what I needed: Wkipedia: Xterm 256-color chart.svg
I do not know enough about the various different terminals to know if this is a good enough reference for broader use, however it worked for me using PuTTY to connect to a RaspberryPi.
I would appreciate some instruction if this chart is suitable for broader use. If it is suitable, I would add a link and text along the lines of:
"If you simply wish to change the colours given in the sample code, edit the lines containing ;38;5 and change the number right before m, referring to the xterm 256-colour chart: Wikipedia: Xterm 256-color chart". --Crumeniferus (talk) 15:40, 5 January 2015 (UTC)

Color palette should be covered in this page. --Fengchao (talk) 07:34, 3 February 2017 (UTC)

Move proposal

This article better inside Linux console? --AlonsoLP (talk) 09:11, 23 September 2018 (UTC)

No. While it has console in the title it's not about the Linux console but about command-line colors. Ie. it is just as applicable to terminal emulators. --Larivact (talk) 09:22, 23 September 2018 (UTC)

Updated color instructions for less

I did an exhaustive analysis about a groff issue and interactions with less (see my article), which lead me to discover there's new less options:

   LESS=-RXF --use-color -Dd+r$Du+b

This gives us a much simpler way to set color. It only works on newer versions of less. And for only man pages:

   MANPAGER="less -R --use-color -Dd+r -Du+b"

I'll update the page with them.

—This unsigned comment is by Felipec (talk) 17:14, 5 June 2021 (UTC). Please sign your posts with ~~~~!