move setting PS1 below the functions it uses
This commit is contained in:
parent
5fc59c5db8
commit
2ce98e447b
17
bash_aliases
17
bash_aliases
@ -31,14 +31,6 @@ function ps-color() {
|
|||||||
echo "\[\033[${codes}m\]"
|
echo "\[\033[${codes}m\]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "${USER}" == "root" ]]; then
|
|
||||||
PS1="$(ps-color bold red)\u@\H$(ps-color bold green) [\w]$(ps-color bold magenta) \d \t $(ps-color bold blue)(\j)\n\$ $(ps-color reset)"
|
|
||||||
else
|
|
||||||
PS1="$(ps-color bold green)\u@\H$(ps-color bold red) [\w]$(ps-color bold magenta) \d \t $(ps-color bold blue)(\j)$(ps-color bold yellow)\$(prompt_ps1_git_branch)\$(prompt_ps1_svn_branch)$(ps-color bold blue)\n\$ $(ps-color reset)"
|
|
||||||
fi
|
|
||||||
# alternate PS1:
|
|
||||||
# PS1='[\[\033[31;1m\]\u@\H\[\033[34;1m\] \w\[\033[0m\]]\$ \[\033[0m\]'
|
|
||||||
|
|
||||||
function prompt_ps1_git_branch()
|
function prompt_ps1_git_branch()
|
||||||
{
|
{
|
||||||
local git_branch_out
|
local git_branch_out
|
||||||
@ -77,6 +69,15 @@ function prompt_ps1_svn_branch()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set PS1 to use the above functions
|
||||||
|
if [[ "${USER}" == "root" ]]; then
|
||||||
|
PS1="$(ps-color bold red)\u@\H$(ps-color bold green) [\w]$(ps-color bold magenta) \d \t $(ps-color bold blue)(\j)\n\$ $(ps-color reset)"
|
||||||
|
else
|
||||||
|
PS1="$(ps-color bold green)\u@\H$(ps-color bold red) [\w]$(ps-color bold magenta) \d \t $(ps-color bold blue)(\j)$(ps-color bold yellow)\$(prompt_ps1_git_branch)\$(prompt_ps1_svn_branch)$(ps-color bold blue)\n\$ $(ps-color reset)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset -f ps-color
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# PROMPT_COMMAND
|
# PROMPT_COMMAND
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user