It's actually the remote machine that isn't working, but I get the frustration. What I did to fix this is to override the environment variables in your SSH config like this:
Host * SetEnv TERM=xterm-256color
Host * SetEnv TERM=xterm-256color
Host *
SetEnv TERM=xterm-256color
SendEnv COLORTERM TERM_PROGRAM TERM_PROGRAM_VERSION