Jeff Mincy wrote:
Just a W/A thought: bash, and maybe other shells, provide PS1,
PS2, etc codes
for "passing" various parameters to the "terminal" via escape
sequences.
Specifically, there are escapes that let me put the "\w" directory code
into the window title bar.
Could not the terminal emulator be programmed to respond to the escape sequences
by setting some variable and/or running a hook?
--
David A. Cobb, Software Engineer, Public Access Advocate.
Just to make sure that I understand, are you suggesting doing
something like this:
In bash, do
export PS1="[cd=\\w]\\s%"
Which causes the prompt to be something like:
[cd=/home/jeff/.xemacs]bash%
And then making comint strip off the [cd=...] stuff to track the
current directory, which, I think could be done by using a
comint-output-filter-function.
I had assumed that he was referring to using the xterm escape
sequence ("ESC]0;<title>BEL"), e.g.
export PS1=$(echo -e '\033]0;\\w\007[\\u@\\h \\W]\\$ ')
Ok, this might not be the most wacky idea I've heard all day...
It's the only way that directory tracking will survive stuff like:
$ ftp
foo.com
ftp> cd /pub/foo
ftp> quit
$
--
Glynn Clements <glynn.clements(a)virgin.net>