Closed mbucc closed 7 years ago
I have the same issue (OS X, zsh, iterm2). I noticed that if I swap \e
with \033
in the color definitions, it works properly for me. I'm not an ascii artisan though, so not sure if this change would be a good permanent swap in the code.?
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html says: "It is not possible to use echo portably across all POSIX systems unless both -n (as the first argument) and escape sequences are omitted."
Per that same page, they suggest using printf for portability.
Another option is to simply delete the code that colors the output. My favorite kind of commit. ;)
I'd like to remove the coloring. It seems difficult to do correctly across all shells. I'd like to make this as portable as possible, and the benefit of coloring prompt output doesn't seem worth complexity.
Quoting from http://www.linuxjournal.com/article/8603?page=0,1:
So, if you want a portable program that can run on various terminals with the same or reduced functionalities, you should use curses. Curses uses terminfo to find the correct codes to accomplish these types of tasks across various terminals. Terminfo is a large database that contains information about the various functionalities of different terminals
If anyone has other suggestions or knows how to do this in a portable way, please comment. I'll leave this ticket open for a while.
Closing as won't fix. Can revisit later if need be.
at least on zsh.