Start emacs with emacs -Q -nw from an xterm. Select some text in some
other X window. Then middle-click in Emacs. The selection is inserted
using bracketed-paste, as expected. The lossage for this event is
ESC [ 2 0 0 ~ [xterm-paste]
Now run M-x xterm-mouse-mode, and middle-click again. You get a message
gui-get-primary-selection: No selection is available
and nothing is inserted. The lossage is
ESC [ < 1 ; 3 7 ; 1 0 M ESC [ < 1 ; 3 7 ; 1 0 m [mouse-yank-primary]
so the command is detected properly, just nothing is inserted.
I don't know whether we can do anything about this. This is probably an issue/missing feature in XTerm: even if we get a mouse-yank-primary event, we can't get the X selection (unless OSC-52 is enabled). So XTerm should send the bracketed paste (or even the standard paste events) even if extended mouse tracking is enabled. Does anybody know whether this issue has already been discussed in some XTerm forum?