Browse Source

Show prompt dollars accordiong to SHLVL

pull/1/head
10sr 10 years ago
parent
commit
3b1cdbce9d
2 changed files with 13 additions and 3 deletions
  1. +12
    -3
      shrc
  2. +1
    -0
      tmux.conf

+ 12
- 3
shrc View File

@@ -637,7 +637,7 @@ memo(){
else
_memo="$1/memo.txt"
fi
$EDITOR "$_memo"
$EDITOR "$_memo"
if test -z "`cat "$_memo"`"
then
echo "$_memo is empty. Removing."
@@ -1193,6 +1193,15 @@ __my_ps1_jobs(){
fi
}

__my_ps1_dollar(){
if test -z "$SHLVL"
then
printf "$1"
else
perl -e 'while($ARGV[0]-- > 0){print "$ARGV[1]";}' $SHLVL "$1"
fi
}

__my_alert_fail(){
test $laststatus -eq 0 || \
echo "STATUS:${laststatus}"
@@ -1322,13 +1331,13 @@ if $inzsh
then
PROMPT="\
${__my_ps1_beg}[${__my_c2}%n@%M${__my_cdef}:${__my_c1}%~/${__my_cdef}]\$(__my_ps1_info1)
${__my_ps1_beg}\$(__my_ps1_info2) %# "
${__my_ps1_beg}\$(__my_ps1_info2) $(__my_ps1_dollar %#) "
RPROMPT="%D{%Y/%m/%d %H:%M}"
elif $inbash
then
PS1="\
${__my_ps1_beg}[${__my_c2}\u@\H${__my_cdef}:${__my_c1}\w/${__my_cdef}]\$(__my_ps1_info1)\n\
${__my_ps1_beg}\D{%Y/%m/%d %H:%M} \$(__my_ps1_info2)${__my_ps1_right} \$ "
${__my_ps1_beg}\D{%Y/%m/%d %H:%M} \$(__my_ps1_info2)${__my_ps1_right} $(__my_ps1_dollar \\$) "
else
true
# PS1="$(printf $(whoami)@$(hostname)$ )"


+ 1
- 0
tmux.conf View File

@@ -21,6 +21,7 @@ setw -g mode-mouse off
#set -g default-command /bin/bash

#set -g default-path "$HOME"
set-environment -u SHLVL

# try to set title of terminal tmux is running on
# set -g set-titles off


Loading…
Cancel
Save