From: "David A. Cobb" <superbiskit(a)home.com>
Date: Mon, 31 Dec 2001 16:19:37 -0500
Jeff Mincy wrote:
From: "Craig Amey" <camey(a)reshape.com>
Date: Wed, 12 Dec 2001 10:35:32 -0800
This doesn't seem to work in Xemacs, except for the trivial case of typing
cd pathname at the prompt. shellt.el, the fix for GNU Emacs doesn't seem to
work (this works by appending an ; echo 'pwd' to the input stream). Just
about anything I've tried confuses or fails to resync the tracking ... such
as
cd $ENV_DIR
This works if xemacs knows the value of $ENV_DIR (cd $HOME works)
cd dir # where dir is in cdpath
cd 'pwd'
You can advise shell-process-cd, for example, here, I advise the
function to strip off string quotes (this is needed for
cd "/Program Files/foobar")
(defadvice shell-process-cd (before strip-quotes first activate)
"jwm: Strip quotes from filename"
(if (and (> (length arg) 2)
(eql (aref arg 0) ?\")
(eql (aref arg (1- (length arg))) ?\"))
(setq arg (subseq arg 1 (- (length arg) 1)))))
You could advise shel-process-cd and shell-process-pushd to handle
cdpath and ` quotes.
-jeff
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.
Ok, this might not be the most wacky idea I've heard all day...
-jeff