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
You don't have eterm-color terminfo. First, you try to add following S-exp in your configuration file and evaluate.
;; Use Emacs terminfo, not system terminfo
(setq system-uses-terminfo nil)
If problem is not resolved previous setting, you should create eterm-color terminfo by using following command. (terminfo path may different from your system)
# If you use Cocoa Emacs or Carbon Emacs
tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti
This installed eterm-color.ti
for me on OSX Mavericks 10.9.5:
Upload eterm-color.ti to /tmp
on the remote OSX server.
Run the command sudo tic -o /usr/share/terminfo /tmp/eterm-color.ti
on the server.
In my case, this put a file eterm-color
in the directory /usr/share/terminfo/65/
I needed to set the following environment variables in my ~/.zshrc
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export TERM=xterm-256color