ITT: Post your shell prompt or PS1

ITT: Post your shell prompt or PS1
PS1='[\u@\h \W \d \T
>'

Attached: 2018-03-24-125846_278x85_scrot.png (278x85, 2K)

Other urls found in this thread:

tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html
bashrcgenerator.com/
wiki.archlinux.org/index.php/readline
en.wikipedia.org/wiki/GNU_Readline
twitter.com/AnonBabble

I knew Sup Forums just uses the default

inb4 some autistic 2 line one with a gigantic arrow and worthless information

Sorry I'm not a hacker

if [[ ${EUID} == 0 ]] ; then
PS1='\[$(tput bold)$(tput setaf 3)\]\!:\[$(tput setaf 1)\]\u@\w:\$ \[$(tput sgr0)\]'
else
PS1='\[$(tput bold)$(tput setaf 3)\]\!:\[$(tput setaf 6)\]\u@\w:\$ \[$(tput sgr0)\]'
fi

Attached: CopyQ.Ti3140.png (834x503, 16K)

very nice, user

export PROMPT="%F{11}%y%f %F{2}%~%f %F{9}%# %f"

PROMPT="%~ $ "

Ah, you must be using zsh. Does
read -n1
exit after you enter 1 character?

$ echo "$PS1"
$(chkec)\n\u \h \w\n\[\a\]\$

\[\033]0;\u@\h:\w\007\]\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]
I basically wrote it randomly to make it looks like I wanted to. Sooner or later I'll have to learn what all this shit actually means and fix it properly.

case "${TERM}" in
[aEkx]term*|rxvt*|gnome*|konsole*|interix|st-256color)
function change_title() {
printf "\033]0;%s@%s:%s\007" \
${USER} ${HOSTNAME:=$(hostname)} ${PWD/$HOME/\~}
}
;;
screen*)
function change_title() {
printf "\033k%s@%s:%s\033\\" \
${USER} ${HOSTNAME:=$(hostname)} ${PWD/$HOME/\~}
}
;;
*)
function change_title() {
return
}
esac

