It will get us closer to colour harmony across all terminal applications. It makes sense to use a vim theme as the basis for other application's colours. The most common terminal application that I use is Vim which has a lot of colour themes. See Figure 3 which shows the theme in action, Tmux running with the top panel running ls of a directory with various file types, and ranger in the bottom panel. Here's one of the themes from there that works quite well:Īfter adding it to. We can use these colours to create themes, the best source for terminal colour themes is the Wayback machine of. The second set of colours are supposed to be bright versions of the first set, for example colour8 should be a bright version of color0. They are split into two sets of seven: color0 to color7, and color8 to color15. There are a further 16 colours to define. Finally, some colour themes are designed to match all X clients, for example: If you're having problems with any XTerm setting make sure you don't have a general setting that's interfering. Cut and paste the setting in from above and reload X should lead to something similar to Figure 2.Īs you can see it's a class hierarchy and the * lets you match intervening sections. To be more precise we can use all lower case which matches instances of the XTerm application, xterm*foreground. The capitalisation at the start of XTerm means it's a class definition. If you look on-line you'll see examples similar to these: We'll start by setting the foreground and background colours.Īs before, we add lines to our. You do this by providing an RGB value, the preferred way is rgb:XX/XX/XX but most people use #XXXXXX. XTerm has a range of settings where you have to specify a colour. bashrc that you can uncomment to load it. On Ubuntu there's a standard switch in the supplied. It has colour support through the dircolors command which exports the LSCOLORS environmental variable. ls ls with colour switched on displays in XTerm. Ranger Ranger is a vim like file manager that works in the terminal. Man has colour support if your pager supports it. I had colour differences under tmux until I got the right $TERM set-up. It's useful to test side by side in XTerm and another terminal emulator (e.g gnome-terminal), and to test under tmux and plain terminal session. To test that colours are working in XTerm there are a couple of console applications that are useful: Vim Under normal circumstances this is the easiest and there are lots of themes that use colours. For XTerm, you should check what $TERM is reporting when it's launched, and if it's not xterm-color then add this setting to. Or something like Vim which uses it's own terminal and colour support.Įach step in the stack must report it's settings correctly, this is generally the $TERM environmental variable but there are other aspects. An application This could be a something interacting with the shell such as ls which has colours set-up.A terminal multiplexer (Tmux) Sets $TERM to screen-256color.A terminal emulator (XTerm) Must support 256 colors and report that support to terminal applications.The shell (Bash) Defining a colour supporting $TERM (xterm-256color).It's a bit clearer why application support is a challenge if you think about the stack of building blocks users interact through. To confirm that it can display the colours download a script that generates all the colours for you and check that that they're all visible. If it reports 256 then you're in good shape. In XTerm you can test the status of your colour support with: We have essentially two levels, system support and each terminal application has to support colour itself. Most of us aren't using complex terminal emulation, we're just connecting to the local system over a virtual terminal. This complex capability means there are lots of pieces that can cause difficulty. But, terminal emulation is complex as it lets the user connect to systems with different capabilities. UNIX has been around since the 1970's so you might think colour support would be easy.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |