Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

From the emacs manual

Unlike Shell mode, Term mode does not track the current directory by examining your input. But some shells can tell Term what the current directory is. This is done automatically by bash version 1.15 and later.

It seems this is not done by zsh, at least not by default. Is there an option that I can enable or something?

share|improve this question
    
    
@UlrichDangel That doesn't work for me. I get an error msg like error in process filter: Not a Tramp file name –  ABP Apr 1 '13 at 14:53

1 Answer 1

After grepping around the bash source, I found this:

static void
send_pwd_to_eterm ()
{
  char *pwd;

  pwd = get_string_value ("PWD");
  if (pwd == 0)
    pwd = get_working_directory ("eterm");
  fprintf (stderr, "\032/%s\n", pwd);
}

That's a bit different then what is documented currently in term.el. It seems all I need to put in my .zshrc to get this to work is the following:

if [ -n "$INSIDE_EMACS" ]; then
    chpwd() {
        print -P "\032/$(pwd)"
    }
fi
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.