Liquidprompt is the best! I'm using it and it's totally great. Doesn't print useless shit but always prints something when required. Also, no more wrong commands on the wrong ssh hosts.
Mine is weird. It takes up two lines, and it changes its color based on a hash of $(whoami)@$(hostname):$(pwd -P), the idea being that two prompts in different directories or on different hosts will end up with different colors.
function fish_mode_prompt
# Do nothing if not in vi mode
if set -q __fish_vi_mode
switch $fish_bind_mode
case default
prompt_segment $grey $green "N"
case insert
prompt_segment $grey $white "I"
case replace-one
prompt_segment $grey $red "R"
case visual
prompt_segment $grey $purple "V"
end
end
end
in a git directory. __git_ps1 for branch name, etc. Arrow color is green for clean git status, yellow for unstaged changes, or staged but not commited changed (basically git status --porcelain).
# If inside a Git repository, print its branch and state
git_prompt_string() {
local git_where="$(parse_git_branch)"
[ -n "$git_where" ] && echo "$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX"
}
# Set the right-hand prompt
RPS1='$(git_prompt_string)'%
http://imgur.com/h8sa0eg
it's completely dynamic, if i'm in git repo it shows on which branch I am and in which state the commits are. The last one is prompt for root, I've spent a lot of time jumping from one machine to another, so the red hostname is pretty important :)
I really like the look of this. Is there anyway that you could help a noob like me set my terminal up to look like that. I don't need to the tmux stuff.
Basically, on the left it just prints the time and the exit code of the last command, and on the right it prints the current working directory. It also prints special stuff if I'm in a git repo. And everything is colorized.
(It's similar to the gmrl prompt from the archiso.)
I choose not to include my user name or host name because this is for my personal laptop, which I'm the only one who uses, and which I never remotely ssh into.
function fish_prompt
set -g c_color1 (set_color FFFF00)
set -g c_color2 (set_color 00FF00)
set -g c_color3 (set_color 00FFFF)
set -g c_color4 (set_color FFFFFF)
echo "$c_color2┌─[$c_color1"$USER\@(hostname -f)"$c_color2]─[$c_color4"(pwd)"$c_color2]"
echo "$c_color2└─[$c_color3"(date +%H:%M)"$c_color2]\$ "
end
privilege_color() {
local groups
groups=($(groups))
if [[ -n ${groups[(r)wheel]} || -n ${groups[(r)sudo]} ]]
then
echo yellow
else
echo cyan
fi
}
PS1="%B%F{black}%m%b %(!,%F{red},%F{$(privilege_color)})%1~❯%0f "
61 comments
sir? >
https://github.com/nojhan/liquidprompt
Simple but good! :-)
Liquidprompt is the best! I'm using it and it's totally great. Doesn't print useless shit but always prints something when required. Also, no more wrong commands on the wrong ssh hosts.
Exactly my opinion! :-)
What exactly are we using as the baseline?
Mine is weird. It takes up two lines, and it changes its color based on a hash of
$(whoami)@$(hostname):$(pwd -P), the idea being that two prompts in different directories or on different hosts will end up with different colors.Looks like this:
The 0 is the number of background jobs which is super useful for me because I background things all the time with Ctrl+z.
For fish with vi mode enabled and omf installed.
Here is a picture of it
Well I am just using this https://github.com/edkolev/promptline.vim :)
How do you like it?
Well I do like it. I think I found it when I wanted something that looked like powerline for the terminal. It works, and I like it.
typical view
unhappy face for non-zero exit of prev command
in a git directory.
__git_ps1for branch name, etc. Arrow color is green for clean git status, yellow for unstaged changes, or staged but not commited changed (basically git status --porcelain).I like it. Minimal yet informative.
picture of it
My prompt is basically a modified version of
/usr/share/zsh/functions/Prompts/prompt_walters_setup. http://imgur.com/jIZaA3YLeft Application non-zero return code (if unsuccessful) -- code bold white, brackets grey. User: normal -- bold white, root -- bold red. Everything else is grey:
Right Cwd in grey
What's your terminal color scheme?
It is my own custom made color scheme to match the Arc theme:
https://gist.github.com/anonymous/30b4de257f9c879795d3
http://i.imgur.com/a9NKxP5.png
LPS1:
RPS1:
I use a custom port of Promptastic to Lua.
Screenshot
http://imgur.com/h8sa0eg it's completely dynamic, if i'm in git repo it shows on which branch I am and in which state the commits are. The last one is prompt for root, I've spent a lot of time jumping from one machine to another, so the red hostname is pretty important :)
Okay, I've been trying for that line above my prompt for a bit -- how'd you do it? It looks great! (OR are those tmux splits?)
those are the tmux splits
I really like the look of this. Is there anyway that you could help a noob like me set my terminal up to look like that. I don't need to the tmux stuff.
PS1:
looks like this:
time is magenta, user@host is blue, pwd is green
Edit: I hate this Editor from reddit...
I just use the grml config for zsh. This is what is used on the archiso. I've made a couple of negligible tweaks.
»
I use prezto.
From my
.zshrc:(screenshot)
Basically, on the left it just prints the time and the exit code of the last command, and on the right it prints the current working directory. It also prints special stuff if I'm in a git repo. And everything is colorized.
(It's similar to the gmrl prompt from the archiso.)
I choose not to include my user name or host name because this is for my personal laptop, which I'm the only one who uses, and which I never remotely ssh into.
here's what mine can look like: lunk
Pure. Looks like this.
Here is mine.
export PS1='[\e[1;34m][[\e[m] [\e[1;32m]\u[\e[m][\e[1;34m]@[\e[m][\e[1;37m]\h[\e[m] [\e[1;34m]][\e[m][\e[1;34m][[\e[m] [\e[1;37m]<[\e[m][\e[1;32m]\w[\e[m][\e[1;37m]>[\e[m] [\e[1;34m]][\e[m][\e[1;37m]:[\e[m][\e[1;32m]#[\e[m] '
Edit: This was copy/pasta'd straight from my user .bashrc, not sure why it wouldn't work for anyone else
I got the following output:
That should work.
Prefix your comment with four spaces, the backslashes got eaten.
For all non-root-users:
glysolid@Workstation_404 [~]
For root:
root@Workstation_404 [/etc/kernel/]
Edit: I hate this Editor from reddit...
Deleted before we saved it.
Deleted before we saved it.
Nothing too special:
Looks like this (green for normal user, red for root):
(zsh)