Fix #1703: blank dired over TRAMP

When the remote system does not have GNU ls installed.
This commit is contained in:
Henrik Lissner 2019-10-07 22:12:16 -04:00
parent 4d8647fe7a
commit a9919a5360
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -30,6 +30,19 @@
(setq args (delete "--group-directories-first" args))))
(setq dired-listing-switches (string-join args " ")))
(add-hook! 'dired-mode-hook
(defun +dired-disable-gnu-ls-flags-in-tramp-buffers-h ()
"Fix #1703: opening directories over TRAMP in dired displays a blank screen.
This is because there's no guarantee the remote system has GNU ls, which is the
only variant that supports --group-directories-first."
(when (file-remote-p default-directory)
(setq-local dired-listing-switches
(string-join
(split-string dired-listing-switches
"--group-directories-first")
" ")))))
(define-key! dired-mode-map
;; Kill buffer when quitting dired buffers
[remap quit-window] (λ! (quit-window t))