title: How we can automatically change the terminal title as current directory name?
body: <p>How we can automatically change the terminal title as current directory name.
  I have below command in my cshrc file</p>
  
  <pre><code>alias precmd 'echo -n "\033]0;${PWD}\a"'
  </code></pre>
  
  <p>But it is displaying the full path instead of current directory path.
  So I wants to update the title with current directory.</p>
  
  <p>Also please Let me know if we can display the title with current directory plus its parent directory name?</p>
  
  <p>for example if the full directory path is <strong><em>/user/shibin/code/cpp/</em></strong>
  I need to change the terminal name as either <strong><em>/cpp</em></strong> or <strong><em>/code/cpp</em></strong></p>
  
  <p>Thank You</p>