base-files: provide more tolerant xterm detection
authorPaul Wassi <p.wassi@gmx.at>
Thu, 23 Aug 2018 07:24:43 +0000 (09:24 +0200)
committerJohn Crispin <john@phrozen.org>
Wed, 29 Aug 2018 06:33:54 +0000 (08:33 +0200)
Set the window title not only in "xterm", but also in
e.g. "xterm-256color", "xterm-color", etc.
The case statement is taken from Debian / Ubuntu.

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
package/base-files/files/etc/profile

index e9936fb36a9a937381c2bf3405a50bc9ec39cf02..9a3ac069a20ecbff36c704c11013a639cfef705d 100644 (file)
@@ -14,7 +14,11 @@ export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
 export HOME=${HOME:-/root}
 export PS1='\u@\h:\w\$ '
 
-[ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
+case "$TERM" in
+       xterm*|rxvt*)
+               export PS1='\[\e]0;\u@\h: \w\a\]'$PS1
+               ;;
+esac
 
 [ -x /bin/more ] || alias more=less
 [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi