Shortened hostname and username
This commit is contained in:
parent
dd9b1d0ded
commit
f6c84d3a86
10
bashrc
10
bashrc
@ -228,16 +228,20 @@ if [ "$BASH" ]; then
|
||||
}
|
||||
prompt(){
|
||||
a=`parse_git_branch`
|
||||
hn=`hostname`
|
||||
hn=${hn:0:3}
|
||||
who=`whoami`
|
||||
who=${who:0:3}
|
||||
if [ -z $a ] ; then
|
||||
printf "[$txtgrn%s$txtrst][$txtred%s$txtrst]➢" $(whoami) "$PWD"
|
||||
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}>" $who $hn "$PWD"
|
||||
else
|
||||
printf "[$txtgrn%s$txtrst][$txtred%s$txtrst][$txtblu%s$txtrst]➢" $(whoami) "$PWD" $(parse_git_branch)
|
||||
printf "{$txtgrn%s@%s$txtrst}{$txtred%s$txtrst}{$txtblu%s$txtrst}>" $who $hn "$PWD" $(parse_git_branch)
|
||||
fi
|
||||
}
|
||||
PS1=""
|
||||
PROMPT_COMMAND='PS1=`prompt`'
|
||||
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history'
|
||||
#PROMPT_COMMAND='PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'
|
||||
#PROMPT_COMMAND='PS1="\(\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'
|
||||
|
||||
export HISTFILESIZE=
|
||||
export HISTSIZE=
|
||||
|
Loading…
x
Reference in New Issue
Block a user