Patch for version 26.2 can be found here:
https://raw.githubusercontent.com/otadmor/emacs-conf/master/xterm.c.patch
Patch for the current master branch in git on the original message.