title: With $TERM='screen-256color' under tmux, HOME and END keys don't work. Why?
body: <p>I have tmux set up with <code>$TERM</code> being set to <code>screen-256color</code> correctly. This works fine, and colours are set correctly, however it prevents me from sending <code>HOME</code> and <code>END</code> keys to the terminal, which are instead printed as <code>F\n</code> and <code>H\n</code>. </p>
  
  <p>I should add that home appears to work in irssi, but not vim. Home seems to send (According to <code>Ctrl+v &lt;HOME&gt;</code>), <code>^[OH</code></p>
  
  <p>It may be worth adding that I am well aware of the ability to use <code>^</code> and <code>$</code> to move to the start and end of the lines, however <code>$</code> does not go to the end, rather the penultimate character, and I prefer to use <code>HOME</code> and <code>END</code> (as I can under other $TERM settings).</p>
  
  <p>Can anyone explain why this is, and how I can fix it?</p>
  
  <p>As a part-way fix, I set the vim keybindings to map a <code>&lt;Home&gt;</code> and <code>&lt;End&gt;</code> keypress to <code>&lt;Esc&gt;OH</code> and <code>&lt;Esc&gt;OF</code>. This isn't ideal, but works for the moment! See <a href="https://github.com/jvc26/dotfiles/blob/master/.vimrc">https://github.com/jvc26/dotfiles/blob/master/.vimrc</a> for details.</p>
  
  <p>Thanks!</p>