Function: shell-dirtrack-mode
shell-dirtrack-mode is an interactive and byte-compiled function
defined in shell.el.gz.
Signature
(shell-dirtrack-mode &optional ARG)
Documentation
Toggle directory tracking in this shell buffer (Shell Dirtrack mode).
This is a minor mode. If called interactively, toggle the
Shell-Dirtrack mode mode. If the prefix argument is positive,
enable the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the
mode if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate shell-dirtrack-mode(var)/shell-dirtrack-mode(fun).
The mode's hook is called both when the mode is enabled and when it is disabled.
The dirtrack package provides an alternative implementation of
this feature; see the function dirtrack-mode(var)/dirtrack-mode(fun).
Probably introduced at or before Emacs version 22.2.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/shell.el.gz
(define-minor-mode shell-dirtrack-mode
"Toggle directory tracking in this shell buffer (Shell Dirtrack mode).
The `dirtrack' package provides an alternative implementation of
this feature; see the function `dirtrack-mode'."
:lighter nil
(setq list-buffers-directory (if shell-dirtrack-mode default-directory))
(if shell-dirtrack-mode
(add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t)
(remove-hook 'comint-input-filter-functions #'shell-directory-tracker t)))