When I run shell-resync-dirs 1, the function hangs, until I press C-g, at which this point, what looks suspiciously like the output of my shell's dirs -l command 2 gets inserted into my buffer at point, and my shell prints a newline and a new prompt. (Point remains unchanged throughout all this.) As far as I can tell, the shell-resync-dirs never gets to do what it is supposed to do, since shell-dirstack remains unchanged (and as out-of-sync as it was when I invoked the function).
I would like to find out why shell-resync-dirs hangs when I invoke it.
In particular, I would like to trace the execution of shell-resync-dirs.
Naively, I tried using trace-function, but this did not have the desired effect. All I get from this is that Emacs will notify me when shell-resync-dirs starts execution and when it terminates, which tells me nothing that I don't already know.
Is there a simple way to trace the evaluation of the various expressions within the definition of shell-resync-dirs?
1 For this post, please assume that the current buffer is an inferior shell started with M-x shell. Also, my shell is /bin/zsh.
2 For what it's worth, "dirs -l" is the value I have assigned to the variable shell-dirstack-query.