unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Matt Bisson <bisson.m@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 49253@debbugs.gnu.org
Subject: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode
Date: Fri, 8 Dec 2023 14:06:05 -0500	[thread overview]
Message-ID: <CAFbUcwK0J-E-3cwi-CuLR6+07BydZxfow2ULMpwHweXYB01TLw@mail.gmail.com> (raw)
In-Reply-To: <CAFbUcw+BmzbDMXjnJO1BGBx0a8fNTFajxYcF-fSynonjxyKkzA@mail.gmail.com>

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

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 PM Matt Bisson <bisson.m@gmail.com> wrote:

> 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 mode.
>
> On Sat, Jul 16, 2022, 8:21 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> Matt Bisson <bisson.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).  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
>>
>

[-- Attachment #2: Type: text/html, Size: 2817 bytes --]

  reply	other threads:[~2023-12-08 19:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 14:28 bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode Matt Bisson
2021-06-28 16:57 ` Eli Zaretskii
2021-06-28 17:18   ` Matt Bisson
2021-06-28 17:27     ` Eli Zaretskii
2021-06-28 17:30       ` Matt Bisson
2021-06-28 17:34         ` Matt Bisson
2021-06-28 17:59           ` Eli Zaretskii
2021-06-28 18:00         ` Eli Zaretskii
2021-06-28 18:11           ` Matt Bisson
2021-06-28 18:37             ` Eli Zaretskii
2021-06-28 20:09               ` Matt Bisson
2021-06-29 12:09                 ` Eli Zaretskii
2021-06-29 15:06                   ` Matt Bisson
2022-07-16 12:21 ` Lars Ingebrigtsen
2022-07-16 19:13   ` Matt Bisson
2023-12-08 19:06     ` Matt Bisson [this message]
2023-12-08 20:35       ` Matt Bisson
2023-12-09 11:10         ` Eli Zaretskii
2023-12-09 21:38           ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-11 16:10             ` Matt Bisson
2023-12-11 22:13               ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-13 19:26                 ` Matt Bisson
2023-12-16 12:46                 ` Eli Zaretskii

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=CAFbUcwK0J-E-3cwi-CuLR6+07BydZxfow2ULMpwHweXYB01TLw@mail.gmail.com \
    --to=bisson.m@gmail.com \
    --cc=49253@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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).