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) ] ~ $
Though I suppose more easily the script could be modified to use
echo -en "\033[6n"
in lieu oftput u7
.