When using the terminal in emacs (M-x term) under MacOS for some reason it always posts the characters 4m before every line in zsh and always prints 2 lines containing the u
This installed eterm-color.ti for me on OSX Mavericks 10.9.5:
eterm-color.ti
Upload eterm-color.ti to /tmp on the remote OSX server.
/tmp
Run the command sudo tic -o /usr/share/terminfo /tmp/eterm-color.ti on the server.
sudo tic -o /usr/share/terminfo /tmp/eterm-color.ti
In my case, this put a file eterm-color in the directory /usr/share/terminfo/65/
eterm-color
/usr/share/terminfo/65/