some tcsh questions
I've (after many years of use..) been looking up what my shell actually can do for me to make my life easier. I've been going thru the features of tcsh (first shell I ever used, but I'm determined to go thru bash and zsh or ksh (when time permits that is..)).
So, of course, I got some questions for you all.. ;-) When I was reading the
tcsh man-page I found some interesting examples on how to set the xterm title.
<cut>
postcmd Runs before each command gets executed.
> alias postcmd 'echo -n "^[]2\;\!#^G"'
then executing vi foo.c will put the command
string in the xterm title bar.
</cut>
This is something I've been looking for a long time, being able to print the
current process in the xterm-title (be it "top" or "joe" or whatever). Not that this example works of course ;).. But why? Is it depending on the window-manager?
I've read the xterm-title mini-howto and it simply says it's "hard" to do it
in any other shell than zsh (the author welcomes any suggestions).
Just for your info, I can't seem to get these other xterm-titles using
cwdcmd to work either. I'm not so good that I understand what ^[]2; and ^G
does.
<cut>
cwdcmd Runs after every change of working directory. For
example, if the user is working on an X window
system using xterm(1) and a re-parenting window
manager that supports title bars such as twm(1)
and does
> alias cwdcmd 'echo -n "^[]2;${HOST}:$cwd
^G"'
then the shell will change the title of the
running xterm(1) to be the name of the host, a
colon, and the full current working directory. A
fancier way to do that is
> alias cwdcmd 'echo -n
"^[]2;${HOST}:$cwd^G^[]1;${HOST}^G"'
This will put the hostname and working directory
on the title bar but only the hostname in the icon
manager menu.
Note that putting a cd, pushd or popd in cwdcmd
may cause an infinite loop. It is the author's
opinion that anyone doing so will get what they
deserve.
</cut>
I've experimented with the methods described in the the xterm-title mini
howto succesfully. But this thing one eluding me..
Of course, if you got any solutions or suggestions for bash or other shells
feel free to share them.. ;)
While I'm at it, I'll get another tcsh issue of my chest. Is there any possibility to get TAB to do the the tcsh list-glob function (lists global patterns) aswell as the commands-, dir-, var-, env-completion that it does by default?
Thanks!
Reply to: