Subject: 26.3; can't edit file with terminal escape sequences

From: [email-masked]
Date: Tue, 18 Feb 2020 05:48:59 -0800

To reproduce, open the attached file in Emacs, and type C-x C-n. On my system Emacs uses 100% of CPU, indefinitely.

I can open the file in Vim (where it only lets me see the first part of the line) and in Gedit.

The file came from debugging Neomutt's use of curses. Thanks.

In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
  of 2019-08-29 built on juergen
Recent messages:
Loading /home/frederik/.emacs.d/my-mark.el (source)...done
Loading /home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-site.el (source)...done
Loading /usr/share/emacs/26.3/lisp/progmodes/cc-mode.el.gz...
uncompressing cc-mode.el.gz...done
Loading /usr/share/emacs/26.3/lisp/progmodes/cc-mode.el.gz...done
Loading /home/frederik/.emacs.d/my-compile-next-makefile.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
When done with a buffer, type C-x #
next-line: End of buffer [2 times]
Making completion list...

Configured using:
  'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
  --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
  'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt'
  CPPFLAGS=-D_FORTIFY_SOURCE=2
  LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
   value of $LC_TIME: en_GB
   value of $LANG: 
   value of $XMODIFIERS: 
   locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
   global-auto-revert-mode: t
   shell-dirtrack-mode: t
   savehist-mode: t
   override-global-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t

Load-path shadows:
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-rd hides /usr/share/emacs/site-lisp/ess/ess-rd
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-rutils hides /usr/share/emacs/site-lisp/ess/ess-rutils
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/msdos hides /usr/share/emacs/site-lisp/ess/msdos
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sp3-d hides /usr/share/emacs/site-lisp/ess/ess-sp3-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-r-gui hides /usr/share/emacs/site-lisp/ess/ess-r-gui
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-bugs-d hides /usr/share/emacs/site-lisp/ess/ess-bugs-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-trns hides /usr/share/emacs/site-lisp/ess/ess-trns
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-font-lock hides /usr/share/emacs/site-lisp/ess/ess-font-lock
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-dde hides /usr/share/emacs/site-lisp/ess/ess-dde
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-generics hides /usr/share/emacs/site-lisp/ess/ess-generics
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-gretl hides /usr/share/emacs/site-lisp/ess/ess-gretl
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-r-completion hides /usr/share/emacs/site-lisp/ess/ess-r-completion
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-help hides /usr/share/emacs/site-lisp/ess/ess-help
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-noweb hides /usr/share/emacs/site-lisp/ess/ess-noweb
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sp4-d hides /usr/share/emacs/site-lisp/ess/ess-sp4-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-vst-d hides /usr/share/emacs/site-lisp/ess/ess-vst-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-mode hides /usr/share/emacs/site-lisp/ess/ess-mode
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-bugs-l hides /usr/share/emacs/site-lisp/ess/ess-bugs-l
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-roxy hides /usr/share/emacs/site-lisp/ess/ess-roxy
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-xls-d hides /usr/share/emacs/site-lisp/ess/ess-xls-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/make-regexp hides /usr/share/emacs/site-lisp/ess/make-regexp
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sp6w-d hides /usr/share/emacs/site-lisp/ess/ess-sp6w-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-custom hides /usr/share/emacs/site-lisp/ess/ess-custom
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-s4-d hides /usr/share/emacs/site-lisp/ess/ess-s4-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sas-a hides /usr/share/emacs/site-lisp/ess/ess-sas-a
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-noweb-mode hides /usr/share/emacs/site-lisp/ess/ess-noweb-mode
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/mouseme hides /usr/share/emacs/site-lisp/ess/mouseme
/home/frederik/.emacs.d/elpa/julia-mode-20191225.858/julia-mode hides /usr/share/emacs/site-lisp/ess/julia-mode
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-utils hides /usr/share/emacs/site-lisp/ess/ess-utils
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess hides /usr/share/emacs/site-lisp/ess/ess
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sas-d hides /usr/share/emacs/site-lisp/ess/ess-sas-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-site hides /usr/share/emacs/site-lisp/ess/ess-site
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sas-l hides /usr/share/emacs/site-lisp/ess/ess-sas-l
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/essd-els hides /usr/share/emacs/site-lisp/ess/essd-els
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-eldoc hides /usr/share/emacs/site-lisp/ess/ess-eldoc
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-r-args hides /usr/share/emacs/site-lisp/ess/ess-r-args
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-r-syntax hides /usr/share/emacs/site-lisp/ess/ess-r-syntax
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-julia hides /usr/share/emacs/site-lisp/ess/ess-julia
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-omg-l hides /usr/share/emacs/site-lisp/ess/ess-omg-l
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sp5-d hides /usr/share/emacs/site-lisp/ess/ess-sp5-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-toolbar hides /usr/share/emacs/site-lisp/ess/ess-toolbar
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-arc-d hides /usr/share/emacs/site-lisp/ess/ess-arc-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-rdired hides /usr/share/emacs/site-lisp/ess/ess-rdired
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-lsp-l hides /usr/share/emacs/site-lisp/ess/ess-lsp-l
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-tracebug hides /usr/share/emacs/site-lisp/ess/ess-tracebug
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-sp6-d hides /usr/share/emacs/site-lisp/ess/ess-sp6-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-swv hides /usr/share/emacs/site-lisp/ess/ess-swv
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-mouse hides /usr/share/emacs/site-lisp/ess/ess-mouse
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-r-a hides /usr/share/emacs/site-lisp/ess/ess-r-a
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-noweb-font-lock-mode hides /usr/share/emacs/site-lisp/ess/ess-noweb-font-lock-mode
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-inf hides /usr/share/emacs/site-lisp/ess/ess-inf
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-jags-d hides /usr/share/emacs/site-lisp/ess/ess-jags-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-s3-d hides /usr/share/emacs/site-lisp/ess/ess-s3-d
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-r-package hides /usr/share/emacs/site-lisp/ess/ess-r-package
/home/frederik/.emacs.d/elpa/ess-20170109.628/lisp/ess-omg-d hides /usr/share/emacs/site-lisp/ess/ess-omg-d

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa epg gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
term/rxvt term/xterm xterm elec-pair cc-mode derived cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-langs cc-bytecomp
jka-compr rx edmacro kmacro autorevert filenotify ido ess-toolbar
ess-mouse mouseme thingatpt+ thingatpt browse-url ess-menu ess-swv
ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d
ess-sas-l ess-sas-a ess-sta-d ess-sta-l cc-vars cc-defs make-regexp
ess-sp6-d ess-dde ess-sp3-d ess-julia julia-mode julia-mode-latexsubs
ess-r-d ess-r-syntax ess-r-completion ess-roxy essddr noutline outline
hideshow ess-help ess-r-package ess-s-l ess ess-inf ess-tracebug tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec advice ess-mode ess-noweb-mode ess-utils
time-date ess-generics ess-custom executable ess-compat ess-site
savehist iflipb bind-key compile easy-mmode comint ansi-color ring cl
help-fns+ wid-edit help-fns radix-tree help-mode server finder-inf
gh-common marshal eieio-compat info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 329454 16361)
  (symbols 48 32943 2)
  (miscs 40 103 133)
  (strings 32 71935 3550)
  (string-bytes 1 1946605)
  (vectors 16 47930)
  (vector-slots 8 883205 10966)
  (floats 8 113 448)
  (intervals 56 312 0)
  (buffers 992 16))