From aae8203f86b0cce6efb4fb4a07c1759ca726b782 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 7 Aug 2020 23:58:56 -0400 Subject: [PATCH] os/tty: mention true-color and italics in readme --- modules/os/tty/README.org | 50 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/modules/os/tty/README.org b/modules/os/tty/README.org index 9112a22e5..9a8e398c1 100644 --- a/modules/os/tty/README.org +++ b/modules/os/tty/README.org @@ -53,7 +53,55 @@ need to work. * Configuration -# How to configure this module, including common problems and how to address them. +** True-color and italic support +(credit goes to [[https://github.com/syl20bnr/spacemacs/wiki/Terminal][the spacemacs wiki]] for this information) + +Create a =xterm-24bit.terminfo= file with the following contents: + +#+BEGIN_SRC text +xterm-24bit|xterm with 24-bit direct color mode, + use=xterm-256color, + sitm=\E[3m, + ritm=\E[23m, + setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, + setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, +#+END_SRC + +#+begin_quote +WARNING: Make sure you have a newline at end of file otherwise you will get +errors! +#+end_quote + +Execute the following command on the command line: +#+BEGIN_SRC sh +tic -x -o ~/.terminfo xterm-24bit.terminfo +#+END_SRC + +Now set your ~$TERM~ variable to ~xterm-24bit~: +#+BEGIN_SRC sh +export TERM=xterm-24bit +#+END_SRC + +SSH might break if your remote machine does not have the same setup, you can +work around this with the following alias. +#+BEGIN_SRC sh +alias ssh="TERM=xterm-256color ssh" +#+END_SRC + +If you use tmux, you need to make sure you installed a version with truecolor +support, then add the following lines to your `.tmux.conf`: +#+BEGIN_SRC conf +set -g default-terminal "xterm-24bit" +set -g terminal-overrides ',xterm-24bit:Tc' +#+END_SRC + +Also, make sure you have utf8 language variables if you want all characters to +display correctly. For example: +#+BEGIN_SRC bash +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 +export LANGUAGE=en_US.UTF-8 +#+END_SRC * Troubleshooting # Common issues and their solution, or places to look for help.