title: Coloring bug with Vim's ctermbg; workaround with VimLeave?
body: <p>I recently discovered Vim colorschemes, and in the process have discovered a rather curious bug: when I run <code>hi Normal ctermbg</code> in Vim, the color change carries over to the shell that I'm running Vim in, like so:</p>
  
  <p><a href="https://i.stack.imgur.com/Z9Uce.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z9Uce.png" alt="vim-ctermbg-bug"></a></p>
  
  <p>I'm using PuTTYtray (but also see the behavior in PuTTY) with 256 colors enabled , bolded text indicated by font changes, and $TERM set to "putty-256color"; my .vimrc is as follows:</p>
  
  <pre><code>set t_Co=256
  colors zenburn
  </code></pre>
  
  <p>and zenburn.vim can be found <a href="https://github.com/jnurmine/Zenburn/blob/master/colors/zenburn.vim" rel="nofollow noreferrer">here</a>. I've isolated the problem specifically to specifically line 298, where it first configures <code>ctermbg</code> for Normal highlighting.</p>
  
  <p>(As an aside: it seems that when using PuTTY tray with specific color settings, in Normal highlighting, <code>ctermbg</code> has to be first set simultaneously with <code>guifg</code> or <code>guibg</code>, e.g. <code>hi Normal guifg=#dcdccc ctermbg=237</code>, and only after that will <code>hi Normal ctermbg=some_val</code> work.)</p>
  
  <p>Does anyone happen to have any idea why this is happening?</p>
  
  <hr>
  
  <p>I've also tried to do a workaround by running <code>hi Normal ctermbg=None</code> on <code>VimLeave</code> (although I recognize that this is problematic if I run multiple Vim instances, so if anyone can suggest an alternative that would also be welcome), but with no success. Adding the following to my <code>.vimrc</code> does not work:</p>
  
  <pre><code>function! RESET_ctermbg()
      "reset $ctermbg to None"
      exec "hi Normal ctermbg=None"
  endfunction
  au VimLeave * call RESET_ctermbg()
  </code></pre>