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) ] ~ $
(It adds u7 (user string 7) to the terminfos, which xterm has defined, which is used with tput to get the cursor location).