Variable: ghostel--imenu-cwds
ghostel--imenu-cwds is a buffer-local variable defined in
ghostel-shell.el.
Documentation
Chronological list of cwds for prompts that have had OSC 133 'C' fire.
Pushed at command-start time, so newest-first. Aligned by order to
the ghostel-prompt regions in the buffer when the index is built.
Source Code
;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-shell.el
;;; OSC 133 imenu integration
;; Each OSC 133 prompt becomes an imenu entry. Label is
;; "<cwd> <command>"; target is the prompt prefix's start.
;; Composes with `consult-imenu', `imenu-list', evil's `]m'/`[m'.
;;
;; The cwd is captured at OSC 133 'C' (command-start) and pushed
;; onto `ghostel--imenu-cwds', a chronological list (newest-first).
;; Reading `default-directory' lazily at index time would
;; mis-attribute every prior prompt to the *current* cwd after a `cd'.
;;
;; Position-based tracking (text properties or markers) does not
;; survive: the renderer's per-row delete+reinsert wipes ad-hoc
;; text properties on dirty rows, and `eraseBuffer' (resize-cols,
;; force-full redraw, scrollback edge cases) collapses every marker
;; to `point-min'. Pairing chronological cwds with the
;; `ghostel-prompt' regions in buffer order at index time is robust
;; to both: resize reflows the grid but preserves prompt order;
;; scrollback eviction is detected as (cwd-count > region-count)
;; and the oldest cwds are dropped to realign.
(defvar-local ghostel--imenu-cwds nil
"Chronological list of cwds for prompts that have had OSC 133 \\='C\\=' fire.
Pushed at command-start time, so newest-first. Aligned by order to
the `ghostel-prompt' regions in the buffer when the index is built.")