Everyone has a different preference for $PS1
in bash what is yours?
For further actions, you may consider blocking this person and/or reporting abuse
Everyone has a different preference for $PS1
in bash what is yours?
For further actions, you may consider blocking this person and/or reporting abuse
Ben Halpern -
Jagroop Singh -
Anish Kumar -
Mark Adel -
Top comments (11)
But it's automagically set in my
.zhsrc
.at the top
and later on
That is nice! I never thought of displaying the powerlevel in PS1. I should try out zsh or maybe fish as well.
The reason I switched to zsh a few years back is that zsh's vi-mode can do visual whereas bash couldn't (can't?).
Cut&paste within your command line can be super handy, like when you, once again, forgot that git does parameters BSD style so no options after the argument, and you have to move either arguments or options.
I have this in my nixos configuration
It is very minimal. Either a
$
or(1) $
. I use screen and I have common directories already open using.screenrc
. This helps me avoid jumping between directories a lot. I also don't really need to know what user or machine I am on. If I get confused there is a command to look it up.And there I thought I was going for the bare minimum xD
I admire your workflow though, it seems pretty strict and probably comes with quite some efficiency.
It works for me. It may not be as useful for some users that want more info. I'm tempted to add the git branch but I'm not sure that I need it. I mostly use my IDE for git anyway except when I work on nixos.
My zsh is configured to be minimal, no fancy characters, no fancy features for git, just a plain prompt in the Gentoo style.
The only difference is the last character (
$
in bash,%
in zsh) which is either green or red depending on the last exit code.I need to rely on the prompt, on its position and looks, so nothing with variable length except for the path (which only the shell itself can change).
Beyond the prompt however starts syntax highlighting for my command and everything, so it is really just the prompt that I want to be static as an anchor of sorts.
Code over on GitHub.
${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
Which generates something like this in a git enabled directory:
A Unicorn Symbol, My Name, Current Directory, Current Git Branch.
Nothing Fancy :)
I've found the cool generator: bashrcgenerator.com
Very cool!