Subject: 25.3; shell mode starts echoing command

From: [email-masked] (Barry A. Warsaw)
Date: Mon, 18 Sep 2017 11:46:50 -0400

* M-x shell RET
* Go to the shell and type `ls RET`
* See the output of the `ls` but *not* the actual `ls` command
* Enter an interpreter; two choices which reproduce the problem include `sqlite3` and `python3`
  Type `sqlite3` at the shell prompt
* Type .exit at the sqlite3 prompt (notice that the `.exit` was echo'd
  before the shell prompt came back; the bug is now active
* Type `ls RET` at the shell prompt.  Notice that the `ls RET` was
  echoed before the ls output was printed.

Note that using `python3` or even `python` at the prompt will also
exhibit the bug.  (To exit Python, just type ctrl-D).  The only way I've
found to "fix" the problem is to ctrl-D to exit the shell, then `M-x
shell RET` to restart it in the same buffer.

In GNU Emacs 25.3.1 (x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build 16G29))
 of 2017-09-14 built on resist.local
Windowing system distributor 'Apple', version 10.3.1504
Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/25.3/share/info/emacs
 --prefix=/usr/local/Cellar/emacs/25.3 --without-x --with-xml2
 --without-dbus --without-gnutls --without-imagemagick --with-ns
 --disable-ns-self-contained'

Configured features:
JPEG NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
The mark is not set now, so there is no region
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils shell pcomplete comint
ansi-color ring time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core 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 charscript case-table epa-hook jka-cmpr-hook help
simple abbrev 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
kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 200070 5259)
 (symbols 48 19931 0)
 (miscs 40 59 194)
 (strings 32 16829 5243)
 (string-bytes 1 489691)
 (vectors 16 33562)
 (vector-slots 8 655967 4691)
 (floats 8 158 281)
 (intervals 56 252 16)
 (buffers 976 20))