I've had difficulty trying to set that one. It can temporarily be set by the command line. For sh and ksh, everything may have to be logged in or maybe as far as rebooting after adjusting the configuration files. CSH, MKSH, ZSH are easy to set up the colors of the prompt. SH and KSH have been more difficult, as the settings haven't stayed for me from the configuration file and after logging into the shell. Setting up the way
ls
(not the prompt) is temporarily displayed in SH and KSH is easy, however, as that's universal for most shells.
set
and
export
will show you which variables contain settings for prompts including of colors. They can also be used to adjust those variables. They show up after manually entering them. When I tried plain Bourne shell, it seemed to pick up colors that I set on the default shell that I use.
There's a lot at
https://forums.freebsd.org/threads/colorize-your-bsd-shell.85458/ that you can use or adapt. Finding plain Bourne on the Internet was difficult.
https://forums.freebsd.org/threads/share-your-shrc-kshrc-or-mkshrc-file-bourne-or-korn-shell.85467/ has an example for ksh and mksh. They're similar enough and use many of the same settings that those can be tried for sh. Those and zsh can work, because ksh, mksh and zsh take after a lot of sh configurations. The ones that would be so different, they wouldn't be relevant are CSH and Bash.
In
.shrc, the following an be tried:
Code:
PS1=$'\E[1m\E[32m$PWD \E[0m$ '
That's for mksh, and there's a similar one for ksh. It may need a reboot or something for it to work with sh and ksh. There may be a security setting for those shells that makes it so they're more difficult to set immediately. I'm not sure.
Update us on what works for you.