From 0155eb670c2f9e072c34671537d95c716a54e011 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 6 Jun 2026 14:14:48 -0500 Subject: fix: quit the whole commander on q, not just one pane In a pane, q ran dired's quit-window, which closes only the window it is in, so quitting left the other pane behind. Binding q to duet-quit in duet-mode-map makes it tear down both panes and restore the pre-launch layout, the same as F10. q is the key a commander user reaches for, so it should mean "leave the commander," not "close this window." --- duet.el | 6 ++++-- tests/test-duet-pane.el | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/duet.el b/duet.el index 4c49eca..85be734 100644 --- a/duet.el +++ b/duet.el @@ -789,10 +789,12 @@ nil means the current directory when `duet' is invoked." (define-key map (kbd "") #'duet-mkdir) (define-key map (kbd "") #'duet-delete) (define-key map (kbd "") #'duet-quit) + (define-key map (kbd "q") #'duet-quit) map) "Keymap active in DUET commander panes. -mc/Norton F-keys, taking precedence inside a pane only. dired's own chords -\(C, R, D, v, +) keep working as free aliases.") +mc/Norton F-keys, taking precedence inside a pane only. q also quits the +commander (tearing down both panes), since dired's own q only quits its one +window. dired's data chords (C, R, D, v, +) keep working as free aliases.") (define-minor-mode duet-mode "Buffer-local minor mode marking a buffer as a DUET commander pane. diff --git a/tests/test-duet-pane.el b/tests/test-duet-pane.el index 181309b..df9866b 100644 --- a/tests/test-duet-pane.el +++ b/tests/test-duet-pane.el @@ -57,6 +57,10 @@ (should (eq 'duet-delete (lookup-key duet-mode-map (kbd "")))) (should (eq 'duet-quit (lookup-key duet-mode-map (kbd ""))))) +(ert-deftest test-duet-pane-q-quits-the-commander () + "q quits the whole commander (both panes), not just dired's current window." + (should (eq 'duet-quit (lookup-key duet-mode-map (kbd "q"))))) + ;;; Minor-mode precedence (ert-deftest test-duet-pane-mode-is-buffer-local () -- cgit v1.2.3