Score:0

default value of $TERM? vim is now broken

us flag

after installing ubuntu 20.04.2 on my laptop, i set up vim. i found this colorscheme that i like: colorscheme. the colours for syntax highlighting were correct, but it didn't have the beautiful blue background that i wanted:

upon quick research, i found many claims about how setting $TERM to xterm-256color fixed their problems with incorrect vim color rendering. i wasn't sure this would help because after

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";
}'

this i knew my terminal supported true colors. i export $TERM=xterm-256color anyway and now all the colors are rendered incorrectly.. it has the same background it had before changing $TERM, but now it looks like this:

clearly $TERM messed everything up, what is the default value of $TERM?

also if anyone has an idea how to fix my vim.... adding set t_Co=256 did not fix anything. also installed ncurses-term. no fix. if it helps, my .vimrc:

set t_Co=256
colorscheme bluewery
let g:lightline = { 'colorscheme': 'bluewery'} "this is to be specified for the colorscheme
syntax on
set tabstop=2
set noexpandtab
muru avatar
us flag
Did you put `export TERM=...` in your `.bashrc` or other login files? If not, just open a new terminal. Your terminal emulator will set the correct value for `TERM`.
raincouver avatar
us flag
you are correct. `TERM` had nothing to do with this, reinstalled vim and another colorscheme now works perfectly fine.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.