开发者

Command as window's name in Ubuntu's ZSH

How can you convert the following command for Ubuntu's ZSH?

DavidPashley's command for Bash

开发者_Go百科
trap 'echo -e "\e]0;$BASH_COMMAND\007"' DEBUG
if [ "$SHELL" = '/bin/bash' ]
then
    case $TERM in
         rxvt|*term)
            set -o functrace
            trap 'echo -ne "\e]0;$BASH_COMMAND\007"' DEBUG
            export PS1="\e]0;$TERM\007$PS1"
         ;;
    esac
fi


I have this in my ~/.zshrc

case $TERM in
    *xterm*|rxvt|(dt|k|E)term)
        precmd () {
            print -Pn "\033]0;%n@%m : %~\007"
        }
        preexec () {
            print -Pn "\033]0;%n@%m : <$1>\007"
        }
        ;;
esac
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