This is a bit of a followup to this question. I'm working in tcsh within GNU screen in an xterm.
I have the following in my .cshrc:
alias res_t 'xtset -t %h:%d "(%u:%g)" %e' # reset titlebar
res_t # reset title right now
alias precmd res_t
And this works fine!
However, when I run screen I see that the title doesn't get updated with the current directory. How can I make screen update the xterm title?
Best Answer
You can set the xterm window title by adding this to your
.tcshrc
or.cshrc
(replace your currentprecmd
alias):Make sure this is the only precmd alias in your
.cshrc
and.tcshrc
files when using this. This method displays the current directory as the window title for me in both xterm a gnome-terminal regardless of whether a GNU screen session is open.My answer was based on this.