Skip to content

How to change prompt and keep colors? #11897

Answered by zcobol
givihuda asked this question in Q&A
Discussion options

You must be logged in to vote

Look into .bashrc file located in your home directory for PS1 prompt settings:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Look at \033[01;32m which is an escape sequence, with \033[ being CSI (control sequence introducer) and 32 is ANSI green. There's a good intro at https://en.wikipedia.org/wiki/ANSI_escape_code

Your prompt PS1="\D{%Y-%m-%d-%I:%M%p} \u@$WSL_DISTRO_NAME: has no colors defined.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by givihuda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants