Domanda

Come puoi convertire il seguente comando per Ubuntu ZSH?

DavidPashley comando di Bash

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
È stato utile?

Soluzione

Ho questo nel mio ~ / .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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top