2

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?

2
  • See stackoverflow.com/questions/3508387/… Commented Apr 1, 2013 at 14:00
  • 1
    @UlrichDangel That doesn't work for me. I get an error msg like error in process filter: Not a Tramp file name Commented Apr 1, 2013 at 14:53

1 Answer 1

3

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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.