Subject: Re: bug#19945: emacsclient confused by active minibuffer

From: Eli Zaretskii <[email-masked]>
Date: Fri, 04 Dec 2020 13:49:03 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Fri, 04 Dec 2020 10:51:50 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> But the first point still stands -- terminal 2 displays *scratch* first,
> >> and then, one second later, switches to *foo* -- presumably there's
> >> something timing out the `M-x' thing?
> >> 
> >> Does anybody have any insight into what might be happening here?
> >
> > We wait for echo-keystrokes seconds, I presume.
> 
> Yes, that seems to be it -- but why is emacsclient doing that instead of
> ending the interaction immediately?

It isn't emacsclient that's doing this.  Remember: emacsclient just
sends a command to Emacs via a socket; processing of that command and
displaying the results on the frame's display is done by the server,
i.e. by Emacs.

So it's Emacs that's waiting, probably inside sit_for.