Setting the terminal window title - version 2

I had earlier written a small snippet about setting the window title from command line. Based on my experience, I felt that I could make it a lot simpler. Here is version of the same function.

function wtitle {
    if [ -z "$ORIG_PS1" ] ; then
        ORIG_PS1=$PS1
    fi
    export PS1="\[\033]0;$1 - \u@\h:\w\007\]$ORIG_PS1"
}

Comments

VD said…
This only works in bash :(, any idea how to change title in ksh?

Popular posts from this blog

Note on allocationSize parameter of @SequenceGenerator while using JPA

The mysterious ORA-03111 error

Creating a Collection with a single element