What is your $PS1?
What is your $PS1?
Other urls found in this thread:
github.com
twitter.com
Is best
My PS1
...
OP@GAY
lole
op@lovescocks
Just play them on the PS2
This makes me uncomfortable.
/$/$/$
git info after the directory
>%
why would I want to know my own username, if I want to know what directory i'm in, i'll change into that directory
...
...
%F{135}%n%f@%F{166}%m%f %F{118}%~%f %f[%F{118}%D{%L:%M:%S %p}%f] $
user@natsume
`[$?] $PWD $` in bold white
ditto.
user@hostname:path $ in default color
anything else is gay
function fechoc
set_color $argv[1] $argv[2]
echo -n "$argv[3]"
end
function ptstyle
fechoc -o $argv
end
function fish_prompt
ptstyle 80f "["
ptstyle caf (date +%H%M)
ptstyle 80f ":"
ptstyle 0fa "$USER"
ptstyle cc0 "@"
ptstyle ff0 (hostname)
ptstyle 80f (pwd)"]> "
set_color normal
end
It's a necessity if you're ssh'd into several servers at once.
>t. BSDrone
User@hostname current-directory-short >
If you're switching between accounts or sshing into things on the fly it can be pretty helpful.
The above and the current directory is cool when you are switching between a bunch of terminals as well.
user@hostname$
with the current directory as the window title
PS1="\W % "
...
>t someone who does not work with computers or do software development on any serious level
here's your (you)
...
...
user@host < branch > : directroy
[return code] %
OS X's tcsh default, but with mksh
[host:directory] user%
extracting the juicy bits from my zsh prompt_setup:
[[ $UID -eq 0 ]] && {
PROMPT='%S%F{7}%B%K{0} %n%K{4}@%K{0}%m %s%K{1}%F{3}%B %~${vcs_info_msg_0_} %b%f%k %# '
} || {
PROMPT='%K{5}%B%F{7} %n%F{6}@%F{7}%m %K{4}%F{3}%B %~${vcs_info_msg_0_} %b%f%k %# '
}
RPROMPT='%B%(?..%F{1}!%? )%F{0}%D{%Y-%m-%d %H:%M:%S}%b%f'
(in operation)
Why would anyone want to keep seeing their username and hostname?
So you know which machine you're logged into and which user you're logged in as
nice rick and morty reference
it's actually not, my name is rick
your name is rick and morty reference
>4 year olds posting on Sup Forums
sure
daisy
cause I like daisy chaining
>daisy chaining
Keep it simple stupid
export PS1='[\u@\h \W]\$ '
or
export PS1='\u@\h:\w\n\$ '
Anything else is homosexual. Add a couple colours if you want but that's it.
And I typed those from memory because that's what I type in if I ssh into someone's machine or switch to someone's user account and they have a stupid .bashrc file full of bullshit.
>that curve
How did you make that?
bitchassnigga@butthoekumpyootah
to every hackerman larper with a multiline PS1: mcfucking kill yourselves.
>How did you make that?
They are special characters, have a look here
github.com
thats not simple, what the heck
It's just the regular old prompt with the git branch name added. No overcomplicated calls to origin or fancy logic, just a `git status` and if it comes back dirty go red.
yeah, it is simple in terms of logic, but it looks massive.
whatever, mang, good for you
I didn't know how to include the git bit cleanly but it saves me typing git status about 10 or 20x a day so it stays.
Eventually I just gave up and shoved in in there.
I was merely pretending
[iowa@bb61]: ~>$ echo $PS1
\[\033[38;5;12m\][\[\]\[\033[38;5;10m\]\u\[\]\[\033[38;5;12m\]@\[\]\[\033[38;5;7m\]\h\[\]\[\033[38;5;12m\]]\[\]\[\033[38;5;15m\]: \[\]\[\033[38;5;7m\]\w\[\]\[\033[38;5;12m\]>\[\]\[\033[38;5;10m\]\$\[\]\[\033[38;5;15m\] \[\]
ftfy
'\[\033[38;5;12m\][\[\033[38;5;10m\]\u\[\033[38;5;12m\]@\[\033[38;5;7m\]\h\[\033[38;5;12m\]]\[\033[38;5;15m\]:\[\033[38;5;7m\]\w\[\033[38;5;12m\]$\e[0m '
the \[\] don't do anything
PS1='\$ '
Get off my lawn with your bloat-prompts.
[knon@Kos: ~ ] echo $PS1
\[\e]0;\u@\h: \w\a\]\[\e[32m\][\[\e[m\]\[\e[37m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[37m\]\h\[\e[m\]: \[\e[31m\]\w\[\e[m\]\[\e[37m\] \[\e[m\]\[\e[32m\]]\[\e[m\]
The fat one with av output
$p$g
this is the correct answer right here
(although I would prefer % to $)
>(although I would prefer % to $)
That would make perfect sense if you use csh instead of sh. Otherwise you're wrong.
20:09:17 user@host[~] #
I don't have a PS1
I do have this though
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
RIGHTVAR="${PWD/$HOME/~}"
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="└─> "
How do you include git branches like that?
what shell are you using?
if it's zsh you can pretty much do whatever in precmd(). at work I have it give me info about the svn repo I'm in, but don't bother with git info in my normal prompt at home because it can be subtly taxing to run a binary per command.
PS1='${HOSTNAME}:\(${USER}\)\(${PWD}\)$ '
Before you ask - it's Korn Shell.
case "${TERM}" in
[aEkx]term* | st*)
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)'