unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	Michael Heerdegen <michael_heerdegen@web.de>
Cc: Robert Pluim <rpluim@gmail.com>,
	Khoa Vo <vodangkhoa873@gmail.com>,
	48399@debbugs.gnu.org
Subject: bug#48399: 27.2; term-mode: After splitting window, newlines are inserted
Date: Tue, 12 Jul 2022 15:13:22 +0200	[thread overview]
Message-ID: <87pmiascct.fsf@miha-pc> (raw)
In-Reply-To: <871quqsef6.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> Happens even without C-n:
>>
>> M-x term
>> C-c C-j
>> ls
>> C-x 2     ;; a linefeed between prompt and "ls" in inserted
>> C-x 1     ;; another one is inserted
>
> Thanks.  I've had a brief look at term.el to see what could be causing
> this -- I wondered whether it might be a window change hook or
> something, but that doesn't seem to be the case.
>
> It seems to be happening non-synchronously -- sometimes the extra
> newline isn't added until half a second passes, so perhaps it's
> something that happens during communication between the shell and Emacs.
>
> I'm pretty unfamiliar with the term.el code.  Anybody know where to
> start poking?

When a term.el window is resized, emacs sends a SIGWINCH to it's
process. Bash seems to output some spaces newlines upon receiving a
SIGWINCH. In an ordinary terminal emulator, these spaces have the effect
of clearing bash's readline display and they aren't really visible to
the user. In term.el, however, they are inserted before the "ls" that
the user has input (this "ls" is input in term-line-mode, which means
that bash isn't aware of it yet, until the user presses RET).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2022-07-12 13:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  9:14 bug#48399: 27.2; term-mode: After splitting window, newlines are inserted Khoa Vo
2022-07-11 14:42 ` Lars Ingebrigtsen
2022-07-11 14:57   ` Robert Pluim
2022-07-11 15:48     ` Michael Heerdegen
2022-07-12 12:28       ` Lars Ingebrigtsen
2022-07-12 13:13         ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-07-12 13:27           ` Michael Heerdegen
2022-07-12 13:48           ` Andreas Schwab
2022-07-12 13:40         ` Eli Zaretskii
2022-07-12 14:14         ` Andreas Schwab
2022-07-12 14:26         ` Andreas Schwab
2022-07-12 22:21           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmiascct.fsf@miha-pc \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48399@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    --cc=miha@kamnitnik.top \
    --cc=rpluim@gmail.com \
    --cc=vodangkhoa873@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).