From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#18135: bug#3735: shell-mode editing, movement, and command entry broken by prompt/output changes Date: Sun, 05 Dec 2021 17:13:06 +0100 Message-ID: <87bl1v3u99.fsf@miha-pc> References: <9A88C51B-AE7B-4FD8-9929-6F058AC23AE6@gmail.com> <87lf10138e.fsf_-_@gnus.org> <33D68609-31C2-465C-8718-667B5F51B50E@donhopkins.com> Reply-To: miha@kamnitnik.top Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24958"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 3735@debbugs.gnu.org, dsb@smart.net, Chong Yidong , 18135@debbugs.gnu.org, Don Hopkins To: Don Hopkins , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 05 19:08:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtvvt-0006Gm-Oc for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Dec 2021 19:08:18 +0100 Original-Received: from localhost ([::1]:35334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtvvs-00009N-R2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Dec 2021 13:08:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtvvg-00006O-2g for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 13:08:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtvvf-0005n9-RN for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 13:08:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtvvf-0000S7-M8 for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 13:08:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Dec 2021 18:08:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18135 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 18135-submit@debbugs.gnu.org id=B18135.16387276811691 (code B ref 18135); Sun, 05 Dec 2021 18:08:03 +0000 Original-Received: (at 18135) by debbugs.gnu.org; 5 Dec 2021 18:08:01 +0000 Original-Received: from localhost ([127.0.0.1]:59239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtvvc-0000R7-OG for submit@debbugs.gnu.org; Sun, 05 Dec 2021 13:08:01 -0500 Original-Received: from kamnitnik.top ([209.250.245.214]:60874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtu3X-00060H-29; Sun, 05 Dec 2021 11:08:03 -0500 Original-Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by kamnitnik.top (Postfix) with ESMTPSA id B720C9CA87; Sun, 5 Dec 2021 16:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1638720481; bh=uToh5BFBDmHUnEdNtG+AyfIYDsqQdSSf4of9oNU7ifI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SyPeEbWLuoaba78vzbXl/0CehAh20GpWkEL64C/3cukW32FKUDUNmUSlELh6xkXdK rbztoISArBnJWD7FamX9O5RGvpZBjVovb9GQrs8Nc8WV1FbkuIatakG48GsECn5PDH +IG/NvoKbjudzFicDpv5EEY8goIaQgKKV/Su5RNQZSiAcRq1Tnhb/dA3nL8NvRh4Wu oybAVpQQfVyXmWEpEmUs4DDZIvEG7gVm5SNQH34X6gf6hWkkCe4QEff20G5MsMOain yj76kBtvr46fL0TRIFMyWrnyoq7YYArFvH6Ey74KkmAWQz2dCsX7RAwMsYU25LLT8C dE5dRoc+A39NQ== In-Reply-To: <33D68609-31C2-465C-8718-667B5F51B50E@donhopkins.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221616 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Don Hopkins writes: > Thanks for looking into this!=20 > > I can=E2=80=99t reproduce the problem through that recipe, but weird thin= gs still happen in other situations.=20 > > Try putting =E2=80=9C -la=E2=80=9D in the kill buffer and then yanking it= instead of typing it at the end of the output of =E2=80=9Cecho ls=E2=80=9D= .=20 > > It totally ignores the whole line, as if you entered an empty line. > > But the thing that usually happens to me is that it enters the text that = I yanked, but I=E2=80=99m not sure what the exact conditions to trigger it = are.=20 > > But at any rate, yanking =E2=80=9C -la=E2=80=9D and hitting return should= have the exact same behavior as typing =E2=80=9C -la=E2=80=9D and hitting = return, so it=E2=80=99s probably caused by the same underlying problem. > > I=E2=80=99ll let you know if I figure out other test cases that get it to= enter the text you yanked but not the text before that. It usually has som= ething to do with yanking text, possibly at the end or also in the middle o= f the line. Reproducer: =2D copy " -la" into kill ring =2D type "echo ls" into M-x shell =2D (Shell gives output line "ls".) =2D Go up to output line "ls" (C-p). =2D yank " -la" =2D press C-b =2D the line now "ls -la" with point after "l" =2D press RET Only " -la" is sent to the process instead of "ls -la" This is because the 'field' text property of "ls" is 'output' but the " -la" is inserted with insert-for-yank and doesn't have a 'field' text property. A similar thing happens if we insert a space using M-SPC (just-one-space) in the middle of process output. The space is inserted with 'insert' and doesn't inherit the 'field' text property of the surrounding text. This didn't cause a problem in older Emacs because the field text property wasn't used yet at that time in comint. I am willing to write up a patch to fix this. I'm thinking of having comint-mode register a function in after-change-functions to mark text inserted in the 'output' field as 'output'. Would this be okay or are there any obvious flaws with this approach? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmGs5RITHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP4IBD/9rQZirS2ahK4NDRDQL9Eht/A2kp6O5 IwUuqxo8RauG4MzpE8fFZok9T+Ngrcc/dEYRNAsLIaR+Oc8ofWOw4YpOV4r6526K oDEHKpEhyt1qxn5ZDwCk+TRv6xCX4p3tsTuPfcwtgPXEyv7BWK36Tc959kTnytq7 ++oz0FYyVrLNSjFFvAofgQ4UyW4H0clK4HHDXbO0wX9KX48Z+WYzJFxc+E8qOuQN pd+7PLVIFsAZGc5DdpQNo41wT9fSZy6p5sl+Xbfeh+WagQwmoEQNxlOjWocBqVHQ z8eOZZh4WMjAGg772P6nD7zl1achFKjdgcPTwGua+6gy5DwvIokdhaq4iwpGXea0 uHWiyiNc6kl5neBrPOZ/AqIDgtSjk77WKCeJFTyvq/R9nDHKek76w4XgChNXdZGC TR5AiakMmuFSbGcnGAoSZJ3308YefZQaoJ1qnxcczUqK6lXKKxbHzxz0qCyJAzrC dk+KRJ/qEMaywCiq6Nfm0gwdMlWWaFiamZLuuR+Gk2DxdB+oYP0UicMxvUX4juKu LLkAl/6FIMBf3L5QVtJ0k4bigIvJScss1vlGuJEBDfHtsvW3/PUg8oCtExH6QbxQ CQvsSNq8BrHl6Xld39cVgIaRa0P6NNlbM20U5blKOOSsnxlP1FQ9ZeKUwQ6+JAPe BDymbNrEmAZ8lA== =e5Qd -----END PGP SIGNATURE----- --=-=-=--