瀏覽代碼

Show prompt dollars accordiong to SHLVL

pull/1/head
10sr 10 年之前
父節點
當前提交
3b1cdbce9d
共有 2 個檔案被更改,包括 13 行新增3 行删除
  1. +12
    -3
      shrc
  2. +1
    -0
      tmux.conf

+ 12
- 3
shrc 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存