Xterm: Difference between revisions

From miki
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 35: Line 35:
* [https://github.com/neovim/neovim/wiki/FAQ neovim/neovim -- FAQ]
* [https://github.com/neovim/neovim/wiki/FAQ neovim/neovim -- FAQ]
* [https://gist.github.com/XVilka/8346728 XVilka/TrueColour.md -- Colours in terminal]
* [https://gist.github.com/XVilka/8346728 XVilka/TrueColour.md -- Colours in terminal]
* [http://bruinsslot.jp/2016/05/29/how-to-enable-true-color-for-neovim-tmux-and-gnome-terminal/ How to enable true-color for neovim, tmux, and gnome-terminal]
* [https://bruinsslot.jp/post/how-to-enable-true-color-for-neovim-tmux-and-gnome-terminal/ How to enable true-color for neovim, tmux, and gnome-terminal]
* [https://github.com/neovim/neovim/issues/3461 neovim/neovim -- Italics aren't displaying properly #3461]
* [https://github.com/neovim/neovim/issues/3461 neovim/neovim -- Italics aren't displaying properly #3461]
* [https://github.com/neovim/neovim/issues/3462#issuecomment-148729580 neovim/neovim -- Get funny chars on terminal #3462]
* [https://github.com/neovim/neovim/issues/3462#issuecomment-148729580 neovim/neovim -- Get funny chars on terminal #3462]
Line 75: Line 75:
* [https://raw.githubusercontent.com/robertknight/konsole/master/tests/color-spaces.pl color-spaces.pl]
* [https://raw.githubusercontent.com/robertknight/konsole/master/tests/color-spaces.pl color-spaces.pl]
* [https://git.gnome.org/browse/vte/tree/perf/img.sh?h=vte-0-36 A true color image viewer in terminal!]
* [https://git.gnome.org/browse/vte/tree/perf/img.sh?h=vte-0-36 A true color image viewer in terminal!]

== Italics ==
Run the following to see if your terminal support italics:
<source lang=bash>
#! /bin/bash

echo "Using tput : " $(tput sitm)italics$(tput ritm)
echo "Using ANSI codes: " $'\e[3mitalics\e[23m'
</source>

Latest revision as of 19:55, 20 June 2017

References

Examples

Change the default window size:

  • Add/Edit this line to file ~/.Xdefaults:
 xterm*vt100.geometry:150x50+100+100
  • Merge it in X database:
 % xrdb -merge ~/.Xdefaults
  • Configure xterm fonts, colors, size. Edit ~/.Xresources:
XTerm*foreground: rgb:00/00/00
XTerm*background: rgb:ff/ff/dd
Xterm*saveLines: 4096
xterm*faceName: DejaVu Sans Mono:size=12
xterm*VT100.geometry: 132x40
... then update X resource database:
xrdb ~/.Xresources

Enable 24-bit Truecolor support

There are lot of discussion about true color and italic support in the terminal. Below the list of relevant posts.

All in all the solution for me involved to at least:

  • Upgrade to Ubuntu Xenial 16.04, to get newest Gnome Terminal and Terminator/gtk3 on recent VTE.
  • Upgrade to tmux 2.2 (only if using tmux).
  • Do a total reset of the account configuration.
  • Fiddle a bit with the terminfo (still not sure what was the exact recipe though).
  • In Vim/Neovim, use gruvbox as theme (not solarized, which does not work in terminal — now patched!).

To test, first verify that the color theme works correctly in gvim.

Terminals

List of terminals that support 24-bit true colors:

  • Gnome-Terminal
  • Gnome-Terminator

Test true-color support

Run the script[1]:

awk 'BEGIN{
    s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
    for (colnum = 0; colnum<77; colnum++) {
        r = 255-(colnum*255/76);
        g = (colnum*510/76);
        b = (colnum*255/76);
        if (g>255) g = 510-g;
        printf "\033[48;2;%d;%d;%dm", r,g,b;
        printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
        printf "%s\033[0m", substr(s,colnum+1,1);
    }
    printf "\n";
}'

Or more:

Italics

Run the following to see if your terminal support italics:

#! /bin/bash

echo "Using tput      : " $(tput sitm)italics$(tput ritm)
echo "Using ANSI codes: " $'\e[3mitalics\e[23m'