In zsh, if a command lacks a trailing newline (like echo -n hello
), an inverted percent sign with a newline is appended to the output so the prompt can be printed on its own line, not directly after the output. The bashrc in this example will emulate this behavior in bash.
dave @ [ manilla :: (Darwin) ] ~ $ echo hello
hello
dave @ [ manilla :: (Darwin) ] ~ $ echo -n hello
hellodave @ [ manilla :: (Darwin) ] ~ $
dave @ [ manilla :: (Darwin) ] ~ $ echo hello
hello
dave @ [ manilla :: (Darwin) ] ~ $ echo -n hello
hello%
dave @ [ manilla :: (Darwin) ] ~ $
In order to make work under screen-256color terminfo (which is what tmux uses), compile the following terminfo with tic https://gist.github.com/4770f748854f37c97fcb and use that with tmux instead (in ~/.tmux.conf set -g default-terminal "screen-256color-new").