fix(dired): prevent dirvish from killing root buffers on quit

`dirvish--clear-session' kills non-visible root buffers on quit, and
`dirvish-reuse-session' set to `open' also kills the index buffer.
This destroys the original dirvish-fd buffer when navigating through
subdirectories and quitting.

Change `dirvish-reuse-session' to `t' so root buffers survive both
file opening and quit. Doom's existing `+dired--cleanup-dirvish-h'
handles cleanup on project/workspace switches.

Fix: #8591
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kovan 2026-02-13 15:57:42 +01:00
parent a0d6aac43f
commit c097bc4f7f

View file

@ -82,12 +82,10 @@ Fixes #3939: unsortable dired entries on Windows."
(set-popup-rule! "^ ?\\*\\(?:[Dd]irvish\\|SIDE :: \\).*" :ignore t)
;; Fixes #8038. This setting is for folks who expect to be able to switch back
;; to dired buffers where the file is opened from. In other cases, don't
;; recycle sessions. We don't want leftover buffers lying around, especially
;; if users are reconfiguring Dirvish or trying to recover from an error. It's
;; too easy to accidentally break Dirvish (e.g. by focusing the header window)
;; at the moment. Starting from scratch isn't even that expensive, anyway.
(setq dirvish-reuse-session 'open)
;; to dired buffers where the file is opened from. Doom's cleanup hook
;; (`+dired--cleanup-dirvish-h') handles killing sessions on project/workspace
;; switches, so `t' is safe here.
(setq dirvish-reuse-session t)
(if (modulep! +dirvish)
(setq dirvish-attributes '(file-size)