GNU bug report logs - #78896
29.4; display-time-mode breaks minibuffer in emacsclient

Previous Next

Package: emacs;

Reported by: Varun Malladi <varun.malladi <at> gmail.com>

Date: Wed, 25 Jun 2025 17:36:03 UTC

Severity: normal

Found in version 29.4

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 78896 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: varun.malladi <at> gmail.com, 78896 <at> debbugs.gnu.org
Subject: Re: bug#78896: 29.4;
 display-time-mode breaks minibuffer in emacsclient
Date: Thu, 26 Jun 2025 08:11:19 +0300
> Cc: 78896 <at> debbugs.gnu.org
> From: Juri Linkov <juri <at> linkov.net>
> Date: Wed, 25 Jun 2025 21:57:30 +0300
> 
> > Given the following minimal init file:
> > ```
> > ;; min-init.el
> > (require 'tab-bar)
> > (tab-bar-mode)
> > (add-to-list 'tab-bar-format 'tab-bar-format-global 'append)
> > (display-time-mode -1)
> > ```
> >
> > I do the following:
> > ```
> > emacs -Q --daemon --load min-init.el
> > ```
> >
> > Then when I start emacsclient in the terminal with `emacsclient -t`, the
> > minibuffer won't work at all. When I don't do this via the server,
> > e.g. removing `--daemon` from the above invocation, the minibuffer works
> > fine.
> >
> > Let me try to describe what I mean when I say that the minibuffer
> > doesn't work. `M-x` puts the cursor at the beginning of the minibuffer
> > (no "M-x" text). Typing any key says that the key is not defined. `C-g`
> > doesn't work either.
> 
> Thanks for the bug report.  My guess is that it's related
> to forcing switching frame focus to the active minibuffer.
> 'tab-bar-format-global' calls 'format-mode-line' that
> on a tty frame forces focus to the initial daemon frame.

These kinds of initializations and customizations should be moved to
server-after-make-frame-hook.  They should only be invoked directly
from the init file in non-daemon session (one could use the function
daemonp to check that).  The rule is that any initialization or
customization that needs the Emacs GUI system to be up and running
should be done from server-after-make-frame-hook.

Note that server-after-make-frame-hook is run after starting each new
frame, not just once.  So if you have one-time initializations, you
need some state variable you can set to indicate that the one-time
stuff was already done, and set it after performing those
initializations for the first time.




This bug report was last modified 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.