From: Paweł Gołaszewski Date: Mon, 15 Sep 2003 14:00:47 +0000 (+0000) Subject: - added setting of xterm-window title for bash and zsh. TODO: ksh* X-Git-Tag: setup_2_4_4~9 X-Git-Url: http://git.pld-linux.org/?p=projects%2Fsetup.git;a=commitdiff_plain;h=b90e08ad7e936070f5bb525cf144089547169377 - added setting of xterm-window title for bash and zsh. TODO: ksh* Changed files: etc/profile -> 1.29 --- diff --git a/etc/profile b/etc/profile index 5c2ce8e..3575dcc 100644 --- a/etc/profile +++ b/etc/profile @@ -50,7 +50,14 @@ fi case "$SH" in bash) - PS1="[\u@\h \W]\\$ " + case $TERM in + xterm*) + PS1="\[\033]0;\u@\h: \w\007\][\u@\h \W]\\$ " + ;; + *) + PS1="[\u@\h \W]\\$ " + ;; + esac ;; ksh|pdksh) if [ `id -u` -eq 0 ]; then @@ -137,6 +144,9 @@ case "$SH" in bindkey '^[[D' backward-char >/dev/null 2>&1 bindkey '^[[C' forward-char >/dev/null 2>&1 ;; + xterm*) + precmd () { print -Pn "\e]0;%n@%m: %~\a"i; } + ;; esac # other HISTFILE, zsh uses diffrent fmt HISTFILE=~/.historyz