set terminal title with vt code

Some commands set the terminal’s title to PWD or current filename being mangled, etc… but how do they magic it up?

They are terminal magicians!

Here is an incantation you (and your mom) can try:

set_title() {
    echo -e "33]0;" ${*} "07"
}

set_title 2 cool + 2 be = 4gotten

It’s better than winning the lottery on your birthday!

Note, that should be BACKSLASH-033 and BACKSLASH-007… the backslash seems to confuse the pretag… sometimes… junk…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: