Specifically, I want to set overriding-terminal-local-map
to nil in all terminals.
1 Answer
I've had a similiar problem and found out after studying the sources of Evil that using the after-make-frame-functions
hook comes close enough.
(defun my-terminal-local-map-override (&optional frame)
(with-selected-frame frame
(setq overriding-terminal-local-map nil)))
(add-hook 'after-make-frame-functions 'my-terminal-local-map-override)
For my specific usecase I needed to call the my-terminal-local-map-override
function unconditionally additionally to that, so if it doesn't work for you in both Emacs and emacsclient
, give that extra hack a try.
(dolist (t (terminal-list)) ...)
or(dolist (f (frame-list)) ...)
.emacsclient -t
. The new terminal has the map at nil, but the transient mappre-command-hook
is still running. So there was a need to shut down the transient map on all terminals. And I did it withframe-list
in the end.set-transient-map
, likeuniversal-arg--more
are harmless. The problem with the hydra was that it has a feature of disabling all commands that aren't in the map. So it became problematic when the map became nil in one frame afteremacsclient -t
.