Re: more distinct default bash prompt?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 21, 2023 at 11:50 PM Jens-Ulrik Petersen
<petersen@xxxxxxxxxx> 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.

Attachment: Screenshot from 2023-05-22 14-27-12.png
Description: PNG image

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux