User Tools

Site Tools


unix:256colours

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
unix:256colours [2009/01/18 16:57]
127.0.0.1 external edit
unix:256colours [2018/07/30 15:10] (current)
robm [So, does terminal <insert name here> do 256 colours?]
Line 1: Line 1:
 +**See also:**
 +  * [[:coding:version_control:git#Colour|Colour in GIT]]
 +
 ====== Colour colour everywhere! 256 colour-mode for Linux consoles ====== ====== Colour colour everywhere! 256 colour-mode for Linux consoles ======
  
Line 10: Line 13:
  
 ===== So, does terminal <insert name here> do 256 colours? ===== ===== So, does terminal <insert name here> do 256 colours? =====
-See [[http://www.frexx.de/xterm-256-notes/]] for some scripts which produce test patterns. Just in case that site disappears, I'll reproduce the script and screen shot here:+See [[https://gist.github.com/hSATAC/1095100]] for a script which produce test patterns. Just in case it disappears, I'll reproduce the script and screen shot here:
  
 The Perl script: {{:unix:256colors2.pl|256colors2.pl}} The Perl script: {{:unix:256colors2.pl|256colors2.pl}}
Line 30: Line 33:
 </note> </note>
  
 +==== Gnome Terminal ====
 +
 +Gnome Terminal //does// support 256 colour mode, but doesn't always sets the ''TERM'' variable to ''xterm'', rather than ''xterm-256color''. There's no way to override this directly, but you can work around it by setting:
 +
 +Profile Preferences → Title and Command → Run a custom command instead of my shell → ''env TERM=xterm-256color /bin/bash''
 +
 +Credit to https://superuser.com/questions/841016/how-to-configure-gnome-terminal-to-use-xterm-256color-by-default
 ===== OK, it does. Now how about Vim? ===== ===== OK, it does. Now how about Vim? =====
 See '':help xterm-color'' for the official documentation. It makes mention of 256 colours, but isn't hugely helpful. See '':help xterm-color'' for the official documentation. It makes mention of 256 colours, but isn't hugely helpful.
Line 60: Line 70:
  
 ===== Setting TERM=xterm-256color by default ===== ===== Setting TERM=xterm-256color by default =====
-For PuTTY, you can change what ''TERM'' name it sends under Settings -> Connection -> Data -> "Terminal-type string". Change it to ''xterm-256colors'', done!+For PuTTY, you can change what ''TERM'' name it sends under Settings -> Connection -> Data -> "Terminal-type string". Change it to ''xterm-256color'', done!
  
 For gnome-terminal, the default Ubuntu terminal if you didn't customise your install, you can't change what it reports itself as: ''xterm''. My work around for this was to add the following snippet to my ''~/.bashrc'': For gnome-terminal, the default Ubuntu terminal if you didn't customise your install, you can't change what it reports itself as: ''xterm''. My work around for this was to add the following snippet to my ''~/.bashrc'':
Line 108: Line 118:
  
 <code bash> <code bash>
-sudo apt-get build-dep screen   # Install whatever's needed to compile screen +sudo apt-get build-dep screen                 # Install whatever's needed to compile screen 
-apt-get source screen           # Download + extract screen source+apt-get source screen                        # Download + extract screen source
 cd ./screen-4.0.3 cd ./screen-4.0.3
-./configure --help | grep 256   # Find magic option we need +./configure --help | grep 256                 # Find magic option we need 
-vim debian/rules                # Edit package build rules, and add \ +vim debian/rules                              # Edit package build rules, and add \ 
-                                # --enable-colors256 to the ./configure command line +                                              # --enable-colors256 to the ./configure command line 
-dpkg-buildpackage -uc -b        # Create a *.deb package file in the directory above current+fakeroot dpkg-buildpackage -uc -b             # Create a *.deb package file in the directory above current
 cd .. cd ..
-dpkg -i screen_4.0.3-7ubuntu1_i386.deb   # Install the newly create package+sudo dpkg -i screen_4.0.3-7ubuntu1_i386.deb   # Install the newly create package
 </code> </code>
  
unix/256colours.1232297825.txt.gz · Last modified: 2009/06/16 15:47 (external edit)