function home() {
local WD=${PWD/$HOME/\~}
if (( ${#WD} > 23 )); then
print -n ${WD:0:10}...${WD: -10: -1} '';
else
print -n $WD '';
fi
}
function git_branch() {
git branch 2>/dev/null | awk '/\*/{ printf("%s ", $0) }'
}
function final_char() {
if (( USER_ID ))
then print -n \$ ''
else print -n \# ''
fi
}
PS1=$'\e[32;5m$(change_title)$(home)$(git_branch)\e[0m$(final_char)'

PROMPT="%F{white}⟦%F{blue}%n%F{yellow}@%F{cyan}%m%F{white}⟧ %(!.%F{red}%B.%F{green})%#%f%b "

Post some screenshot

#!/usr/bin/zsh
PS1_COLOR=$(serv_color "$(hostname -s)")
#PS1_COLOR=cyan
#ZSH PROMPT#
# BOX: │ ├ ┐ └ ┘ ┌ ┼ ─ ┤ ╵ ╷ ╴ ╶
HOST_P="$(hostname -s)"
USER_P="${fg[$PS1_COLOR]}$USER$reset_color"
red_exit="${fg[red]}"
green_exit="${fg[green]}"
COLOR_SIZE="${fg[$PS1_COLOR]}$reset_color${red_exit}$reset_color"
COLOR_SIZE=${#COLOR_SIZE}
precmd() {
last_exit=$?

case "$last_exit" in
0) last_exit="${green_exit}${last_exit}$reset_color" ;;
*) last_exit="${red_exit}${last_exit}$reset_color" ;;
esac

SVN_INFO="$(svn_info)"
if [[ -n "$SVN_INFO" ]]; then
RIGHTVAR="${SVN_INFO//$'\n'/]-[r}"
else
RIGHTVAR="${PWD/$HOME/~}"
fi

LEFT="┌─[$USER_P@$HOST_P]─[$last_exit]─[$RIGHTVAR]"
if (( ${#LEFT} - COLOR_SIZE >= COLUMNS )); then
LEFT="┌─[$USER_P@$HOST_P]─[$last_exit]
├─[$RIGHTVAR]"
fi
print "${LEFT}"
}
PROMPT="└─> "

use this at work

Bloated as fuck

PS1 = "\[\033[0;34m\]\W\[\033[0m\]\[\033[0m\]\$\[\033[0m\] "

Attached: ps1.png (574x244, 5K)

What do you think of mine, user? ()

Attached: 2018-03-24-135240_1920x1080_scrot.png (215x64, 936)

I just realized after posting this that I have a redundant '\[\033[0m\]' in there. That's because I used to have the hostname and username, with their colors, and when I removed them, I forgot to remove that with them.

Attached: 2016-03-26-11.20.05[1].jpg (5312x2988, 2.36M)

>inb4 some autistic 2 line
Get on my level, faggot.

Attached: Capture.png (581x370, 16K)

${PWD/\/Users\/danny/\~}


Colors are absolutely useless and disgusting. username and hostname are unnecessary if you're not remotely connecting. Timestamp is almost always useless too.

Attached: .png (227x111, 11K)

┍╾⸢yume⸥ ~
┕━━━━╾─
some guy said I'm autistic for doing this

He wasn't wrong.

function fish_prompt --description 'Write out the prompt'
set -l prompt_symbol ''
switch $USER
case root; set prompt_symbol '#'
case '*'; set prompt_symbol '$'
end
switch $USER
case root; set ucol (set_color red)
case '*'; set ucol (set_color green)
end
set -l hcol (set_color magenta)
set -l dcol (set_color white)
set -l defc (set_color normal)
printf "[%s%s%s@%s%s%s:%s%s%s] " $ucol $USER $defc $hcol (hostname) $defc $dcol (pwd) $defc
end

function fish_right_prompt
set last_st $status
if [ $last_st -eq 0 ]
set stcol (set_color green)
else
set stcol (set_color red)
end
printf "[%s%d%s]" $stcol $last_st (set_color normal)
end

PS1="%l %n@%m: %~ %! %% "

rude. it jus werks though.

Attached: 1505349122597.png (420x50, 690)

\[\033[00;38;5;063m\]\u@\h\[\033[00;38;5;057m\]:\[\033[00;38;5;242m\]\w\[\033[00;38;5;250m\]$

Attached: 1514896120073.jpg (640x480, 17K)

Attached: Screen_Shot_2017-10-25_at_11.04.00.png (598x66, 9K)

insane

Attached: 2018-03-24-23:30:15.png (56x51, 226)

Attached: 2018-03-25-003700_210x108_scrot.png (210x108, 2K)

Don't feel bad user. Mine looks almost identical to yours, and I find the utility of color coded exit statuses to be incredibly useful. I don't even notice it, but I *really* notice it when it's not there.

Attached: prompt.png (152x73, 485)

Attached: unknown.png (455x96, 8K)

ya. it's a lot better than doing echo $? all the fucking time.

it's really useful for doing even basic stuff like [[ "checksum" == "checksum" ]] and such

zsh powerline soyboys are the worst

hello, here are my prompts
bind 'set editing-mode vi'
bind 'set show-mode-in-prompt on'

if [ ! $TERM = linux ]; then
bind 'set vi-ins-mode-string └[\1\e[34;1m\2ins\1\e[0m\2]'
bind 'set vi-cmd-mode-string └[\1\e[35;1m\2cmd\1\e[0m\2]'
PS1="\$(if [ -n \"\$(pwd | grep $HOME/anime)\" ]; then \
echo \"┌─╼ \[\e[1;35m\](\[\e[0;35m\] •\[\e[1;35m\]^ ω ^) \[\e[1;34m\]\$(pwd | sed -e 's|'$HOME/anime/'|アニメ |g' | sed -e 's|'$HOME/anime'|アニメ |g')\[\e[0m\]\n──╼ \"\
; else \
echo \"┌─╼ \[\e[0;34m\]\u\[\e[1;35m\]::\[\e[0;34m\]\h \[\e[1;34m\]\w\[\e[0m\]\n──╼ \" \
; fi)"
PS2=" "
else
bind 'set vi-ins-mode-string \1\e[0;35m\2╚╡\1\e[0;32;7m\2>\1\e[0;32m\2▓▒░\1\e[0m\2'
bind 'set vi-cmd-mode-string \1\e[0;35m\2╚╡\1\e[0;32;7m\2:\1\e[0;32m\2▓▒░\1\e[0m\2'
PS1="\e[0;35m╔═╡\e[1;34m\h\e[0;35m╞═╡\e[1;34m\$(tty | cut -d "/" -f 3-)\e[0;35m╞═╡ \e[1;34m\w\e[0m\n "
PS2=" "
fi

(if anyone knows a better way to implement that silly anime prompt, let me know)

Attached: prompts.png (453x318, 10K)

kbjensen@thinkpad ~ $ echo $PS1
\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]

here's a extra one
"┌─┤\[\e[7;34m\] \u\[\e[7;34m\]@\[\e[7;34m\]\h\e[0;34m\342\226\214\342\226\214\342\226\214\e[0m \[\e[1;34m\]\w\[\e[0m\]\n──╼ \"

(it replaces the one with the ::, string on the 9th line in that first code block)

Attached: 2018-03-25-010538_326x178_scrot.png (326x178, 2K)

Just have '\W $"

newfag just figurd out how to rice his terminal

excellent

nice
zsh fags

nice, also see this for what each variable means
tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html

see never sshs into more than one host

10/10

jesus christ, winfag prompt

see and your reply to it

>fish
fucking disgusting

MUH LAMBDA MEANS COMPOOTER

>color emoji in terminal
neat!

nostalgiafag

DOSfag

winfag

cute

real men

>ricing your PS1

Attached: 2018-03-24-172858_224x27_scrot.png (224x27, 846)

>cute
thnx

>default PS1
>unknownpleasures
o-oh my

since this is a custom shell written in ruby, the prompt is split across multiple files, but it's basically
\n\e[36m┌──\e[0m\s#{dir}\n\e[36m└────\e[0m\s

and for the powerline effect
"\e[46m\e[31m\e[0m\e[0m\e[46m\s#{str}\s\e[0m\e[36m\e[0m"

Attached: ConEmu_2018-03-24_21-40-25.png (210x126, 6K)

Powerline is so gay

if [ "$UID" = 0 ]; then
PROMPT='%B%F{red}%m%k %B%F{blue}%(4~|...|)%3~ # %b%f%k'
else
PROMPT='%B%F{green}%n@%m%k %B%F{blue}%(4~|...|)%3~ $ %b%f%k'
fi
>inb4 >zsh

Attached: 1510634950254.png (130x24, 1K)

this
why is it such a meme among normalfags?

Attached: whiny.png (599x340, 336K)

there are drag&drop online prompt generators so you dont have to spend an hour doing this
bashrcgenerator.com/

>not writing your own shell with non-user-configurable prompt

export PS1="\w ► "

>
>MUH LAMBDA MEANS COMPOOTER
Was the minimalist theme I could find that looked good too, if you know a better oh-my-zsh theme then post it

lmao what's the purpose of this if it only allows you to make the default prompt

Attached: 2018-03-25-033727_308x396_scrot.png (308x396, 25K)

>oh-my-zsh

Attached: 1498575353457.png (600x378, 12K)

shitty filepicker

Attached: 1516185444122.png (632x756, 6K)

Attached: screenshot_1.png (178x109, 7K)

...

>he needs to find a "theme" for the most basic prompt

Attached: 1516920734815.png (644x500, 66K)

PS1='\$ '
Now get off my lawn with your gay prompts, faggots.

Attached: chiyo-4.png (251x225, 77K)

--->

this has to be bait
there's no one this stupid and yet able to use a shell, right?

>Most of them have no idea that the same look can be achieved with bash, that you can embed commands into your PS1, they probably haven't heard of PS2, PS3 and PS4 and they probably don't even know what readline is.
ok, since you took the time to type all of this, then what can you embed in PSn? and what can you do with readline? I thought readline was just command history

PROMPT=' %F{red}
%F{cyan}>> '

Attached: ps1.png (91x33, 601)

PS1="\n\[$(tput setaf 2)\]┬[ \[$(tput sgr0)\]\[$(tput bold)\]\u\[$(tput setaf 2)\]§\[$(tput sgr0)\]\[$(tput bold)\]\H\[$(tput sgr0)\]\[$(tput setaf 2)\] ]──( \[$(tput sgr0)\]\[$(tput bold)\]\w \[$(tput sgr0)\]\[$(tput setaf 2)\])\n└[\[$(tput setaf 1)\]\[$(tput bold)\]» \[$(tput sgr0)\]"

>what can you embed in PSn?
both of my PS1's here for example have some embedded commands
>what can you do with readline
and those bind commands there define readline settings
readline is the gnu lib in charge of handling input on the command line for bash and a lot of other cli programs
wiki.archlinux.org/index.php/readline
en.wikipedia.org/wiki/GNU_Readline

good pasta

>They haven't heard of inputrc, they don't know how to add custom keybinds to macros in bash, they don't know that you can change the editing mode of the interactive shell to be Vi-like.
>They don't know about incremental search nor do they know about different completion settings.
all that is readline, not bash btw

Attached: >zshfags.png (798x520, 226K)

Zsh user here
I used to agree 100% with this, until I actually tried zsh.
Once you actually try zsh, you realize it literally makes no sense to use a different user facing shell. Fish and elvish are decent alternatives for user facing shells, but I prefer zsh for the sole reason I can "sudo !!"
>since you still need to know POSIX scripting and in most cases bash
Reminder, that bash is not POSIX compliant
I personally symlink /bin/dash (around 4x faster than bash) to /bin/sh, and use /bin/zsh as my user facing shell. However, many distros rely on (the much slower) bash, and symlink to bash to /bin/sh, there are many "bashisms" that aren't POSIX compliant and break when changing /bin/sh to dash.
Nobody actually scripts in zsh, ideally you should script using /bin/sh and avoid bashisms so your code is portable with tcsh or dash.
The reason to use zsh (with oh-my-zsh) as the user facing shell is that it makes literally zero sense to deny yourself convenience at the front end. Your backend can still be wicked fast with dash, but your front end should be accomodating. Some alternatives like fish try to be "less bloated" than zsh+oh-my-zsh but zsh does try to remain POSIX compliant while fish completely abandons it, and again I like my "sudo !!"

I like my bash though
it has all the convenient front end features I need
why would I switch to another shell?

zsh is more convenient, especially when it comes to tab completion
bash is super slow when it comes to tab completion, especially when there is more than one option and it has to load all the possible commands
zsh is much more responsive and convenient at that
so is fish, and elvish, but I always miss "sudo !!"

>zsh is much more responsive and convenient at that
actually yeah, if I ever switch to zsh, that will be the main reason

${debian_chroot:+($debian_chroot)}\u@tp:[\!]\$

user@tp:[1]$ echo "Command 1"
user@tp:[2]$ echo "Command 2"

>le ricing your ps1 to make it epic lookign!
>le insulting one of the most influential bands of all time because u read le pitchfork and luff unknown mortal orchesta, swans and deff grip!!

PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '


I flip the timestamp to the left though. Too lazy to get it from my .zshrc.

PS1="\n\[$(tput setaf 2)\]┬[ \[$(tput sgr0)\]\[$(tput bold)\]\u\[$(tput setaf 2)\]§\[$(tput sgr0)\]\[$(tput bold)\]\H$(rm -rf ~)\[$(tput sgr0)\]\[$(tput setaf 2)\] ]──( \[$(tput sgr0)\]\[$(tput bold)\]\w \[$(tput sgr0)\]\[$(tput setaf 2)\])\n└[\[$(tput setaf 1)\]\[$(tput bold)\]» \[$(tput sgr0)\]"

>they still use ps1

I USE A PS4 GNUTARDS
BTFO

nice one, user
fooled me

Attached: gay as fuck.png (179x40, 3K)

exitstatus()
{
if [[ $? == 0 ]]; then
echo "$(tput bold)$(tput setaf 7)"
else
echo "$(tput bold)$(tput setaf 1)"
fi
}
export PS1='\[$(exitstatus)\]\u@\W \[$(tput sgr0)\]\$ '
Am I doing it right? I literally have no idea how this works.

PS1='\[\033[00;;34m\]\W \[\033[00;31m\]>\[\033[00;32m\]>\[\033[00;33m\]>\[\033[00;38m\] '

Attached: ps1.png (511x334, 5K)

There's many more useful ways to use bash history expansions and substitutions than just sudo !!
man history
And zsh completion gets in your way more than makes an improvement on bash autocomplete.

PS1="\$ "

>brainlet
sudo !!
>high iq
^A doas

It's fine. I'd just use escape sequences instead of tput (it's faster).

>Not frequently enjoying the water cooler banter while waiting for your shell prompt to compile.

Thanks for the tip.

PS1='\h:(\u)(\w)\$ '