Subject: 29.0.50; Emoji skin-tone modifiers disrupt terminal output

From: "J.P." <[email-masked]>
Date: Wed, 03 Aug 2022 06:42:08 -0700

I use graphical Emacs, so this may be pilot error or some external issue
I'm mistaking for an Emacs one. Steps to reproduce:

- emacs -Q -nw
- In *scratch*, M-:

  (dotimes (_ 10) (insert ";; \U0001f9dc\U0001f3fc 12345\n\n\n\n\n\n"))

- Make entire buffer the active region (put mark at BOB and point at EOB)
- Scroll down (M-v) once or twice
- Gaps appear in the mode line and visual artifacts elsewhere

AFAICT, the two inserted characters can be any valid emoji/modifier
combination. Additional leading or trailing emojis (or other characters,
like ZWJ \u200d or VS-16 \ufe0f) don't seem to affect the result.

This was initially noticed on an Alacritty terminal emulator displaying
a remote Emacs 28. The session in the screenshot below was run in a
stock VM image [1] with only Emacs 29 installed:

~$ env | grep -i term
COLORTERM=truecolor
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/06526de0_c54d_497a_b95f_7e039a886d02
TERM=xterm-256color
GNOME_TERMINAL_SERVICE=:1.95

~$ uname -r
5.10.0-16-amd64

~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

[1] https://builder.libguestfs.org/index.asc

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu)
 of 2022-08-03 built on debianbullseye
Repository revision: 4f3e95bed523be11f3be7b791c6ae909ffa77a8d
Repository branch: master
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --without-x'

Configured features:
ACL DBUS GMP GNUTLS MODULES NOTIFY INOTIFY PDUMPER SECCOMP SOUND THREADS

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dnd dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util text-property-search time-date subr-x
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils term/xterm xterm byte-opt gv bytecomp
byte-compile cconv regexp-opt rmc iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify multi-tty make-network-process emacs)

Memory information:
((conses 16 47267 10255)
 (symbols 48 5661 0)
 (strings 32 15261 1789)
 (string-bytes 1 495339)
 (vectors 16 8381)
 (vector-slots 8 102650 6988)
 (floats 8 24 36)
 (intervals 56 181 12)
 (buffers 992 10))