From 39d77dbc644c210417a7e33e03122ca55f60b9e9 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Wed, 31 Jan 2024 11:57:00 +0000 Subject: [PATCH] Use TERM=vscode-direct where available, for more colours --- bashrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 0418ab5..6eaa5ed 100644 --- a/bashrc +++ b/bashrc @@ -54,8 +54,16 @@ if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then fi if [ "$TERM" == "xterm" ] ; then - # Upgrade; I don't think I use anything which doesn't support 256 colour these days. - export TERM=xterm-256color + # If it's available, use vscode-direct (which supports 16 million + # colours via the ';' sequences; required as PuTTY doesn't + # understand the ':' sequences). + # + # https://chadaustin.me/2024/01/truecolor-terminal-emacs/ + if [[ -r /usr/share/terminfo/v/vscode-direct ]] ; then + export TERM=vscode-direct + else + export TERM=xterm-256color + fi fi # If this is an xterm set the title to user@host:dir