News for hackers. Stuff that matters.
Re:Bash PS1 Generator by res0nat0r on Thursday June 24, 2021 @12:17PM (#27619759)
This is the PS1 I've been using for a long time:

export PS1="\n\$(kube_ps1)\n\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;31m\]\$(__git_ps1)\n\$\[\033[00m\] "

Note it needs the git-prompt.sh script (usually comes with the bash-completion package), and the kube-ps1 script: https://github.com/jonmosco/kube-ps1

It will show you the current kubernetes profile and namespace, user@host, current directory and git branch if you're in a git repo.

There are no comments on this comment yet.