Subject: 27.2; term-mode: After splitting window, newlines are inserted

From: Khoa Vo <[email-masked]>
Date: Thu, 13 May 2021 12:14:11 +0300

Note: I have repoduced this bug even without a configuration file.

Steps:
- Enter term-mode.
- Enter term-line-mode.
- Type a command one line below the prompt, but don't hit "enter" yet.
- Issue command "M-x split-window-right".
- You can see the problem: one or more new lines are inserted after the
prompt.
  Pushing the command further down.

This is problematic because:
- If you repeat that enough times, you can't see the command anymore.
- I need the end of the buffer to be where the prompt is,
  so I can get to the prompt quickly.
- Also I sometimes need to copy the command, I can just copy from the
  prompt to the end of the buffer.

It seems to me like the issue is with splitting the window.

In GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60
Version 10.14.6 (Build 18G95))
 of 2021-03-27 built on builder10-14.porkrind.org
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.3.1

Recent messages:
Checking 57 files in
/Applications/Emacs.app/Contents/Resources/lisp/eshell...
Checking 71 files in /Applications/Emacs.app/Contents/Resources/lisp/erc...
Checking 34 files in
/Applications/Emacs.app/Contents/Resources/lisp/emulation...
Checking 180 files in
/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp...
Checking 24 files in
/Applications/Emacs.app/Contents/Resources/lisp/cedet...
Checking 59 files in
/Applications/Emacs.app/Contents/Resources/lisp/calendar...
Checking 87 files in /Applications/Emacs.app/Contents/Resources/lisp/calc...
Checking 113 files in
/Applications/Emacs.app/Contents/Resources/lisp/obsolete...
Checking for load-path shadows...done
Mark set
Quit
Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS JSON PDUMPER GMP

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

Major mode: Term

Minor modes in effect:
  goto-address-mode: t
  global-whitespace-mode: t
  TeX-PDF-mode: t
  global-company-mode: t
  company-mode: t
  desktop-save-mode: t
  global-magit-file-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  show-paren-mode: t
  global-auto-revert-mode: t
  counsel-mode: t
  ivy-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  evil-lion-mode: t
  evil-commentary-mode: t
  global-undo-tree-mode: t
  shell-dirtrack-mode: t
  evil-mode: t
  evil-local-mode: t
  electric-pair-mode: t
  winner-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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(pp shadow sort mail-extr goto-addr emacsbug sendmail smex ido
css-mode-expansions css-mode html-mode-expansions sgml-mode eww mm-url
gnus nnheader wid-edit url-queue url url-proxy url-privacy url-expand
url-methods url-history mailcap shr url-cookie url-domsuf url-util svg
xml dom conf-mode js-mode-expansions js cc-mode-expansions cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs jka-compr asm-mode inf-groovy markdown-mode noutline outline
vc-git rainbow-delimiters rainbow-identifiers company-oddmuse
company-keywords company-etags etags fileloop generator company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-capf company-cmake company-semantic company-template
company-bbdb wheatgrass-theme whitespace multi-term term disp-table
ehelp nginx-mode groovy-mode ansible f jsonnet-mode yaml-mode
terraform-mode hcl-mode dockerfile-mode s sh-script smie executable
indent-tools yafolding hydra lv indent-tools-indentation-of
highlight-indentation sql-indent sql view clojure-mode-expansions
clojure-mode lisp-mnt align font-latex tex texmathp company
pcase quail math-symbol-lists desktop frameset expand-region
text-mode-expansions er-basic-expansions expand-region-core
expand-region-custom magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func imenu magit-diff smerge-mode diff-mode
magit-core magit-autorevert magit-margin magit-transient magit-process
magit-mode git-commit transient magit-git magit-section magit-utils crm
log-edit message rmc puny rfc822 mml mml-sec epa derived epg epg-config
gnus-util rmail rmail-loaddefs text-property-search mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log
with-editor async-bytecomp async server dash exec-path-from-shell paren
autorevert filenotify aggressive-indent counsel xdg xref project dired
dired-loaddefs compile swiper ivy delsel ivy-faces ivy-overlay colir
color avy evil-surround evil-lion rx disable-mouse extempore-mode
sudo-edit tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat parse-time iso8601 time-date ls-lisp format-spec
evil-commentary evil-commentary-integration evil-little-word evil
evil-integration undo-tree diff evil-maps evil-commands reveal flyspell
ispell evil-jumps evil-command-window evil-types evil-search evil-ex
shell pcomplete comint ansi-color evil-macros evil-repeat evil-states
evil-core advice evil-common windmove thingatpt rect evil-digraphs
evil-vars cl-extra help-mode elec-pair winner ring use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core tex-site cl
info edmacro kmacro package easymenu browse-url url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer 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
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 kqueue cocoa ns
multi-tty make-network-process emacs)

Memory information:
((conses 16 494933 56940)
 (symbols 48 33468 0)
 (strings 32 120893 8532)
 (string-bytes 1 3741337)
 (vectors 16 63025)
 (vector-slots 8 1511385 236164)
 (floats 8 348 346)
 (intervals 56 9385 0)
 (buffers 1000 113))