change the terminal title dynamically in X11

I was actually looking for this for quite sometime. Some years back in my bashrc was the proper setting for setting the terminal title when I did a cd, and I had completely forgotten how to do it. So today I searched quite a few commands the environment variables for doing the same and found it again.

Here it is (Just put this in your bashrc or bash_profile):

export PROMPT_COMMAND=\’echo -ne \”\\033]0;`pwd`\”; echo -ne \”\\007\”\’

[Edit] I just tried this with eterm and gnome-terminal and it works on both.

About Amit Agarwal

1 Comment on “change the terminal title dynamically in X11”

  1. Ileana Juenemann

    Nice post! You truly have a wonderful way of writing which I find captivating! I will definitely be bookmarking you and returning to your blog. In fact, your post reminded me about a strange thing that happened to me the other day. I’ll tell you about that later…