I've managed to avoid this by setting my shell to a script which pipes bash through GNU fold, so long lines are broken up before Emacs ever sees them (around 1000 characters; slightly earlier if there's whitespace). Rather extreme, but I really like shell-mode (not really a fan of eshell)