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
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