From c07a646e9b5706404226d8f4b017c5d2da094dec Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 13 Mar 2012 00:16:59 +0900 Subject: [PATCH] add tty display in prompt --- bashrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 721509d..4547478 100755 --- a/bashrc +++ b/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} " }