I discovered something that I would like to share.
Since most systems today support color (xterm-color, vt100-color, vt102-color, vt220-color, mv100, etc...), I did some experimenting and was able to get a color prompt using ksh(1) (It's shells/pdksh from the ports.).
First step is to get the ANSI color codes which can be found here.
Next is to tailor your prompt. In vi, I used <CTRL>-V and then hit <ESC> to generate a literal 0x1B character. So to get a blue foreground color, you would do <CTRL>-V<ESC>[34m. With this, my PS1 assignment looks like this:
Since different shells have different requirements, you will need to experiment to see what your shell requires. I put this line in my ~/.profile and it works like a charm.
One more thing, you cannot just mouse copy the above code into your prompt and expect it to work. You MUST do the <CTRL>-V <ESC> sequence to generate the ^[ character, otherwise it's just a carat and a opening bracket.
Since most systems today support color (xterm-color, vt100-color, vt102-color, vt220-color, mv100, etc...), I did some experimenting and was able to get a color prompt using ksh(1) (It's shells/pdksh from the ports.).
First step is to get the ANSI color codes which can be found here.
Next is to tailor your prompt. In vi, I used <CTRL>-V and then hit <ESC> to generate a literal 0x1B character. So to get a blue foreground color, you would do <CTRL>-V<ESC>[34m. With this, my PS1 assignment looks like this:
Code:
PS1='^[[32m$HOSTNAME^[[37m:^[[33m$PWD^[[31m ! ^[[35m\$\$\$ ->^[[0m'
One more thing, you cannot just mouse copy the above code into your prompt and expect it to work. You MUST do the <CTRL>-V <ESC> sequence to generate the ^[ character, otherwise it's just a carat and a opening bracket.