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