diff options
author | LAN-TW <lantw44@gmail.com> | 2013-02-15 01:47:31 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2013-02-15 01:47:31 +0800 |
commit | 1a2255b3dea653eeb6a58bad7ebe82e11ec929a9 (patch) | |
tree | 9fa393c7ef4f599020b9e62664784d6f5b445e03 /bash_include | |
parent | 5a77cd1ceefbccb2b96a2d5fbe515d7a51e288bd (diff) | |
download | configfile-1a2255b3dea653eeb6a58bad7ebe82e11ec929a9.tar.gz configfile-1a2255b3dea653eeb6a58bad7ebe82e11ec929a9.tar.zst configfile-1a2255b3dea653eeb6a58bad7ebe82e11ec929a9.zip |
bash_include: 加入 tmux 與 256 色支援bash_include-20130215
Diffstat (limited to 'bash_include')
-rw-r--r-- | bash_include | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bash_include b/bash_include index ae82ca7..a02fa5f 100644 --- a/bash_include +++ b/bash_include @@ -43,6 +43,12 @@ then nocolorprompting="$nocolorprompting<$WINDOW>" fi +if [ "$TMUX_PANE" ] +then + colorprompting="$colorprompting$TMUX_PANE" + nocolorprompting="$nocolorprompting$TMUX_PANE" +fi + colorprompting="${colorprompting}\\$ " nocolorprompting="${nocolorprompting}\\$ " @@ -1081,7 +1087,7 @@ function get_memory_info () function set_console_title () { case "$TERM" in - screen) + screen*) printf "\033]0;" echo -n "$*" printf "\033\\" @@ -1319,11 +1325,13 @@ then xterm*) PROMPT_COMMAND='printf "\033]0;%s@%s:%s (%s)\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" "`date "+%H:%M:%S"`"' ;; - screen) + screen*) PROMPT_COMMAND='printf "\033]0;%s@%s:%s (%s)\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" "`date "+%H:%M:%S"`"' ;; esac fi + [ "$TERM" = xterm ] && TERM=xterm-256color + [ "$TERM" = screen ] && TERM=screen-256color fi if [ "`uname`" = "Linux" ] |