Skip to content

fix: avoid terminal daemoned session crash with helm-everywhere #1435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions core/prelude-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,27 @@
(when prelude-theme
(load-theme prelude-theme t))


;; NOTE(@lerax): dom 01 jun 2025 12:42:24
;; helm-descbinds became incompatible with which-key-mode ins 202402XX version
;; Using prelude, calling which-key-mode as hook in
;; server-after-make-frame-hook crash terminal daemoned session
;; this function prevents to this happen
(defun prelude-safe-which-key-mode ()
(condition-case err
(which-key-mode +1)
(error
(let ((error-message (cadr err)))
(with-temp-message "" ;; don't print to minibuffer
(message "[Prelude] bypass error: %s" error-message))))))

;; show available keybindings after you start typing
;; add to hook when running as a daemon as a workaround for a
;; which-key bug
;; https://github.com/justbur/emacs-which-key/issues/306
(if (daemonp)
(add-hook 'server-after-make-frame-hook 'which-key-mode)
(which-key-mode +1))
(add-hook 'server-after-make-frame-hook #'prelude-safe-which-key-mode)
(prelude-safe-which-key-mode))

(provide 'prelude-ui)
;;; prelude-ui.el ends here