浏览代码

add tty display in prompt

pull/1/head
10sr 12 年前
父节点
当前提交
c07a646e9b
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      bashrc

+ 2
- 1
bashrc 查看文件

@@ -317,9 +317,10 @@ __my_prompt_function(){ # used by PS1
# local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s])
test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]"
local ip=$(ip-address [Addr:%s])
local tty=$(__try_exec tty | sed -e 's:/dev/::')
# local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow
printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}${ip}\n"
printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n"
printf "${c2}${USER}@${HOSTNAME}${cdef} ${tty} ${date} ${BASH} ${BASH_VERSION}\n"
printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} "
}



正在加载...
取消
保存