comparison rc/bashrc @ 683:71254a6ddb4c

[bash] Also detect (new?) tmux term
author nanaya <me@nanaya.pro>
date Tue, 09 Aug 2022 04:16:52 +0900
parents 35c26d9dcaa7
children 7dda86be7a60
comparison
equal deleted inserted replaced
682:88888f40c628 683:71254a6ddb4c
240 fi 240 fi
241 done 241 done
242 242
243 PS1='\u@\h:\w\$ ' 243 PS1='\u@\h:\w\$ '
244 case "${TERM}" in 244 case "${TERM}" in
245 xterm*|screen*|dtterm*) 245 xterm*|screen*|dtterm*|tmux*)
246 PROMPT_COMMAND='echo -ne "\033]0;'"${USER:-${LOGNAME:-$USERNAME}}@$(uname -n)"': ${PWD}\007";'"${PROMPT_COMMAND}" 246 PROMPT_COMMAND='echo -ne "\033]0;'"${USER:-${LOGNAME:-$USERNAME}}@$(uname -n)"': ${PWD}\007";'"${PROMPT_COMMAND}"
247 if [ "$(id -u)" = "0" ]; then 247 if [ "$(id -u)" = "0" ]; then
248 PS1='\[\e[1;31m\]\u@\h:\w\$\[\e[0m\] ' 248 PS1='\[\e[1;31m\]\u@\h:\w\$\[\e[0m\] '
249 elif [ "$(uname)" != "DragonFly" ]; then 249 elif [ "$(uname)" != "DragonFly" ]; then
250 # DragonFly's Bash is a bit buggy. 250 # DragonFly's Bash is a bit buggy.