On Sun, May 21, 2023 at 11:50 PM Jens-Ulrik Petersen
<peter...@redhat.com> wrote:
>
> In Fedora the bash prompt is not colored or highlighted by default.
...
> I think it would be nice to have a distinctive prompt by default, or at least 
> a very easy way to get one permanently (ie in a single command: even if that 
> were `dnf install bash-color-prompt` or running say `colorprompt` once).

We could put the following at the end of /etc/bashrc:
```
function _update_ps1() {
    PS1="$(/usr/bin/powerline-go -modules
venv,user,host,ssh,cwd,perms,git,hg,jobs,exit -colorize-hostname
-error $? -static-prompt-indicator -newline -jobs $(jobs -p | wc -l))"
}
if [ "$TERM" != "linux" ] && [ -f "/usr/bin/powerline-go" ]; then
    PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi
```

See attached picture for what it looks like. I've been using this
setup on my machines for years and it's been super helpful. (Note that
the modules listed in the PS1 line there appear only when relevant. So
you won't see 'ssh', 'git', etc. information unless they're in use.
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to