From e4070d5ef90c6ecb0f1f1145d53188b0202e636c Mon Sep 17 00:00:00 2001 From: Callum Renwick Date: Fri, 7 Oct 2022 14:39:42 +0100 Subject: [PATCH] Fix path in prompt --- mkshrc | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/mkshrc b/mkshrc index accd59b..dddea5a 100644 --- a/mkshrc +++ b/mkshrc @@ -8,22 +8,19 @@ alias gcc="gcc -Wall" bind ^L=clear-screen # 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! -# TODO +export text_black='' +export text_red='' +export text_green='' +export text_brown='' +export text_blue='' +export text_purple='' +export text_cyan='' +export text_white='' +export end_format='' -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="hi" +PS1="${text_brown}${USER:=$(id -un)}@${HOSTNAME:=$(hostname)}${end_format} \${PWD/\/home\/cren/\~} % "