From c097bc4f7fa2bbfd472fc92dcfb09cbeb73dee2a Mon Sep 17 00:00:00 2001 From: kovan Date: Fri, 13 Feb 2026 15:57:42 +0100 Subject: [PATCH] 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 --- modules/emacs/dired/config.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el index 816d85250..645c93320 100644 --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -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)