From c07992a45ff3205f2e576a5a8f6ff997d0c4f8c6 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Wed, 14 Nov 2018 19:28:11 -0500 Subject: Fix whitespace calculations on bash with retro prompt. Fix shell detection for retro prompt. remove pkgsrc and vis function as they're unused --- mkshrc | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) (limited to 'mkshrc') diff --git a/mkshrc b/mkshrc index e00f898..5c7ead2 100644 --- a/mkshrc +++ b/mkshrc @@ -94,9 +94,18 @@ set_basic_prompt() { export PS1; } set_retro_prompt() { - export PS1="$(set_my_title)\$ " - if [ `id -u` -eq 0 ] ; then - export PS1="$(set_my_title)# " + if ! [ -z "$BASH" ] ; then + export PS1='\[$(set_my_title)\]\$ ' + elif ! [ -z "$KSH_VERSION" ] ; then + export PS1='$(set_my_title)$ ' + if [ $(id -un) -eq 0 ] ; then + export PS1='$(set_my_title)# ' + fi + else + export PS1='$ ' + if [ $(id -un) -eq 0 ] ; then + export PS1='# ' + fi fi } set_super_basic_prompt() { @@ -177,30 +186,6 @@ debugstarttls() { } -getpkgsrc() { - cd $HOME - pull -f pkg.txz -u "https://www.rygel.us/misc/pkg-$(uname).txz" - tar -xJvf pkg.txz && rm pkg.txz - if ! [ -e $HOME/.mkshrc.pre ] ; then - printf "export PATH=\$HOME/pkg/bin:\$PATH\n" > $HOME/.mkshrc.pre - fi - cd - -} -installvis() { - cd $HOME - pull -u "https://www.rygel.us/misc/vis-$(uname)" -f vis-editor - if [ $(id -u) -eq 0 ] ; then - install -o root -m 555 vis-editor /usr/local/bin/vis-editor && \ - rm vis-editor - else - if ! [ -d $HOME/bin ] ; then - mkdir $HOME/bin - fi - install -m 555 vis-editor $HOME/bin/vis-editor && \ - rm vis-editor - fi - -} set_retro() { set_retro_prompt unalias vi -- cgit v1.2.3