Fix path in prompt
This commit is contained in:
parent
abfcee1473
commit
e4070d5ef9
29
mkshrc
29
mkshrc
|
@ -8,22 +8,19 @@ alias gcc="gcc -Wall"
|
||||||
bind ^L=clear-screen
|
bind ^L=clear-screen
|
||||||
|
|
||||||
# Prompt
|
# Prompt
|
||||||
# Prompt functions
|
|
||||||
get_username() {
|
|
||||||
print $(id -un)
|
|
||||||
}
|
|
||||||
|
|
||||||
get_hostname() {
|
|
||||||
print $(hostname)
|
|
||||||
}
|
|
||||||
|
|
||||||
get_cwd() {
|
|
||||||
# substitute $HOME string in $PWD with ~
|
|
||||||
# (so for example /home/cren/config becomes ~/config)
|
|
||||||
print ${PWD/$HOME/~}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prompt colour strings. To save typing them out every time I want to use them!
|
# Prompt colour strings. To save typing them out every time I want to use them!
|
||||||
# TODO
|
export text_black='[30m'
|
||||||
|
export text_red='[31m'
|
||||||
|
export text_green='[32m'
|
||||||
|
export text_brown='[33m'
|
||||||
|
export text_blue='[34m'
|
||||||
|
export text_purple='[35m'
|
||||||
|
export text_cyan='[36m'
|
||||||
|
export text_white='[37m'
|
||||||
|
export end_format='[0m'
|
||||||
|
|
||||||
PS1='$(get_username)@$(get_hostname) $(get_cwd) % '
|
# PS1="${text_brown}$(get_username)@$(get_hostname)${end_format} $(get_cwd) % "
|
||||||
|
# PS1="^[31m${USER:=$(id -un)}""@${HOSTNAME:=$(hostname)} "\$PWD" % "
|
||||||
|
# PS1="[31mhi[0m"
|
||||||
|
PS1="${text_brown}${USER:=$(id -un)}@${HOSTNAME:=$(hostname)}${end_format} \${PWD/\/home\/cren/\~} % "
|
||||||
|
|
Loading…
Reference in New Issue