From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Bisson Newsgroups: gmane.emacs.bugs Subject: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode Date: Fri, 8 Dec 2023 14:06:05 -0500 Message-ID: References: <87r12lqmco.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000552ae1060c04471a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29753"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49253@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 08 20:07:03 2023 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 1rBgBj-0007Wy-F8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Dec 2023 20:07:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBgBW-0008Gn-Gx; Fri, 08 Dec 2023 14:06:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBgBU-0008GL-Ul for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 14:06:48 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBgBU-0002gY-LR for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 14:06:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBgBh-0001Xo-MY for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 14:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matt Bisson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Dec 2023 19:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49253 X-GNU-PR-Package: emacs Original-Received: via spool by 49253-submit@debbugs.gnu.org id=B49253.17020623985875 (code B ref 49253); Fri, 08 Dec 2023 19:07:01 +0000 Original-Received: (at 49253) by debbugs.gnu.org; 8 Dec 2023 19:06:38 +0000 Original-Received: from localhost ([127.0.0.1]:46205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBgBK-0001Wh-As for submit@debbugs.gnu.org; Fri, 08 Dec 2023 14:06:38 -0500 Original-Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:54503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBgBI-0001WD-NH for 49253@debbugs.gnu.org; Fri, 08 Dec 2023 14:06:37 -0500 Original-Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-50c02628291so2571331e87.0 for <49253@debbugs.gnu.org>; Fri, 08 Dec 2023 11:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702062377; x=1702667177; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JUwSs970GhslqCp+IhTsNMtpKRFSDuRWdghuIR3tHEE=; b=EnUoHCb+n5qksWevh8DY2fzrYRYofPBqTb5oHG7a/nQ88sLxWn2uozokQgvPf27Ep4 MJDwV40Vn1a4afmLVlQ+R10sJpUQ0rwSmjm2cmINigvdFC2VeNxWsg9Ug3BUusadX1ki 0p96iKnvUfkhfWlqXVcnRTyBdZOrptd/thERjyYWSqxYzynIWTJXGL9JuH3imtF+5UjT tqbMoe8z4ZplyLo91cUFqu486EWXiLwF4ounQIqyAfh0x8OfW6dl7yEy5DatoHGzX+am b1EIFlYhR82YK85s/Rog7KRQ+y5UdAV6O4FsUZYs2PBeYGjugkVblNmj8J6n6y5pCSBv +NkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702062377; x=1702667177; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JUwSs970GhslqCp+IhTsNMtpKRFSDuRWdghuIR3tHEE=; b=Wzi8IZexjxSAbrIFtfcLVdFCRt8spKrM76H+ChV+YxN5i0CQYrJxLIOnwHcjg9B20i qf0o9PabrStr5Wfo8ehuk7Loq2lJ78tOFSyU1KuItpLXuYAyHAimlyhK/ZHzHMKOhKG9 ZU+dw47zSikWwEkFt7ZAwZG1fNonHFexqq/qq1rfaxxTq8GrJii51N+rc9WLUn8aEq2N Fn2KzIbkilQ+5phqNkFpkNXHvMa38yDiFp76ZrzK7A61VSDzvwjdu1T8kYPkKCepByi1 eDHMyEokrJpkv/8SDKog69Xcbybhx8cU4KLAdEHB2jqt+gYm5QNhlf8OwTerPjpGsK0K aUAQ== X-Gm-Message-State: AOJu0YxUx+KeqAZUaZeF6fjp9XamEecSuVQoHXogq8CPdZa9+DZtkdLh UP6p5GWncniH74aS8lBpVU6EkDiqprL69iwDAGE= X-Google-Smtp-Source: AGHT+IG4HLuIqb5KzDCHKnos8mCsRnvhwVqBg4cJXQ3pYv8l2Nm/D0GJnfajY9oGNVyeNNvWngZmyzr90L3w1gD+RZE= X-Received: by 2002:a19:4f4c:0:b0:50c:a91:6187 with SMTP id a12-20020a194f4c000000b0050c0a916187mr199430lfk.15.1702062376429; Fri, 08 Dec 2023 11:06:16 -0800 (PST) In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275799 Archived-At: --000000000000552ae1060c04471a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've finally had some time to look at this and what's happening is term/xterm.el is fighting with term.el. The bracketed paste command comes in with "\e[200~", arrives in term/xterm.el's xterm--pasted-text function first. It correctly reads the text from the clipboard. This is because xterm-translate-bracketed-paste is registered as a key binding for [xterm-paste] (or "\e[200~" on RXVT). Immediately thereafter, term--xterm-paste in term.el notices the [xterm-paste] key as well (it has also registered a binding for "raw" mode), and begins the same process of xterm--pasted-text. At this point, there's nothing to read from read-event, and it hangs for most-positive-fixnum (basically, forever). So this is the root cause analysis. Unfortunately, naively removing the key binding from term.el does not work, because the pasted text must be inserted via term-send-raw-string. -Matt On Sat, Jul 16, 2022 at 3:13=E2=80=AFPM Matt Bisson wr= ote: > For sure. Even in emacs 28.2, if I want to paste something into the > terminal buffer, I have to switch to line mode, and back when I'm done. > You just can't paste into the terminal buffer in terminal emacs in key mo= de. > > On Sat, Jul 16, 2022, 8:21 AM Lars Ingebrigtsen wrote: > >> Matt Bisson writes: >> >> > I have observed this behavior from MacOS, with an Emacs running either >> > locally on MacOS, or over SSH (running on Linux). Without any >> > modifications, a -Q invocation causes "xterm--pasted-text: Failed >> > select: Invalid argument", but without -Q it simply hangs. >> >> (I'm going through old bug reports that unfortunately weren't resolved >> at the time.) >> >> Are you still seeing this problem in recent Emacs versions? >> >> -- >> (domestic pets only, the antidote for overdose, milk.) >> bloggy blog: http://lars.ingebrigtsen.no >> > --000000000000552ae1060c04471a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I've finally had some time to look at this and wh= at's happening is term/xterm.el is fighting with term.el.=C2=A0 The bra= cketed paste command comes in with "\e[200~", arrives in term/xte= rm.el's xterm--pasted-text function first.=C2=A0 It correctly reads the= text from the clipboard.=C2=A0 This is because xterm-translate-bracketed-p= aste is registered as a key binding for [xterm-paste] (or "\e[200~&quo= t; on RXVT).

Immediately thereafter, term--xterm-p= aste in term.el notices the [xterm-paste] key as well (it has also register= ed a binding for "raw" mode), and begins the same process of xter= m--pasted-text.=C2=A0 At this point, there's nothing to read from read-= event, and it hangs for most-positive-fixnum (basically, forever).

So this is the root cause analysis.=C2=A0 Unfortunately, n= aively removing the key binding from term.el does not work, because the pas= ted text must be inserted via term-send-raw-string.

-Matt

On Sat, Jul 16, 2022 at 3:13=E2=80=AFPM Matt Bisson &= lt;bisson.m@gmail.com> wrote:<= br>
For sure.=C2=A0 Even in emacs 28.2, if I want to paste something into the= terminal buffer, I have to switch to line mode, and back when I'm done= .=C2=A0 You just can't paste into the terminal buffer in terminal emacs= in key mode.

On Sat, Jul 16, 2022, 8:21 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
=
Matt Bisson <bis= son.m@gmail.com> writes:

> I have observed this behavior from MacOS, with an Emacs running either=
> locally on MacOS, or over SSH (running on Linux).=C2=A0 Without any > modifications, a -Q invocation causes "xterm--pasted-text: Failed=
> select: Invalid argument", but without -Q it simply hangs.

(I'm going through old bug reports that unfortunately weren't resol= ved
at the time.)

Are you still seeing this problem in recent Emacs versions?

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000552ae1060c04471a--