iTerm2 Shell Integration breaks sftp, for fish-shell at least
I recently ran the "Install Shell Integration" menu option in iTerm 2.9.20150711-nightly and later discovered I could no longer sftp to that system -- I was getting the error
Received message too long 459092275. After some digging, I found that the added
iterm2_shell_integration.fish script sourced during login was the culprit (fish is my default shell). I modified the script so it initially tests not just for screen, but for an empty or "dumb"
$TERM, and that fixed it:
if test $TERM != "" -a $TERM != "dumb" -a $TERM != "screen"