Subject: bug#37782: Emacs 27 client adding [I] to the beginning of the buffer

From: Eli Zaretskii <[email-masked]>
Date: Thu, 17 Oct 2019 11:03:05 +0300

> From: Carlos Pita <[email-masked]>
> Date: Wed, 16 Oct 2019 23:33:50 -0300
> 
> > If it turns out to be a problem in emacs I will report it again.
> 
> Ok, it turned out to be a problem in emacs :).
> 
> A minimal configuration to reproduce it would be: (load-theme 'wombat).
> 
> Then launch `emacs --daemon` and finally `emacsclient -t`.
> 
> Btw, it only happens in the terminal.

Most probably comes from escape sequences Emacs sends to the terminal
to detect support of advanced features.  This particular one seems to
come from detecting focus-in support, see xterm.el:

    ;; These translation functions actually call the focus handlers
    ;; internally and return an empty sequence, causing us to go on to
    ;; read the next event.
    (define-key map "\e[I" #'xterm-translate-focus-in)
    (define-key map "\e[O" #'xterm-translate-focus-out)

Please debug to find out why that particular theme causes this
failure.

Thanks.