From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 11:22:07 2021 Received: (at submit) by debbugs.gnu.org; 28 Jun 2021 15:22:07 +0000 Received: from localhost ([127.0.0.1]:52253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxt5K-0001hh-9y for submit@debbugs.gnu.org; Mon, 28 Jun 2021 11:22:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:53996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxsGA-0000Nx-VX for submit@debbugs.gnu.org; Mon, 28 Jun 2021 10:29:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxsGA-00022W-Mp for bug-gnu-emacs@gnu.org; Mon, 28 Jun 2021 10:29:14 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:37722) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lxsG8-0004dE-Qz for bug-gnu-emacs@gnu.org; Mon, 28 Jun 2021 10:29:14 -0400 Received: by mail-lj1-x22d.google.com with SMTP id k8so25993140lja.4 for ; Mon, 28 Jun 2021 07:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=59vzM3X5Ao9ueh+egCpEBjG8mQjW4vxpuWqfuJb9V/8=; b=I5VEr5rR6lMlxok5YH5OGt4gONJ2v/AGfMJdxa9AUIKK0dDpJlzWTfS7hK9ZO0CmI5 q7mC1J0ZrW49+8L0owr9JoZ7/P1gU5KPhwf1dtk/n/tzhWkkgjfvuwWEFdZoWPggGL2B mMkDBq+WMKI1bJeOWTtG5Oglj3JzWLKZrW2Nlpnt4UDI0H4VWp6lq12bNOhb0RvUxCkU LUYO5DkC+ZMWftorqU1v/r6b3dg3jdL2kXJcZ4U+ZAqHQTIr0wSP9Uwn5Uug8xesUrVJ wDBrojcMkByHamGI1ANrJAKkvgCnfKPQyNPPtHY1hGh9WapU/LNc5cg4Q46GQ9gz1dJi Mtmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=59vzM3X5Ao9ueh+egCpEBjG8mQjW4vxpuWqfuJb9V/8=; b=hvf+ZYKce339SXmX62+qFUajdtSkVI/JCyARpAOl0gFsEp46YW4FNZLGpqsD0ADAZD hfNMBCFadjCMI+2U2Ls5X3eB06V0ba/TA0KKsNKT1MSSD2IBrRo6iQff8BfQpKhmo/6S 0rCaDwBeSfU85l+AMQOlNEHddBNECQQBgegrggEhInqICpa1DQobyCYnPmZuVT8CNTrQ JGGYG9n6IL+IEgpIyUt6AFexBwZaVB5d/tkwYbYdaFil6SEdGgiDd16cIwnEU8zb9krR MWDQMqjXfBx40X6yIDOSXmR1H3QAgV7Pv8ah/QOZIS9BV3FShSyOpJO8ZzzR0l4I7bfM BoOQ== X-Gm-Message-State: AOAM531J5PoJsE9byXQcQaZu/+7AwQOepL2lnhW6vnhY0jtjk1w/R/GS PHJVTaFgLifaoEXMWj4WsscTDndC7oV3NK1wuK9Jrh+K+PU= X-Google-Smtp-Source: ABdhPJz7Mxuu3nMwCAjC/mJVhwzAD9EcuRTjCNeYLltd6NUujE1FO9y57l9QeEKvkDxeVYGb6dzd0zoSD4USYUm+Bt4= X-Received: by 2002:a2e:2f14:: with SMTP id v20mr20834095ljv.363.1624890550724; Mon, 28 Jun 2021 07:29:10 -0700 (PDT) MIME-Version: 1.0 From: Matt Bisson Date: Mon, 28 Jun 2021 10:28:59 -0400 Message-ID: Subject: 27.2; Emacs non-responsive when pasting into terminal-mode To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=bisson.m@gmail.com; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 28 Jun 2021 11:22:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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. It can attach emacsclient sessions, but they do not accept input. 1. Start "emacs -nw" 2. M-x term 3. In another application, copy some text into the clipboard, it doesn't matter what. 4. Return to the Emacs session, and paste into the terminal (I used Command-V). 4a. Emacs no longer responds. You have to kill (not kill -9, mind you). Running strace makes it seem like it's missing some pselect call, but I haven't quite sniffed out the issue. 4b. With -Q, it more helpfully prints "xterm--pasted-text: Failed select: Invalid argument" and continues functioning, but this is clearly not the desired behavior either. I no longer have (direct) access to a Linux, XTerm, so I've been running into the problem since Emacs 26.3 on Linux *through* the Mac OS Terminal application. Emacs doesn't have to be the version listed below, in other words. I will try to update this bug when I figure out what thing in my dot file causes the hang instead of the delay+error message. All I have relating to terminal-mode is a hook that sets two key-bindings. When I manually add this in -Q, it still doesn't hang. Perhaps it's some other mode that loads outside my dot file. This problem is actually super annoying :) as I will have hundreds of files open, as well as a bunch of terminals in an emacs daemon process, and accidentally I will forget and paste some text into the session, at which point I will have to open a second terminal to this remote host, find and kill the emacs process, then rearrange all my things back to what I was doing. It happens once a day at this point... 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.4 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Quit [2 times] Making completion list... 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_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: global-whitespace-mode: t display-battery-mode: t show-paren-mode: t display-time-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq gv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils disp-table whitespace battery paren time byte-opt bytecomp byte-compile cconv advice 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 48031 7233) (symbols 48 6582 1) (strings 32 17172 1862) (string-bytes 1 572362) (vectors 16 10205) (vector-slots 8 127980 10714) (floats 8 28 24) (intervals 56 200 0) (buffers 1000 12)) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 12:57:12 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 16:57:12 +0000 Received: from localhost ([127.0.0.1]:52376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxuZM-0006Vl-JL for submit@debbugs.gnu.org; Mon, 28 Jun 2021 12:57:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxuZK-0006VW-Kk for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 12:57:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45310) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxuZF-0007M3-8c; Mon, 28 Jun 2021 12:57:05 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2602 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxuZE-0007S3-8D; Mon, 28 Jun 2021 12:57:05 -0400 Date: Mon, 28 Jun 2021 19:57:00 +0300 Message-Id: <83zgvand0j.fsf@gnu.org> From: Eli Zaretskii To: Matt Bisson In-Reply-To: (message from Matt Bisson on Mon, 28 Jun 2021 10:28:59 -0400) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Matt Bisson > Date: Mon, 28 Jun 2021 10:28:59 -0400 > > 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. It can > attach emacsclient sessions, but they do not accept input. What kind of terminal emulator is actually being used, and does it support the xterm X selection protocol? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 13:18:23 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 17:18:23 +0000 Received: from localhost ([127.0.0.1]:52407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxutr-00078E-6x for submit@debbugs.gnu.org; Mon, 28 Jun 2021 13:18:23 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:34623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxutp-00077z-Jt for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 13:18:22 -0400 Received: by mail-lj1-f174.google.com with SMTP id p24so11574330ljj.1 for <49253@debbugs.gnu.org>; Mon, 28 Jun 2021 10:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qi/iD+rcO2A5XfR1xwvgVe9DIVaw3xcTC9GR8u9ytD4=; b=f226wP8cBXzqRa/uKfny4NfLubQF0Kc2PBxeSjrCA3ODF2FHBQAeWbsCwBw90EzwC7 8yyWqVhEMI+wnpVh5TUJYZNBfDTB3Kv18i1FMFeWFaVYmFVftEpo+vjBGpB9Pnu0wZIu FpknIYvLHqR6R+Vap04bRG86QRPihmKRii1Gkh02V9XBcwTmJtsOWpCQpWuS4zGF21tj 1ya4AVKlqiOSW9XNSfimazfK9OtApnkpwCsI5aI9UHetYwa+oFjl9v/k46LHmKKHIT5u DKpWHavxtWO/3bv4lZk+TlFKjAMWtNYvkJkFkmN6KjUQiop7PfinuFUvYchLBoELnimE OJcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qi/iD+rcO2A5XfR1xwvgVe9DIVaw3xcTC9GR8u9ytD4=; b=QFdZW3p71EjwASbKyNF6+A4HzZ/BwaCBQH8HQbyLcTZtbCQ9HLTV9YIufhXc+G9NdW 8nEIjTd788x/XDcjAr4o4HaIxYWFv5OCO30f/qSLOg+WJEmVGsM1ySgQjYuAvJQj0ayq 2dRbRf0DAMQHqG0LRcZu3ZM9pvuRyohJ8tU69FxojvEk/xEsschss+2XTvFmFrSwuOxL dz66tmHmzdsbkIO/WzFW3CGVa0ioesdiW15JRo49XVuOPE9mDeN63o8iXVvXQGfLI9pA ud3wG2Hr9hsTP4HInQH61Uhtus12d1YClHDfrWTU5mdVVXwD3mZaGx/y3/NqAXX+ZxcJ MAaw== X-Gm-Message-State: AOAM531FOWpvyY3CQ0rXZBikrcUdedfpy0n6jt8ve8Aw04WnAyp4b5iL lsvTr7M3gJ3MvAHxZzOg5pSC0E/6YpVPwdwzHM0= X-Google-Smtp-Source: ABdhPJwF279LuN8XiyUx7aRsi5ZBCDPUZ9exCUfJ2FVfxAPW2+3H7+Q+4lrMUds6O+uZKGrZr2vUa33YSpTZTnTwKX4= X-Received: by 2002:a2e:3310:: with SMTP id d16mr358718ljc.348.1624900695621; Mon, 28 Jun 2021 10:18:15 -0700 (PDT) MIME-Version: 1.0 References: <83zgvand0j.fsf@gnu.org> In-Reply-To: <83zgvand0j.fsf@gnu.org> From: Matt Bisson Date: Mon, 28 Jun 2021 13:18:04 -0400 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is the Mac Terminal application that comes out of the box with MacOS. It fully supports xterm-256color as the TERM type, and I can actually paste just fine in other parts of Emacs. Although I'm having trouble getting to a Linux terminal emulator these days, I realized that I do have a machine running WIndows. I ran the Cygwin terminal emulator, MinTTY, started (terminal, Cygwin -- i.e., not the Win32 native) Emacs, and it exhibits the same behavior. Something more fundamental seems to be going wrong. On Mon, Jun 28, 2021 at 12:57 PM Eli Zaretskii wrote: > > > From: Matt Bisson > > Date: Mon, 28 Jun 2021 10:28:59 -0400 > > > > 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. It can > > attach emacsclient sessions, but they do not accept input. > > What kind of terminal emulator is actually being used, and does it > support the xterm X selection protocol? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 13:27:15 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 17:27:15 +0000 Received: from localhost ([127.0.0.1]:52416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxv2R-0007Mj-Ad for submit@debbugs.gnu.org; Mon, 28 Jun 2021 13:27:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxv2P-0007MX-QE for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 13:27:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46278) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxv2K-000264-Jn; Mon, 28 Jun 2021 13:27:08 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4469 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxv2K-0007zx-3q; Mon, 28 Jun 2021 13:27:08 -0400 Date: Mon, 28 Jun 2021 20:27:06 +0300 Message-Id: <83wnqdoq6t.fsf@gnu.org> From: Eli Zaretskii To: Matt Bisson In-Reply-To: (message from Matt Bisson on Mon, 28 Jun 2021 13:18:04 -0400) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: <83zgvand0j.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Matt Bisson > Date: Mon, 28 Jun 2021 13:18:04 -0400 > Cc: 49253@debbugs.gnu.org > > This is the Mac Terminal application that comes out of the box with > MacOS. It fully supports xterm-256color as the TERM type, and I can > actually paste just fine in other parts of Emacs. Although I'm having > trouble getting to a Linux terminal emulator these days, I realized > that I do have a machine running WIndows. I ran the Cygwin terminal > emulator, MinTTY, started (terminal, Cygwin -- i.e., not the Win32 > native) Emacs, and it exhibits the same behavior. Something more > fundamental seems to be going wrong. I think you'll have to run this under GDB and see what kind of "invalid argument" this scenario triggers on your systems. The same issue on multiple system with several terminal emulators almost always means some local setting problem. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 13:30:40 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 17:30:40 +0000 Received: from localhost ([127.0.0.1]:52424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxv5j-0007Tb-U1 for submit@debbugs.gnu.org; Mon, 28 Jun 2021 13:30:40 -0400 Received: from mail-lf1-f52.google.com ([209.85.167.52]:33297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxv5g-0007TJ-JM for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 13:30:38 -0400 Received: by mail-lf1-f52.google.com with SMTP id t17so34046777lfq.0 for <49253@debbugs.gnu.org>; Mon, 28 Jun 2021 10:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=971IcnG+mBXfxewXpsMtHSZBqou5vfBplEGE6rMGhNQ=; b=u1E++HNGXVBxKDusIN9QhStBC9VeRYzfj5fxs1EXxj7jU01W+paTu0gy29kTV3sbii Xm+agyodSed2R5EejJi6bh9mdqo7E67lvmaosB7ZGs1PF9y0x8UzUuhnJpB7aafA0K+W ztbt2U5GOBCbZ0+h4lv00B9wIEs90GQ5hN+n7MixoimQ4PMM/Y2eoFebfUptgyBNOYYS XRXYwiOFdvGXhwU23o+wccORGqP+E8bYm+WtZUI6MQIJA+UhOz6ZKtREDE5gF+cwXrG7 TbupM9CJVX6gKiZG8b3zNvcJAtKFyoYkzdMSYTuYgVkYd/hRy9hLl3BfkQqsWdINV0+a EXCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=971IcnG+mBXfxewXpsMtHSZBqou5vfBplEGE6rMGhNQ=; b=MqLmogWYa9rhmNxc9lE0+S48KOY9Hns3Cl/ZgZ+f6riPzh8n104/9U+yaxlnc053wy 1U/eD88jxasiOH7kiFYwLoG9IFjM1M3uMYLRV6wkaLYEVQv/Nbz3kKwNqkk8Y2UezYmb rDrxIX0YL13dTmew/G0qTh2AGRZN5+p6H6++RBpwTJE506Kno3HPmvF7XWE4xYO1QXCp D2JlzdnTB9YQwuGhJeIv2t3TjOaFHMbWSJoZi5sTylSU4xqIaHrzM0dvKrP1mtw5GiwJ 4iVlvMlxAl+E/cRfPy5pawczBWcSrIVYOgF8AiSW1gtZ3+acRfhOqC1J2Z+ngz/5ySt8 GDSg== X-Gm-Message-State: AOAM531HVuEg3Vh+h2KOxcln0ALyXqkxfFC03SnReNmCht7FEd9kqBSZ T3UgH0MqkxCkqO6owyPz19cz0GUZsgNIATeugQI= X-Google-Smtp-Source: ABdhPJyWWok3Fnw3iI4xdtUZUffdDb3TadJwExXquT7yH4SoCRCbkAeuPvGm/V+sbQS0jCgsuimw3PhQOopM1PWfPOw= X-Received: by 2002:a19:c344:: with SMTP id t65mr19579538lff.134.1624901430414; Mon, 28 Jun 2021 10:30:30 -0700 (PDT) MIME-Version: 1.0 References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> In-Reply-To: <83wnqdoq6t.fsf@gnu.org> From: Matt Bisson Date: Mon, 28 Jun 2021 13:30:19 -0400 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Looking at the (E-Lisp) function, it's not obvious to me where I should put a (native-code) breakpoint. Any thought? Of course I can figure something out, but if you happen to know... On Mon, Jun 28, 2021 at 1:27 PM Eli Zaretskii wrote: > > > From: Matt Bisson > > Date: Mon, 28 Jun 2021 13:18:04 -0400 > > Cc: 49253@debbugs.gnu.org > > > > This is the Mac Terminal application that comes out of the box with > > MacOS. It fully supports xterm-256color as the TERM type, and I can > > actually paste just fine in other parts of Emacs. Although I'm having > > trouble getting to a Linux terminal emulator these days, I realized > > that I do have a machine running WIndows. I ran the Cygwin terminal > > emulator, MinTTY, started (terminal, Cygwin -- i.e., not the Win32 > > native) Emacs, and it exhibits the same behavior. Something more > > fundamental seems to be going wrong. > > I think you'll have to run this under GDB and see what kind of > "invalid argument" this scenario triggers on your systems. The same > issue on multiple system with several terminal emulators almost always > means some local setting problem. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 13:35:03 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 17:35:03 +0000 Received: from localhost ([127.0.0.1]:52431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxv9z-0007ai-Jk for submit@debbugs.gnu.org; Mon, 28 Jun 2021 13:35:03 -0400 Received: from mail-lj1-f172.google.com ([209.85.208.172]:39867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxv9u-0007a8-UH for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 13:35:01 -0400 Received: by mail-lj1-f172.google.com with SMTP id c11so26849443ljd.6 for <49253@debbugs.gnu.org>; Mon, 28 Jun 2021 10:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mtVVSKvDRc7XI7iyawO+qrDSm6gRJE3q/b2uuV/6ViU=; b=dT7rg7gcI6NLCWXCwIVeIpC2NFJvsJ78igCCMY1TjrQQr+T3BJg5Y18cdYzwxHROTU PhM0hapGaqp1YdsUx8IA6bNcw08ygdcLLaeRZhpvEyJ+lfXigyKDN9d1iFqcv9EDImSa 7YUdsbb2kWB5HWhBFJ6Bx9YNRGSq3vSz0MlDvrvqLPy/8OWaTNTZIBEWeWAA4/D9K0go te4pcKXaD1uHmalwNZwSpQQbMUenvLgkKM09zq7dzx7z3gCUGn3wQbPq0s66i03YQEuF 0yabvUhQ9t2bJASmuuKnFnQdFMVSD82IMPfQG4L3omBPWGXtXZjlBMZakWaREEYn+oyl NGRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mtVVSKvDRc7XI7iyawO+qrDSm6gRJE3q/b2uuV/6ViU=; b=kZiYfbKlZkDTa2PcBpV7dmIrK1jTuqeL3wKetWYQ3Vi1OmazXet3N/ljsJePrH633w SlwjZoEKeKtnfZKDOIduPsl3zT9dKdXgDZUXCNKDZiGmBTX8HZH1/h/k36yrHY4Wjuup REnu3h4E+e2nrzS5mCeAVK1zcj+WYrSmBu5WpaaMHeoCZE5hmM0yZ2EKiFEVDtdLVdiO Gf9r5nUezqjKWEOiHlrnXEwW/BpK8kKg2sTpzMh3bq3hmrJhlMr2DJnRaN3tCcExVOxb AQz8CdS9pHI5FNrj8quAEIXSjo7lbYxBvNObbsJR1YZ1wngO2I+hNu6jyXLOM1L0xIOB Z09A== X-Gm-Message-State: AOAM532hR1DJlUrGGAeLJVDhYK9U7pWfbITHdRh0NiBsfp8kWdDyDefK JDI3MdboI+c/AvQjhaVno2W6PZMzUAXsWAYtu/VOo5C5 X-Google-Smtp-Source: ABdhPJyHZWzC00AGSaIvOSlqBgxw4DXYlhLK8EzWLJM5PomNIBhZ0rFRbylCf3CaPFd+4dxprFzTqEXp+QbYTuAWu0I= X-Received: by 2002:a05:651c:1254:: with SMTP id h20mr422114ljh.430.1624901693094; Mon, 28 Jun 2021 10:34:53 -0700 (PDT) MIME-Version: 1.0 References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> In-Reply-To: From: Matt Bisson Date: Mon, 28 Jun 2021 13:34:41 -0400 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Given that it happens on two different windowing systems, with two different terminal emulators, and two different builds of Emacs, and I get the error message with "-Q", I'm really not sure what local issue that could be, given that there's very little in common between the two sites -- except Emacs itself. Again, I will look, but I'm not sure what your hypothesis is. On Mon, Jun 28, 2021 at 1:30 PM Matt Bisson wrote: > > Looking at the (E-Lisp) function, it's not obvious to me where I > should put a (native-code) breakpoint. Any thought? Of course I can > figure something out, but if you happen to know... > > On Mon, Jun 28, 2021 at 1:27 PM Eli Zaretskii wrote: > > > > > From: Matt Bisson > > > Date: Mon, 28 Jun 2021 13:18:04 -0400 > > > Cc: 49253@debbugs.gnu.org > > > > > > This is the Mac Terminal application that comes out of the box with > > > MacOS. It fully supports xterm-256color as the TERM type, and I can > > > actually paste just fine in other parts of Emacs. Although I'm having > > > trouble getting to a Linux terminal emulator these days, I realized > > > that I do have a machine running WIndows. I ran the Cygwin terminal > > > emulator, MinTTY, started (terminal, Cygwin -- i.e., not the Win32 > > > native) Emacs, and it exhibits the same behavior. Something more > > > fundamental seems to be going wrong. > > > > I think you'll have to run this under GDB and see what kind of > > "invalid argument" this scenario triggers on your systems. The same > > issue on multiple system with several terminal emulators almost always > > means some local setting problem. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 13:59:58 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 17:59:58 +0000 Received: from localhost ([127.0.0.1]:52464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxvY6-0008Bt-0b for submit@debbugs.gnu.org; Mon, 28 Jun 2021 13:59:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxvY3-0008Bb-4Z for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 13:59:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47240) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxvXx-00078V-Jj; Mon, 28 Jun 2021 13:59:49 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2507 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxvXx-0007R5-6I; Mon, 28 Jun 2021 13:59:49 -0400 Date: Mon, 28 Jun 2021 20:59:44 +0300 Message-Id: <83v95xooof.fsf@gnu.org> From: Eli Zaretskii To: Matt Bisson In-Reply-To: (message from Matt Bisson on Mon, 28 Jun 2021 13:34:41 -0400) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Matt Bisson > Date: Mon, 28 Jun 2021 13:34:41 -0400 > Cc: 49253@debbugs.gnu.org > > Given that it happens on two different windowing systems, with two > different terminal emulators, and two different builds of Emacs, and I > get the error message with "-Q", I'm really not sure what local issue > that could be Some input Emacs gets fed at startup, which it doesn't expect, and which looks like a beginning of a paste sequence? This does happen right at startup, yes? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 14:00:41 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 18:00:41 +0000 Received: from localhost ([127.0.0.1]:52468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxvYn-0008En-9z for submit@debbugs.gnu.org; Mon, 28 Jun 2021 14:00:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxvYm-0008Ea-Dl for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 14:00:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47274) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxvYh-0007kG-4C; Mon, 28 Jun 2021 14:00:35 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2554 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxvYf-00009q-Cr; Mon, 28 Jun 2021 14:00:35 -0400 Date: Mon, 28 Jun 2021 21:00:30 +0300 Message-Id: <83tulhoon5.fsf@gnu.org> From: Eli Zaretskii To: Matt Bisson In-Reply-To: (message from Matt Bisson on Mon, 28 Jun 2021 13:30:19 -0400) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Matt Bisson > Date: Mon, 28 Jun 2021 13:30:19 -0400 > Cc: 49253@debbugs.gnu.org > > Looking at the (E-Lisp) function, it's not obvious to me where I > should put a (native-code) breakpoint. Any thought? Of course I can > figure something out, but if you happen to know... No, it's the other way around: you start Emacs from GDB. There are some instructions in etc/DEBUG. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 14:12:18 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 18:12:18 +0000 Received: from localhost ([127.0.0.1]:52474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxvk2-0008V0-BJ for submit@debbugs.gnu.org; Mon, 28 Jun 2021 14:12:18 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:38747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxvjy-0008Uk-27 for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 14:12:17 -0400 Received: by mail-lf1-f41.google.com with SMTP id w19so5639733lfk.5 for <49253@debbugs.gnu.org>; Mon, 28 Jun 2021 11:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SUrrXjX6strQct2oEbORCvjWLVVLV07h6kqv01XNeQw=; b=EeUozzBkffnLu7JDBFg6GV4C1z0F1Eu1r03y2MNLXF25TXd7ZmJd4E1LMU+WGB0OPs JopIy46EniYX49HinzxJaEzxneovqbwFlmOTiApc/FvdGmgkLokTRNNBfwFTzCKUyCWm Zs48Aymf0VJAJi7zAHa9rq3GhUfmiJ3fk3ROfteAnwYPivj9E2rb+rOFTBOuOIYG6ErI 0ewx3p7ELJmTbTNp8Vw+uz8NeqkBvrPmM+Mj7IZ+wE64I8ld8PmLxx6LIYM/xPeWQ46R wKc5T1DMaxhq07G64IaPYJysi3hR5P2X/QXIqcFLM1kIxyJ1zCEiKC+bs/F5pPvhS7OH W4cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SUrrXjX6strQct2oEbORCvjWLVVLV07h6kqv01XNeQw=; b=T+JNBoQ0ndP/FmZrqSn4YcxaP0QsSmSzKJATjzT+vaW2gQq22Iy7qWQAnYn+A1qFvk HJN4NlOhYbFVjsKma/sMYUNPnFzSdLkeRP0WVp5KqwOI5zden3v21ujk+cEvRmb907kn uddC45swNbd60sCDemxMAHh6e+me7zin2xRXjwdySJSHBcyjdz4S050I1y0EY68q+P7W 00anbamnyivxCg6Gi2FzyuvydfI5++rZqdn0mFKfjRLMHu9HjAP3Rzt2dncQl8pFPFXV 4OCXxLK+OXshf7YLh+exMV8H4bkHe5b9hF6FdZvGXkb+b/vLv6qdExWGrYtpzec4QXj6 oUOg== X-Gm-Message-State: AOAM531BD86RYavJHPfCCD5AW6uJ6jBnIhpo6S6Gee6lvcpF06Kg3Qdf UK3QLNSc8RGkLvdmD3O/g3dNszA5U0lO29mMo1w6Vj1aIsM= X-Google-Smtp-Source: ABdhPJzu2jbAKL/iXu3wBouXBT0jqzemUeYgX4mfUp/cu3oZ/mkZbPHKXN7KfoEhZevUZS9VmbQ/UxxHmuuNiH6uHNA= X-Received: by 2002:a19:ae11:: with SMTP id f17mr19567538lfc.198.1624903927894; Mon, 28 Jun 2021 11:12:07 -0700 (PDT) MIME-Version: 1.0 References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> <83tulhoon5.fsf@gnu.org> In-Reply-To: <83tulhoon5.fsf@gnu.org> From: Matt Bisson Date: Mon, 28 Jun 2021 14:11:56 -0400 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Some input Emacs gets fed at startup, which it doesn't expect, and > which looks like a beginning of a paste sequence? This does happen > right at startup, yes? No. (Unless I'm misunderstanding what you're asking) the problem can occur at any time. It's in response to simply pasting from the clipboard into a terminal application. I can start Emacs, run for days normally -- using terminal-mode, editing files, and so forth. The second I go into the terminal-mode buffer and paste from the (Windows, Mac, whatever) clipboard (NOT using the Emacs yank command), the problem happens. If I never paste from the windowing system into my terminal emulator, there are not problems, but invariably I find some huge chunk of text, go to paste it into Emacs, and forget that this will be a problem, and everything locks up irreversibly. It is as if there is some race with multiple parties asking for select(), but I don't know the Emacs threading model yet. TBH, I assumed it was kind of single-threaded. :) If your statement is more that the beginning of the sequence retrieved from the xterm paste incantation occurs "at the start", then for that I will have to debug into GDB, as we talked about. > No, it's the other way around: you start Emacs from GDB. There are > some instructions in etc/DEBUG. Yes, I do know that's what you mean :) but it's not as if Emacs is going to crash, and stop in the debugger. So my question is basically, what src/*.c line should I set a breakpoint on to observe the thing you would like me to observe? If you can't say, that's perfectly reasonable. That said, as I type this, I can try to interrupt Emacs when it's hung and see anything that's going on, but I believe it will be after the problematic event has occurred. On Mon, Jun 28, 2021 at 2:00 PM Eli Zaretskii wrote: > > > From: Matt Bisson > > Date: Mon, 28 Jun 2021 13:30:19 -0400 > > Cc: 49253@debbugs.gnu.org > > > > Looking at the (E-Lisp) function, it's not obvious to me where I > > should put a (native-code) breakpoint. Any thought? Of course I can > > figure something out, but if you happen to know... > > No, it's the other way around: you start Emacs from GDB. There are > some instructions in etc/DEBUG. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 14:37:50 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 18:37:50 +0000 Received: from localhost ([127.0.0.1]:52517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxw8k-0002tj-Db for submit@debbugs.gnu.org; Mon, 28 Jun 2021 14:37:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxw8h-0002tW-Pl for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 14:37:48 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48324) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxw8c-0008As-FW; Mon, 28 Jun 2021 14:37:42 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4821 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxw8c-00052z-3U; Mon, 28 Jun 2021 14:37:42 -0400 Date: Mon, 28 Jun 2021 21:37:35 +0300 Message-Id: <83sg11omxc.fsf@gnu.org> From: Eli Zaretskii To: Matt Bisson In-Reply-To: (message from Matt Bisson on Mon, 28 Jun 2021 14:11:56 -0400) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> <83tulhoon5.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Matt Bisson > Date: Mon, 28 Jun 2021 14:11:56 -0400 > Cc: 49253@debbugs.gnu.org > > No. (Unless I'm misunderstanding what you're asking) the problem can > occur at any time. It's in response to simply pasting from the > clipboard into a terminal application. I can start Emacs, run for > days normally -- using terminal-mode, editing files, and so forth. > The second I go into the terminal-mode buffer and paste from the > (Windows, Mac, whatever) clipboard (NOT using the Emacs yank command), > the problem happens. Wait a minute: what do you mean by "terminal-mode buffer" into which you need to go? More generally, can you describe a detailed recipe for reproducing the problem on your system, keystroke by keystroke? > > No, it's the other way around: you start Emacs from GDB. There are > > some instructions in etc/DEBUG. > > Yes, I do know that's what you mean :) but it's not as if Emacs is > going to crash, and stop in the debugger. You are investigating the error message saying "Failed select". Search the *.c files for that text, and you will find only 3 instances of it. Put a breakpoint in all these 3 places, then do whatever it takes to reproduce the problem, and you will be able to collect the information I asked about. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 16:09:46 2021 Received: (at 49253) by debbugs.gnu.org; 28 Jun 2021 20:09:46 +0000 Received: from localhost ([127.0.0.1]:52800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxxZi-0005FT-AT for submit@debbugs.gnu.org; Mon, 28 Jun 2021 16:09:46 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:38405) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxxZf-0005Ey-6K for 49253@debbugs.gnu.org; Mon, 28 Jun 2021 16:09:44 -0400 Received: by mail-lf1-f51.google.com with SMTP id w19so6262649lfk.5 for <49253@debbugs.gnu.org>; Mon, 28 Jun 2021 13:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cNFDofzihGaObOfHqqJ2HVpNlUxkNtFjsMxugxmx4xc=; b=qRntzue0mpRRJsIGYf+6MMXKUkRu7OLizX/7vaO6aJOxZVvSETlsZll4t0Zjbb/sYG N5S60YXHeshbClwpLokiVUYE96G/lF8Bjd2tnyG/RZrBgSdYqyt5I5n9h801HJncZSRk 6TfTgFv7FOZPdrUz1xVX1AHey+DGX5fR3n4OSbxL4s7+qR1rH2udr81nDBIEvs40++OU GOY8l5mC/AzgEFw3MKKZCT6ICRe9Md9aLq9KLA7FLzqMSQrEReeGRYzl4FyneUoyD2Hj DT3kfGRkPph5ZPI2hgMNpZ1cDjm3AaiZrGdgZj0OXeyFMjW/RVpp7ktihVY8bmLUz8KW cGNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cNFDofzihGaObOfHqqJ2HVpNlUxkNtFjsMxugxmx4xc=; b=G0nNRZsMTJHfcrdfHA7DwkXPP1Y4BPm3SqbJrCuKnyYQCLttRzfVosps3InQJXgejn 3XFq18uo6qHeC4MmxIip2m+4OdpwiyPRstyTO9hUikt6UAQPojt1cInPgbAtiMGIiIcb yFQDdiujLmqF2SHfuGyzM7lluCCLtp/6TcyKYf2hMaClrxEMR97ya9owlYaESEAzEq3a 95GqUCT0quT3sbMCx6qTgfEGghMQI0VN+t8XmI1vK9WdtkLc0KMdwOrKei4wt3mrrCEW 51SzNcxzUShszLaBMB2t94AV9sjfOxFwA6d3crqKSsMVREo05nEwse6rM0FLdknM0mqi /CdA== X-Gm-Message-State: AOAM5331gUEc+yVX2Y1lSi9wOlGZfJp0rqDADR7+wbZSsFayNDu3yzpD RvpGCLau7IU6j/iGNKcwkxwF2hsynqRZFuo9w9E= X-Google-Smtp-Source: ABdhPJwRCaHg/Jt8mz6zQ4YOQv7wSrjA042JZtKAwnaB4Dt0+Uvid+ukG4tOqOc1LAp302Ff8TeoMdfESDwCFEL0iVc= X-Received: by 2002:a19:4f07:: with SMTP id d7mr20628844lfb.447.1624910975618; Mon, 28 Jun 2021 13:09:35 -0700 (PDT) MIME-Version: 1.0 References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> <83tulhoon5.fsf@gnu.org> <83sg11omxc.fsf@gnu.org> In-Reply-To: <83sg11omxc.fsf@gnu.org> From: Matt Bisson Date: Mon, 28 Jun 2021 16:09:24 -0400 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) That's described in the initial report. I see it's called "term-mode" not "terminal-mode" which was a brain-fart on my part. The steps (term-mode in step 2): 1. Start "emacs -nw" 2. M-x term 3. In another application (for the purposes of "exact keystroke, let's say, Alt-TAB to Firefox"), copy some text into the clipboard, it doesn't matter what. 4. Return to the Emacs session (click on the Terminal emulator, Alt-TAB, whatever*), and paste into the terminal (I used Command-V). 4* To be clear, return the cursor to the term-mode buffer (e.g., C-b *terminal* ). Inject any mount of delays or operations between steps 1, 2, 3, and 4. The bug essentially is "if you ever paste into term-mode buffers, you lose. On Mon, Jun 28, 2021 at 2:37 PM Eli Zaretskii wrote: > > > From: Matt Bisson > > Date: Mon, 28 Jun 2021 14:11:56 -0400 > > Cc: 49253@debbugs.gnu.org > > > > No. (Unless I'm misunderstanding what you're asking) the problem can > > occur at any time. It's in response to simply pasting from the > > clipboard into a terminal application. I can start Emacs, run for > > days normally -- using terminal-mode, editing files, and so forth. > > The second I go into the terminal-mode buffer and paste from the > > (Windows, Mac, whatever) clipboard (NOT using the Emacs yank command), > > the problem happens. > > Wait a minute: what do you mean by "terminal-mode buffer" into which > you need to go? More generally, can you describe a detailed recipe > for reproducing the problem on your system, keystroke by keystroke? > > > > No, it's the other way around: you start Emacs from GDB. There are > > > some instructions in etc/DEBUG. > > > > Yes, I do know that's what you mean :) but it's not as if Emacs is > > going to crash, and stop in the debugger. > > You are investigating the error message saying "Failed select". > Search the *.c files for that text, and you will find only 3 instances > of it. Put a breakpoint in all these 3 places, then do whatever it > takes to reproduce the problem, and you will be able to collect the > information I asked about. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 29 08:10:03 2021 Received: (at 49253) by debbugs.gnu.org; 29 Jun 2021 12:10:04 +0000 Received: from localhost ([127.0.0.1]:53803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyCZ1-0003QW-Ix for submit@debbugs.gnu.org; Tue, 29 Jun 2021 08:10:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyCYz-0003Pj-SU for 49253@debbugs.gnu.org; Tue, 29 Jun 2021 08:10:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51840) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyCYu-0007CK-Nq; Tue, 29 Jun 2021 08:09:56 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1669 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyCYu-0005RG-Br; Tue, 29 Jun 2021 08:09:56 -0400 Date: Tue, 29 Jun 2021 15:09:58 +0300 Message-Id: <83lf6soort.fsf@gnu.org> From: Eli Zaretskii To: Matt Bisson In-Reply-To: (message from Matt Bisson on Mon, 28 Jun 2021 16:09:24 -0400) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> <83tulhoon5.fsf@gnu.org> <83sg11omxc.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Matt Bisson > Date: Mon, 28 Jun 2021 16:09:24 -0400 > Cc: 49253@debbugs.gnu.org > > 1. Start "emacs -nw" > 2. M-x term > 3. In another application (for the purposes of "exact keystroke, let's > say, Alt-TAB to Firefox"), copy some text into the clipboard, it > doesn't matter what. > 4. Return to the Emacs session (click on the Terminal emulator, > Alt-TAB, whatever*), and paste into the terminal (I used Command-V). > 4* To be clear, return the cursor to the term-mode buffer (e.g., C-b > *terminal* ). Maybe term-mode is simply incompatible with bracketed-paste feature (because they both call low-level keyboard input functions)? Does the problem go away if you switch to term-line-mode? If not, my suggestion is to disable the bracketed-paste support. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 29 11:06:33 2021 Received: (at 49253) by debbugs.gnu.org; 29 Jun 2021 15:06:34 +0000 Received: from localhost ([127.0.0.1]:55136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyFJp-00081U-MN for submit@debbugs.gnu.org; Tue, 29 Jun 2021 11:06:33 -0400 Received: from mail-lj1-f169.google.com ([209.85.208.169]:43880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyFJn-00081E-PN for 49253@debbugs.gnu.org; Tue, 29 Jun 2021 11:06:32 -0400 Received: by mail-lj1-f169.google.com with SMTP id f13so31535149ljp.10 for <49253@debbugs.gnu.org>; Tue, 29 Jun 2021 08:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JldTJavB+pRarfLSaCqnk4WuKXMtUDk+dtXIYT5Lvqs=; b=OGr7Vplyi0GDEEfObZ9gQ5N9nVslVxY12kL1Z1gJEqsw6dc5996uEUnFZoq82xhbsg QeJ/GK1TsE/LrkJRGd0/OvPc9vTfnheTNNHK2JybrYWoET7gMoXfYSm02EnZG+kzcDW6 AnW+E/ncBKoQjlQV44QmWBXlXOkYbNq9u/25+W5udiFzyYuehjhpOymQXgjAFcT9wQnm lJfn4s/VxZ4YdNCw+ppp6PNYHrFEdHhZ6Ab5J+KpJlauJS1agGsDnuAPUSp8HIKTb+Ai w5CWw5/49K9D7EQGF345fwD2DZi8nXFEPGYyuA0QWsyUwH3/v4ijeVNftUIjPiI57bSQ 1Sdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JldTJavB+pRarfLSaCqnk4WuKXMtUDk+dtXIYT5Lvqs=; b=HXOxVc7YZ2H18NTiY2sS+wgS/9MZ6guiqdzkhY0/TaIMavFqrIXw9gmsZPTimien9g +EDitdDa41Gg5FXLCXZQo72WiPI/Ok5E9QeVL1up5/V1HnckFY4I7+WLUWAaIzoBB7Iw K4d4MLtZgm2Mh65IrETssSnZ33vETdWDH0dJnDOM2Oo83bYBJ3sxI4xmTCbrnkjE2jTv vMib5N/aU46guZ/p+V3in9ax+7xzeoCxPH1H9bKN+aYKjGxMcTvzzsNfCsrRWQctukGT KrT4CPe7p7yum0OhRnexoN4Tcux1Ti4o285cmqseEe/CZSCjt3zvo5I51nhltcs+U+uh xJjA== X-Gm-Message-State: AOAM530hPaJMi8rmXkUYc6pJe4ys5BCT0lfQFBcyEkFs7qMDwYoCCmxX rpy/wHAkX+2BBGe566cVyDhaGQOqE4S8LADIgfM= X-Google-Smtp-Source: ABdhPJxrcrWGHVabiAyMSFz7mpW9Jj9h0aegYUe9T4QUgG86BkhyzN6o7dOieIkjUm+cO87QpqytJqfSasL/70GGztI= X-Received: by 2002:a2e:2f14:: with SMTP id v20mr4393657ljv.363.1624979185700; Tue, 29 Jun 2021 08:06:25 -0700 (PDT) MIME-Version: 1.0 References: <83zgvand0j.fsf@gnu.org> <83wnqdoq6t.fsf@gnu.org> <83tulhoon5.fsf@gnu.org> <83sg11omxc.fsf@gnu.org> <83lf6soort.fsf@gnu.org> In-Reply-To: <83lf6soort.fsf@gnu.org> From: Matt Bisson Date: Tue, 29 Jun 2021 11:06:14 -0400 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ah, I didn't think about just term-line-mode. I'd have expected it to work, and indeed it does. No problems in that mode. I'm still working on debugging, fwiw (not a lot of time today). My ToT emacs repo wasn't building. On Tue, Jun 29, 2021 at 8:09 AM Eli Zaretskii wrote: > > > From: Matt Bisson > > Date: Mon, 28 Jun 2021 16:09:24 -0400 > > Cc: 49253@debbugs.gnu.org > > > > 1. Start "emacs -nw" > > 2. M-x term > > 3. In another application (for the purposes of "exact keystroke, let's > > say, Alt-TAB to Firefox"), copy some text into the clipboard, it > > doesn't matter what. > > 4. Return to the Emacs session (click on the Terminal emulator, > > Alt-TAB, whatever*), and paste into the terminal (I used Command-V). > > 4* To be clear, return the cursor to the term-mode buffer (e.g., C-b > > *terminal* ). > > Maybe term-mode is simply incompatible with bracketed-paste feature > (because they both call low-level keyboard input functions)? > > Does the problem go away if you switch to term-line-mode? If not, my > suggestion is to disable the bracketed-paste support. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 16 08:21:54 2022 Received: (at 49253) by debbugs.gnu.org; 16 Jul 2022 12:21:55 +0000 Received: from localhost ([127.0.0.1]:43156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCgny-00016N-Jy for submit@debbugs.gnu.org; Sat, 16 Jul 2022 08:21:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCgnw-000169-8w for 49253@debbugs.gnu.org; Sat, 16 Jul 2022 08:21:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=v3lCu9g1nNsj2iIIeuO8o93jIDYAC5x+EqPMbo2cmzY=; b=tOATF5Q9xMVG3w6SoWZ+icQZ+J +MJ/UJhiCKSEzmBPIJTc6K8WtCWQYmfHItTxIZF2S7y2JeVoocD841RhojAdIs8dcPY72kOF/PDrY r9dbFAed1LP8kQtbhkF6Gu4ea3A7QgFA412tNEDCLLjoYapIbgn98Z8FfapgP7PtwWZo=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCgnn-0001wE-PX; Sat, 16 Jul 2022 14:21:46 +0200 From: Lars Ingebrigtsen To: Matt Bisson Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode In-Reply-To: (Matt Bisson's message of "Mon, 28 Jun 2021 10:28:59 -0400") References: X-Now-Playing: Xeno & Oaklander's _Vi-deo_: "Movie Star" Date: Sat, 16 Jul 2022 14:21:43 +0200 Message-ID: <87r12lqmco.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: 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: Fa [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 16 08:21:59 2022 Received: (at control) by debbugs.gnu.org; 16 Jul 2022 12:21:59 +0000 Received: from localhost ([127.0.0.1]:43159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCgo2-00016g-Sk for submit@debbugs.gnu.org; Sat, 16 Jul 2022 08:21:59 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCgo0-00016E-Qk for control@debbugs.gnu.org; Sat, 16 Jul 2022 08:21:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QR4Wfgv1WAMFesylDPaD3eRqezSv/kueo0+XEALRMms=; b=mrL1EgFKqokiTRhQQ4oGw0WKt+ l+29So3tcXZpIH1IIKP3Frp2yDqqJkoPlK41w8PJoEVcVY4/q8bZ/jmmSLN6rZNJQe2zS2x9HsbkS CgMF7bkC1tPS9fTBWVIbzeW1wYKxsCelXdYfaBVn3zLVGeccrYUsSvk80T8gZIpfgioY=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCgns-0001wN-OV for control@debbugs.gnu.org; Sat, 16 Jul 2022 14:21:50 +0200 Date: Sat, 16 Jul 2022 14:21:47 +0200 Message-Id: <87pmi5qmck.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49253 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 49253 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 49253 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 16 15:13:34 2022 Received: (at 49253) by debbugs.gnu.org; 16 Jul 2022 19:13:34 +0000 Received: from localhost ([127.0.0.1]:46079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnEM-0004Ka-8A for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:13:34 -0400 Received: from mail-vs1-f52.google.com ([209.85.217.52]:40910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnEJ-0004KO-T6 for 49253@debbugs.gnu.org; Sat, 16 Jul 2022 15:13:32 -0400 Received: by mail-vs1-f52.google.com with SMTP id 125so7073224vsx.7 for <49253@debbugs.gnu.org>; Sat, 16 Jul 2022 12:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MGwKhQkIiW5Afd0aMt196koiUVKzWC5THsyH1taluWQ=; b=k8iTYzvrf/YWwEGV8tychHH/Sv0nJLqv+bT7JV16sYZL6AqbCk/TSKrg/dln5I5iC/ foVs+mpCkRJioS/8/QTpgLaz9hBwvxoWI4f4XejXYMgWUSSY/6zrE4b/eDtIoWCy9c+g NVrq2gO5127jG8dPO+odEjZopsVxo8oDW45HSdYKCZ2F4XjHYue6hqbZ6K/e9CnoU2bH Cajwgpj4Tk2UZNy+Tnqy3zEFuEPjobxoe2EYU01s3zS2fQ2P893u8H/zgtNhn5a0qipm 2V8V5cbDEiPdQSJGYBl4csxc023GXzVpED8V3PeuUo+92aNov0ajp9YDXfkPOAOyjCHD K+FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MGwKhQkIiW5Afd0aMt196koiUVKzWC5THsyH1taluWQ=; b=rIdeUQpXUG1MlBIW5uTmvG743IRnVLHR0uyM/ZTo8BAsj3rG9bI5DAzgilUfL+abya kaHWDvjkw2pkxiPgdR9nSyyMgW0d1K+nPCwDTZDnt6VwMeRw9YKhav/ujxQYHjnDmhl6 cojgR0xDd9phYLuzxIzv+w2j9yMSUGEo0EGZ87DHa0K1FVTl5uiPHm5uiyQSPc5sHqlH mxi99VoVUzk/LL2bsGY4YDFIFS6HtNNhJ8QMGCzHP8aDLOnwGCh1nh7Ap33xNpCi9jwU siLXReqyHYd3vOARzd1B5UNbHKVT0PWY790qlj+XuIf29TaedT5rFm036fntguL9nUyt uejw== X-Gm-Message-State: AJIora+pZ+1LCf8nY5ttYI3myrtM0bprygRd1InouWpRt82T1KzpNpE7 irHHt/tHyUKZkWd9ht+TkzJsYw26oriQKtMgLVs= X-Google-Smtp-Source: AGRyM1uOKURrObJfxaMiPMenTF4aWemRIesz3R55GaFMAbRZfc6zUn6S4fSr5Jt4urI9rQzMiwL8Q1YJbME/BhlndOg= X-Received: by 2002:a67:c11d:0:b0:357:22d7:fe29 with SMTP id d29-20020a67c11d000000b0035722d7fe29mr7307692vsj.30.1657998805173; Sat, 16 Jul 2022 12:13:25 -0700 (PDT) MIME-Version: 1.0 References: <87r12lqmco.fsf@gnus.org> In-Reply-To: <87r12lqmco.fsf@gnus.org> From: Matt Bisson Date: Sat, 16 Jul 2022 15:13:14 -0400 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Lars Ingebrigtsen Content-Type: multipart/alternative; boundary="000000000000d2091105e3f0ed18" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000d2091105e3f0ed18 Content-Type: text/plain; charset="UTF-8" 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 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 > --000000000000d2091105e3f0ed18 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
For sure.=C2=A0 Even in emacs 28.2, if I want to paste so= mething into the terminal buffer, I have to switch to line mode, and back w= hen I'm done.=C2=A0 You just can't paste into the terminal buffer i= n terminal emacs in key mode.

On Sat, Jul 16, 2022, 8:21 AM Lars Ingebrigts= en <larsi@gnus.org> wrote:
<= /div>
Matt Bisson <bisson.m@gmail.com&= gt; 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
--000000000000d2091105e3f0ed18-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 15 10:40:25 2022 Received: (at control) by debbugs.gnu.org; 15 Aug 2022 14:40:25 +0000 Received: from localhost ([127.0.0.1]:43805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNbGT-0003gF-FT for submit@debbugs.gnu.org; Mon, 15 Aug 2022 10:40:25 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNbGR-0003fn-KX for control@debbugs.gnu.org; Mon, 15 Aug 2022 10:40:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hZb96OBGXvl2tXXg0AK1kXT7ROEeDTBf5s4OP7OioRA=; b=hFpF/srT85maQP0kOnCfwBCesz UEj2oNvn1oY528h0Vqp4VpS5Y1AWeWwNx+kMIgUEVEMKusUmHUauODuUi+UAlj0H/5o/mTYGK2Zuh HOWprLAsg0d1nzbHndwugDHbVSJmM6Xpej/23pJuDrhHkpFIjlL+B2Y91k5m/kvezu6A=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNbGJ-0008Sg-Ov for control@debbugs.gnu.org; Mon, 15 Aug 2022 16:40:17 +0200 Date: Mon, 15 Aug 2022 16:40:15 +0200 Message-Id: <87zgg51sfk.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49253 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 49253 - moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 49253 - moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 08 14:06:38 2023 Received: (at 49253) by debbugs.gnu.org; 8 Dec 2023 19:06:38 +0000 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 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 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) MIME-Version: 1.0 References: <87r12lqmco.fsf@gnus.org> In-Reply-To: From: Matt Bisson Date: Fri, 8 Dec 2023 14:06:05 -0500 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Lars Ingebrigtsen Content-Type: multipart/alternative; boundary="000000000000552ae1060c04471a" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --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-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 08 15:36:24 2023 Received: (at 49253) by debbugs.gnu.org; 8 Dec 2023 20:36:24 +0000 Received: from localhost ([127.0.0.1]:46292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBhaB-0008VC-M6 for submit@debbugs.gnu.org; Fri, 08 Dec 2023 15:36:24 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:46377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBhZv-0008TJ-1e for 49253@debbugs.gnu.org; Fri, 08 Dec 2023 15:36:22 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-50bf898c43cso2438916e87.1 for <49253@debbugs.gnu.org>; Fri, 08 Dec 2023 12:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702067748; x=1702672548; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Q0liWEYRNqw4J4luJ6YC85N8KYMERvvZotWEGFd3jK8=; b=Yaqsr3408i+c+eu1U814ZZKPN4Ij3XxKsA6YZ06t7mRUhxRvN2G8CYmtBCFrQbpkij h1MzhETv+ohM815XKzVcGAUSC6dM1RsNBLwt6/pujSSBkHOFOsNY06hxCBjQcANbDgch NqXtSXiAfM0zJHHbYIDpN8EYe7S1K+j3kqbi4iSzjuVTK6co7lHnUIU1NwgnM9Lnfy2k 5lyW9K3DG9VAYsmOGI8Mc6cgCMbg58CC1A9Apv5OnHuDKkiaRcB4PvO23Rm31KgT4r17 szCIHXO6iKSGQaPklPug/PBnJw5I4WxwT0fWpmFvNBehxqyiYz9FjKObBKDEuvZNCYDc yR2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702067748; x=1702672548; h=content-transfer-encoding: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=Q0liWEYRNqw4J4luJ6YC85N8KYMERvvZotWEGFd3jK8=; b=bOFDwavvW1PIyKeYacXjeDjdNzzuqbxktKDobY8MAZxhojyu4BDUTFmWyXyZKzuzwg 56vykk0sSMlmSYUbhWG1j3+pZ/C4KK5P3U9JdUIur13QMdfvhvjS8AOgZdyp/msNZwva ExnoSMCtjfdxfDUKQAiYmpUjcRjCQzMx0at6zK3KYVc7n1iJt7zBYuiAzwGZFBM8TwOu k5I1DZJ7q1lM7SPGn9JGlVUSrClZ0HlAH3ZTJZCNj4sHq0M38VJnr4cqaFHxpA7RAZKf 98jcDO4Gv9QNtJLJUSLWUZxS55F5bBD6CB3B2tORXwyUgEdKcj7xM/W93pysGrbRKmyY zfPA== X-Gm-Message-State: AOJu0Yw6vvvvKncyY5S/h86JZafGmhL6lnV24S1U+IaCs+j/s8r473W3 zxyaBYXniM1BO1GTIx/aDL8Ch82u6ERme+EMr48= X-Google-Smtp-Source: AGHT+IH+o6o1CdNfN6tuzUYthzvjMK+Fx5ArVPPIyfPYgiu82OvlDl90NXdT2pR7gFFIbH68peL+KJxv8UAKjf/wpmc= X-Received: by 2002:a05:6512:218e:b0:50c:f12:6daf with SMTP id b14-20020a056512218e00b0050c0f126dafmr128400lft.69.1702067747452; Fri, 08 Dec 2023 12:35:47 -0800 (PST) MIME-Version: 1.0 References: <87r12lqmco.fsf@gnus.org> In-Reply-To: From: Matt Bisson Date: Fri, 8 Dec 2023 15:35:36 -0500 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Lars Ingebrigtsen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Right, so this silly little fix works, but it's an obvious hack. I clearly don't know enough about how the key-bindings work, because I would have expected those set by term-mode to override those in the global keybindings (from xterm.el), but they don't. The xterm.el one runs first. Here's the diff: diff --git a/lisp/term.el b/lisp/term.el index 81746e0c20d..e047fa767e8 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -956,6 +956,7 @@ term-raw-map (define-key map [?\C- ] #'term-send-C-@) (define-key map [?\C-\M-/] #'term-send-C-M-_) (define-key map [?\C-\M- ] #'term-send-C-M-@) + (define-key map "\e[200~" #'term--xterm-paste) (when term-bind-function-keys (dotimes (key 21) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 5ed4e46e0a5..117bd131123 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -149,7 +149,8 @@ xterm--suspend-tty-function ;; looping on read-key and buffering input for later processing. (defun xterm-translate-bracketed-paste (_prompt) - (vector (list 'xterm-paste (xterm--pasted-text)))) + (unless (and (eq major-mode 'term-mode) (term-in-char-mode)) + (vector (list 'xterm-paste (xterm--pasted-text))))) (defvar xterm-rxvt-function-map (let ((map (make-sparse-keymap))) On Fri, Dec 8, 2023 at 2:06=E2=80=AFPM Matt Bisson wro= te: > > I've finally had some time to look at this and what's happening is term/x= term.el is fighting with term.el. The bracketed paste command comes in wit= h "\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-tra= nslate-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-p= aste] key as well (it has also registered a binding for "raw" mode), and be= gins the same process of xterm--pasted-text. At this point, there's nothin= g 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 ins= erted via term-send-raw-string. > > -Matt > > On Sat, Jul 16, 2022 at 3:13=E2=80=AFPM Matt Bisson = wrote: >> >> For sure. Even in emacs 28.2, if I want to paste something into the ter= minal buffer, I have to switch to line mode, and back when I'm done. You j= ust can't paste into the terminal buffer in terminal emacs in key mode. >> >> 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 eithe= r >>> > 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 09 06:11:30 2023 Received: (at 49253) by debbugs.gnu.org; 9 Dec 2023 11:11:30 +0000 Received: from localhost ([127.0.0.1]:46893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBvF3-00016U-JT for submit@debbugs.gnu.org; Sat, 09 Dec 2023 06:11:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBvF1-00016H-6J for 49253@debbugs.gnu.org; Sat, 09 Dec 2023 06:11:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBvEi-0008QS-22; Sat, 09 Dec 2023 06:11:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=hjbtOyR3uG7KPizZ6Ij1e+tLgo4J5At8p1/cWdIqOb8=; b=KcT0IQVPf4/RGWFFgeAG 7c0hnrlmMlfSaGW+dvIr19OJJVu2W9YmP7j4Eim3IPwHna7aL/ZIb8AtIYnsTtp5k93O6YA/OasFW qEuaEwC9Qip4Z2ZR4El1/gNaN8/pMhRbsQG6r3X1fyL4q/BpL+lELyPIPx+4RJN1C98ZFNZmenkIJ vKIn+oxPWK/+S0m4BvPSRQSAEcht1gJN5TLisHxaCWN0kbsf0hakS/lgPuH/1vTQwsuHK7CJMfbcL AI/kusud0l6DIhQ1WjVYOk72KnECNr7Kd/x6Q5EFVzVPOxLzmg0htHNtLciTDk4Kl4LVaT1sTBG55 OTxnkYdRcEpwkw==; Date: Sat, 09 Dec 2023 13:10:52 +0200 Message-Id: <838r63y6kj.fsf@gnu.org> From: Eli Zaretskii To: Matt Bisson , Jared Finder In-Reply-To: (message from Matt Bisson on Fri, 8 Dec 2023 15:35:36 -0500) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: <87r12lqmco.fsf@gnus.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253 Cc: larsi@gnus.org, 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Jared, can I ask you to look into this and share your thoughts and comments to the proposed change? TIA. > Cc: 49253@debbugs.gnu.org > From: Matt Bisson > Date: Fri, 8 Dec 2023 15:35:36 -0500 > > Right, so this silly little fix works, but it's an obvious hack. I > clearly don't know enough about how the key-bindings work, because I > would have expected those set by term-mode to override those in the > global keybindings (from xterm.el), but they don't. The xterm.el one > runs first. Here's the diff: > > diff --git a/lisp/term.el b/lisp/term.el > index 81746e0c20d..e047fa767e8 100644 > --- a/lisp/term.el > +++ b/lisp/term.el > @@ -956,6 +956,7 @@ term-raw-map > (define-key map [?\C- ] #'term-send-C-@) > (define-key map [?\C-\M-/] #'term-send-C-M-_) > (define-key map [?\C-\M- ] #'term-send-C-M-@) > + (define-key map "\e[200~" #'term--xterm-paste) > > (when term-bind-function-keys > (dotimes (key 21) > diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el > index 5ed4e46e0a5..117bd131123 100644 > --- a/lisp/term/xterm.el > +++ b/lisp/term/xterm.el > @@ -149,7 +149,8 @@ xterm--suspend-tty-function > ;; looping on read-key and buffering input for later processing. > > (defun xterm-translate-bracketed-paste (_prompt) > - (vector (list 'xterm-paste (xterm--pasted-text)))) > + (unless (and (eq major-mode 'term-mode) (term-in-char-mode)) > + (vector (list 'xterm-paste (xterm--pasted-text))))) > > (defvar xterm-rxvt-function-map > (let ((map (make-sparse-keymap))) > > > On Fri, Dec 8, 2023 at 2:06 PM Matt Bisson wrote: > > > > 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 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 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 > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 09 16:39:10 2023 Received: (at 49253) by debbugs.gnu.org; 9 Dec 2023 21:39:11 +0000 Received: from localhost ([127.0.0.1]:49113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rC52U-0007da-GK for submit@debbugs.gnu.org; Sat, 09 Dec 2023 16:39:10 -0500 Received: from greenhill.hpalace.com ([192.155.80.58]:37070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rC52P-0007dP-RQ for 49253@debbugs.gnu.org; Sat, 09 Dec 2023 16:39:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=finder.org; s=2018; t=1702157930; bh=wDzlQC6JZbYx3Z8VVqxYskX/I8lgktMSj3QZGeFltlQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lZyEcGKvsd96IYsf3IM2W9yRTpyvx7mpp2sjNrunGWry2B4q0RJL3feSMPMmCrdLP 9QzscC1BbhBaTkXIfGKn4bvBOYGXpcedCCWdF0pX2TPXnH6S05BHup/JWCOud0DhHe NREF07SuKU/W8KLQSh5NdRWiGC+50YHKvciOAddI+Dom+NhGYW73t/dPfxbOpUu7/t qC+xMmagacj1fSZBNUdoutaricqEPratkAS2F5c7Rq+qOUE2Eq6f3GMsD/2BFjrimO xTYe7DRarZ5SEmRNSL8HLWHIclwdY10h6wPDiOoe6yj6qIoBzZpBXCV4ZcC9wj8NYs xCUklpsmzlwCg== Received: from mail.finder.org (unknown [192.155.80.58]) by greenhill.hpalace.com (Postfix) with ESMTPSA id C67BC48C6; Sat, 9 Dec 2023 21:38:50 +0000 (UTC) MIME-Version: 1.0 Date: Sat, 09 Dec 2023 13:38:50 -0800 From: Jared Finder To: Eli Zaretskii Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode In-Reply-To: <838r63y6kj.fsf@gnu.org> References: <87r12lqmco.fsf@gnus.org> <838r63y6kj.fsf@gnu.org> Message-ID: <11108ebcb87fae9390410fa4f3355967@finder.org> X-Sender: jared@finder.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: larsi@gnus.org, Matt Bisson , 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2023-12-09 03:10, Eli Zaretskii wrote: > Jared, can I ask you to look into this and share your thoughts and > comments to the proposed change? TIA. > >> Cc: 49253@debbugs.gnu.org >> From: Matt Bisson >> Date: Fri, 8 Dec 2023 15:35:36 -0500 >> >> Right, so this silly little fix works, but it's an obvious hack. I >> clearly don't know enough about how the key-bindings work, because I >> would have expected those set by term-mode to override those in the >> global keybindings (from xterm.el), but they don't. The xterm.el one >> runs first. Here's the diff: >> >> diff --git a/lisp/term.el b/lisp/term.el >> index 81746e0c20d..e047fa767e8 100644 >> --- a/lisp/term.el >> +++ b/lisp/term.el >> @@ -956,6 +956,7 @@ term-raw-map >> (define-key map [?\C- ] #'term-send-C-@) >> (define-key map [?\C-\M-/] #'term-send-C-M-_) >> (define-key map [?\C-\M- ] #'term-send-C-M-@) >> + (define-key map "\e[200~" #'term--xterm-paste) >> >> (when term-bind-function-keys >> (dotimes (key 21) Thanks for the investigation. I don't think this is the right approach. The xterm escape codes all go through input-decode-map and I would expect to preserve that. Looking at code, the current behavior in xterm.el is the following: Step 1: \e[200~ is put on input-decode-map, using xterm-translate-backeted-paste to decode. Step 2: The function xterm-translate-bracketed-paste reads the pasted text and creates an event (xterm-paste "PASTED TEXT HERE") Step 3: Globally, the event xterm-paste is bound to the function also named xterm-paste, which grabs the pasted text and puts it on the kill ring, then runs the function insert-for-yank. Step 3a: In Term mode, the event xterm-paste is instead bound to the function term--xterm-paste. However, instead of reading the pasted text off the event, it calls (xterm-pasted-text) again. I think the correct fix is to change term--xterm-paste to read the pasted text off of the event generated in Step 2. So something like the following (a real fix would add error checking like in xterm-paste): (defun term--xterm-paste (event) "Insert the text pasted in an XTerm bracketed paste operation." (interactive "e") (term-send-raw-string (nth 1 event))) Matt, can you try this change locally? It worked for me. -- MJF From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 11 11:10:57 2023 Received: (at 49253) by debbugs.gnu.org; 11 Dec 2023 16:10:57 +0000 Received: from localhost ([127.0.0.1]:54379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCirx-000819-5w for submit@debbugs.gnu.org; Mon, 11 Dec 2023 11:10:57 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:57821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCiru-00080t-I8 for 49253@debbugs.gnu.org; Mon, 11 Dec 2023 11:10:55 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2cb20c82a79so43392471fa.3 for <49253@debbugs.gnu.org>; Mon, 11 Dec 2023 08:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702311034; x=1702915834; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dWbBsKcubFXSBRzw+Q8+pVQNmcaY3bmARhBPk8XvFS8=; b=Y/mQyqkpcOPt399k/7ypNPccd/Mp//6Oz3XKjz0vVxg9K/kPhtxzLV/JVx0H2pobcb MVmAE1uh66BLpc0CoW0OQQ6TMCVyPjigH9EhgQxIWOmL2HugP+C6tUj6oZNxXDmYBYpD r5hrsQFeXIqPjVizuSV1oKmISzseT2X8zv3AVODhipsSc9ZRaquuF2SmtqLe7nbVy0Z5 7G0rYV2Lt3X4ClF5KVq6fQAGnBFCMQiFuWdDDXm6e3aFuGX49OSa43egLD/gR+VyUUzO cafKxCmXWrXjOHusJ7c1esn9GeIirTXNZjQWVJx3ZP6uGmaGWk0DE85HF7eL8hvTTFGd +tew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702311034; x=1702915834; h=content-transfer-encoding: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=dWbBsKcubFXSBRzw+Q8+pVQNmcaY3bmARhBPk8XvFS8=; b=pY2DvV50Idl3di8Ob5KOziY86ToiY/jnrNGaqXkKn7jqXJRD01uI1jN8A3EU5cz7Q3 4h4UoeX52zIDEOmJh7fUk2efFLjpiHBlLUv5yy7JP1qYZ9d9at3GD8Yf3qceCLjte9o2 1tOB2MK0SaJHrwoyj5LyYiTGLPZ5wSbwKG9Xj15dtbwa2YwAMTjMT5q8ENr5zzO1neMu 58rj/yGe2l3fF7PN4Qw0Wi9n7wVIMu1nwB5J9bIiIpPRZ28ZbkGoK09281wA0BIAc7fR cWcxgMdfE8Gnu1SLHaVsm9J8h+vG27GcjdHEhzMoXOkrSMUO/1W+mSYausrStG9FIfIG Cuyw== X-Gm-Message-State: AOJu0YxgBAIYtOaIgYHDIYKEMo2VKqzZ+J+w+E+iT+CxEk980gxEywCV yTWf4WC4lsXeAuoSpMewvk8lE7E677nKYPDvqbg= X-Google-Smtp-Source: AGHT+IHmEX9svf6l6iMawJ3czFgOFOOq4thc7Aq84TXLuVYmLXp2YvOek7IZvqSfjqdP0sOYdTI9y6d5DQkorPCtVWs= X-Received: by 2002:a05:651c:88:b0:2ca:41b:74db with SMTP id 8-20020a05651c008800b002ca041b74dbmr1622048ljq.47.1702311033318; Mon, 11 Dec 2023 08:10:33 -0800 (PST) MIME-Version: 1.0 References: <87r12lqmco.fsf@gnus.org> <838r63y6kj.fsf@gnu.org> <11108ebcb87fae9390410fa4f3355967@finder.org> In-Reply-To: <11108ebcb87fae9390410fa4f3355967@finder.org> From: Matt Bisson Date: Mon, 11 Dec 2023 11:10:22 -0500 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Jared Finder Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: Eli Zaretskii , larsi@gnus.org, 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) TL;DR: It works! > I don't think this is the right approach. Totally! :) The patch was definitely not a serious suggestion of what should be submitted, but just a demonstration that the interplay between the two functions is causing the issue, and it can be solved by touching only that. I haven't built up the knowledge of how these events function like you have, and was hoping you'd teach me a bit in response, and you did! The solution works for XTerm pasting into a scratch buffer, into a term buffer with line-mode enabled, and most notably, with char-mode enabled. As I use term-mode for basically everything I do in a terminal on a daily basis, this will make my life significantly nicer, so thanks for the fix! On Sat, Dec 9, 2023 at 4:38=E2=80=AFPM Jared Finder wrot= e: > > On 2023-12-09 03:10, Eli Zaretskii wrote: > > Jared, can I ask you to look into this and share your thoughts and > > comments to the proposed change? TIA. > > > >> Cc: 49253@debbugs.gnu.org > >> From: Matt Bisson > >> Date: Fri, 8 Dec 2023 15:35:36 -0500 > >> > >> Right, so this silly little fix works, but it's an obvious hack. I > >> clearly don't know enough about how the key-bindings work, because I > >> would have expected those set by term-mode to override those in the > >> global keybindings (from xterm.el), but they don't. The xterm.el one > >> runs first. Here's the diff: > >> > >> diff --git a/lisp/term.el b/lisp/term.el > >> index 81746e0c20d..e047fa767e8 100644 > >> --- a/lisp/term.el > >> +++ b/lisp/term.el > >> @@ -956,6 +956,7 @@ term-raw-map > >> (define-key map [?\C- ] #'term-send-C-@) > >> (define-key map [?\C-\M-/] #'term-send-C-M-_) > >> (define-key map [?\C-\M- ] #'term-send-C-M-@) > >> + (define-key map "\e[200~" #'term--xterm-paste) > >> > >> (when term-bind-function-keys > >> (dotimes (key 21) > > Thanks for the investigation. I don't think this is the right approach. > The xterm escape codes all go through input-decode-map and I would > expect to preserve that. > > Looking at code, the current behavior in xterm.el is the following: > > Step 1: \e[200~ is put on input-decode-map, using > xterm-translate-backeted-paste to decode. > > Step 2: The function xterm-translate-bracketed-paste reads the pasted > text and creates an event (xterm-paste "PASTED TEXT HERE") > > Step 3: Globally, the event xterm-paste is bound to the function also > named xterm-paste, which grabs the pasted text and puts it on the kill > ring, then runs the function insert-for-yank. > > Step 3a: In Term mode, the event xterm-paste is instead bound to the > function term--xterm-paste. However, instead of reading the pasted text > off the event, it calls (xterm-pasted-text) again. > > I think the correct fix is to change term--xterm-paste to read the > pasted text off of the event generated in Step 2. So something like the > following (a real fix would add error checking like in xterm-paste): > > (defun term--xterm-paste (event) > "Insert the text pasted in an XTerm bracketed paste operation." > (interactive "e") > (term-send-raw-string (nth 1 event))) > > Matt, can you try this change locally? It worked for me. > > -- MJF From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 11 17:13:43 2023 Received: (at 49253) by debbugs.gnu.org; 11 Dec 2023 22:13:43 +0000 Received: from localhost ([127.0.0.1]:54860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCoX0-0004R4-VQ for submit@debbugs.gnu.org; Mon, 11 Dec 2023 17:13:43 -0500 Received: from greenhill.hpalace.com ([192.155.80.58]:51864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCoWy-0004Qu-UT for 49253@debbugs.gnu.org; Mon, 11 Dec 2023 17:13:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=finder.org; s=2018; t=1702332805; bh=MPtj42VMJejUItGawnMyN9lY9DaRvyKLy6Q6dp1dIt8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=zN1ifs1WOptxElTzII1zQy5WfqAbi8BNpyTBQkuOE8oacI+jd3psRluLaUWW5HbEI aJ4dzZy8KmZv/WuJlBS4QSc0Dik0aZKsPPRTRZq0yTBx5gHq5WIcXuv5ClmjKFyKpS XFeqOu4Z6MfsWl1vD+JjVjf6IJ+MPIx2u/l+TcCDLpVwdyNtDP/xpe4f77bsfcCC2O 9/E7sZgc59DTilx1xqGnQZbZT68EiGf3ffvenQ/0DV8diNlVgST5TbvK/LSGH5/e7f q7czwqGMpFj+QiScJQuJLXNXwfWQFKJpLT+eca3MrkqcN2vHO2mTGmpeSvtSpe3YfD fKF86nnZUt2Dw== Received: from mail.finder.org (unknown [192.155.80.58]) by greenhill.hpalace.com (Postfix) with ESMTPSA id F0E4F9A8; Mon, 11 Dec 2023 22:13:24 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 11 Dec 2023 14:13:24 -0800 From: Jared Finder To: Matt Bisson Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode In-Reply-To: References: <87r12lqmco.fsf@gnus.org> <838r63y6kj.fsf@gnu.org> <11108ebcb87fae9390410fa4f3355967@finder.org> Message-ID: <5d8850165ca6f3d344e764397339abf0@finder.org> X-Sender: jared@finder.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: Eli Zaretskii , larsi@gnus.org, 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2023-12-11 08:10, Matt Bisson wrote: > TL;DR: It works! Thank you for the testing! Eli, I think the fully correct definition for term--xterm-paste is the following, which has additional error checking: (defun term--xterm-paste (event) "Insert the text pasted in an XTerm bracketed paste operation." (interactive "e") (unless (eq (car-safe event) 'xterm-paste) (error "term--xterm-paste must be found to xterm-paste event")) (let ((str (nth 1 event))) (unless (stringp str) (error "term--xterm-paste provided event does not contain paste text")) (term-send-raw-string str))) >> I don't think this is the right approach. > > Totally! :) The patch was definitely not a serious suggestion of what > should be submitted, but just a demonstration that the interplay > between the two functions is causing the issue, and it can be solved > by touching only that. I haven't built up the knowledge of how these > events function like you have, and was hoping you'd teach me a bit in > response, and you did! No worries! I hope I didn't come across as judgemental here. :) If you want a bit more detail around the architecture here, read on (Eli, please correct if I get anything wrong): In Emacs, in addition to the local and global keymaps, there are also translation keymaps. (https://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html) The docs are accurate but a bit hard to understand without concrete examples. So let me provide an example for each of the translation keymaps. There are three of them: 1. input-decode-map. This exists to translate terminal escape sequences into the their proper events. That can be for keys (like the PF1 key mentioned in the docs) but it also an be for mouse clicks or the xterm paste operation. EXAMPLE: This bug! In this bug, input-decode-map is what translates the character sequence "ESC [ 2 0 0 ~ PASTED TEXT HERE ESC [ 2 0 1 ~" into a single event, (xterm-paste "PASTED TEXT HERE"). It does this by mapping "ESC [ 2 0 0 ~" to a function that reads until encountering the "ESC [ 2 0 1 ~" sequence and returns that new event. 2. (local-)function-key-map. This exists to rename keys to more preferred names that allow keybindings to be shared. The docs say "the remapping only applies if the original key sequence would otherwise not have any binding", this is to allow you to use the native keynames on your keyboard if you do want to distinguish. EXAMPLE: Many keyboards have a separate keypad number area. These keys get their own events, e.g. "" for the zero character on the keypad. Emacs uses function-key-map to translate "" into "0", so pressing the keypad 0 acts the same as the number row 0. If you wanted to map the keypad numbers to a different set of commands, you can still do so with the original "" key. If you do so, that also implicitly overrides this translation. 3. key-translation-map. I've never actually used this directly so I'm not entirely clear on its intent. The docs make it sound like it is intended for changing keyboard layouts. Which explains why I have never used it -- I generally use OSes that allow keyboard layout translating natively. EXAMPLE: Based on my guess above, key-translation-map would let me map between QWERTY and Dvorak inside Emacs. This would be nice if I was running directly in a Linux terminal and did not have permission to run "sudo loadkeys". As a final note, notice that all three of these examples involve changing a key into a different key. None of them are for binding commands. Commands being bound to a key always is the job of the local and global keymaps. I hope these examples help you understand the setup here! -- MJF From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 13 14:26:54 2023 Received: (at 49253) by debbugs.gnu.org; 13 Dec 2023 19:26:54 +0000 Received: from localhost ([127.0.0.1]:59694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDUsg-0007yp-2x for submit@debbugs.gnu.org; Wed, 13 Dec 2023 14:26:54 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:51378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDUsc-0007yb-De for 49253@debbugs.gnu.org; Wed, 13 Dec 2023 14:26:53 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ca00dffc23so93205211fa.2 for <49253@debbugs.gnu.org>; Wed, 13 Dec 2023 11:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702495588; x=1703100388; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hsm7Hd1tfmXNjP7ExDTGzsMsdLsbSJzwV9FaijljnYY=; b=KDjOXoxPgLYptDnRdSHY8/HpvEBsh7dn4eKXB/4O4xMdxyAM/8/fQJhmE9ryNkWEx1 Y0W4Na50q72Nj1x+9MKda46ySJNTxk49ntrAOFxUXgoBl18PBvKtUYcCcMOzSHEQhhH1 +zcA1x4z57QTwuHlw6nCZuwFF8wAUNSQnKI/RDgVeDzw/KEI42U2hbSdbJk1u58kWfbP DJCZT03F0Fl0iBH97OnVJBHsVFDLct1nKmFQNq1RqNyJz2qVxUROgrBENyAQk0VB8bil uElZ1Ix6hM+49vqAL2ZlAoEf/gUL8qV0PXZDrKqeAH2xWOu6cY8kOV2U0b8htFoadgrv fA3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702495588; x=1703100388; h=content-transfer-encoding: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=hsm7Hd1tfmXNjP7ExDTGzsMsdLsbSJzwV9FaijljnYY=; b=H4nY/977DTWQfmeJLNr9J9diAEjCEJyGRFg1gSinwlCco4aVsLsySdk14uqxMlTnG3 U/hpcuqCslckhJuEmbHx83RQj6PLf9VP5uG8T0waWPN8mLll84aeBWIUWVF+rao83BqP w9ml8RCNyuswdDScc3soqcJqFYDNhXDsgBvsLpag1qtJREwLJOxXk/L3ysoHmHl1ksPZ edqhDTCY4Kvu6M6Wozv7BgG4BNfOv5fDzOR/lTcSXevQX4n5yqzHwy3XP7nSxGhPzXKM xkAqstB+w5HaXM7rTC9DUZRHh/kYOK+mTpO4TprUPpjVOScgZLQj5505odVH+xM95Qqb rf1Q== X-Gm-Message-State: AOJu0YxTkwiNzlNBA2lQy7LQnNbmAcJLL/TZCnwIXuuf2VJX6kKhinaf xt5EtpcQ+PAeaR7l8ls3QTOIcYhN5rcq7uHjVuc= X-Google-Smtp-Source: AGHT+IGCeaAaRTlhJwYTB4OL4lSXN4Qajcr7utoiGGbKcbNy/SZIpuXClKbj6Am58erBC8rs1dojTBjpSHJ8VPmckes= X-Received: by 2002:a05:6512:3c87:b0:50e:d97:fd25 with SMTP id h7-20020a0565123c8700b0050e0d97fd25mr1327363lfv.73.1702495588043; Wed, 13 Dec 2023 11:26:28 -0800 (PST) MIME-Version: 1.0 References: <87r12lqmco.fsf@gnus.org> <838r63y6kj.fsf@gnu.org> <11108ebcb87fae9390410fa4f3355967@finder.org> <5d8850165ca6f3d344e764397339abf0@finder.org> In-Reply-To: <5d8850165ca6f3d344e764397339abf0@finder.org> From: Matt Bisson Date: Wed, 13 Dec 2023 14:26:17 -0500 Message-ID: Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode To: Jared Finder Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49253 Cc: Eli Zaretskii , larsi@gnus.org, 49253@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I definitely want to give the feedback here that this was an outstanding explanation of what's going on inside Emacs, and thanks very much for taking the time to write it. I didn't even know of the existence of some of these maps, and I now know not only that, but their intended purpose. Again, thanks a lot for this! On Mon, Dec 11, 2023 at 5:13=E2=80=AFPM Jared Finder wro= te: > > On 2023-12-11 08:10, Matt Bisson wrote: > > TL;DR: It works! > > Thank you for the testing! > > Eli, I think the fully correct definition for term--xterm-paste is the > following, which has additional error checking: > > (defun term--xterm-paste (event) > "Insert the text pasted in an XTerm bracketed paste operation." > (interactive "e") > (unless (eq (car-safe event) 'xterm-paste) > (error "term--xterm-paste must be found to xterm-paste event")) > (let ((str (nth 1 event))) > (unless (stringp str) > (error "term--xterm-paste provided event does not contain paste > text")) > (term-send-raw-string str))) > > >> I don't think this is the right approach. > > > > Totally! :) The patch was definitely not a serious suggestion of what > > should be submitted, but just a demonstration that the interplay > > between the two functions is causing the issue, and it can be solved > > by touching only that. I haven't built up the knowledge of how these > > events function like you have, and was hoping you'd teach me a bit in > > response, and you did! > > No worries! I hope I didn't come across as judgemental here. :) If you > want a bit more detail around the architecture here, read on (Eli, > please correct if I get anything wrong): > > In Emacs, in addition to the local and global keymaps, there are also > translation keymaps. > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Ke= ymaps.html) > The docs are accurate but a bit hard to understand without concrete > examples. So let me provide an example for each of the translation > keymaps. There are three of them: > > 1. input-decode-map. This exists to translate terminal escape sequences > into the their proper events. That can be for keys (like the PF1 key > mentioned in the docs) but it also an be for mouse clicks or the xterm > paste operation. > > EXAMPLE: > This bug! In this bug, input-decode-map is what translates the > character sequence "ESC [ 2 0 0 ~ PASTED TEXT HERE ESC [ 2 0 1 ~" into > a single event, (xterm-paste "PASTED TEXT HERE"). It does > this by mapping "ESC [ 2 0 0 ~" to a function that reads until > encountering the "ESC [ 2 0 1 ~" sequence and returns that new event. > > 2. (local-)function-key-map. This exists to rename keys to more > preferred names that allow keybindings to be shared. The docs say "the > remapping only applies if the original key sequence would otherwise not > have any binding", this is to allow you to use the native keynames on > your keyboard if you do want to distinguish. > > EXAMPLE: > Many keyboards have a separate keypad number area. These keys get their > own events, e.g. "" for the zero character on the keypad. Emacs > uses function-key-map to translate "" into "0", so pressing the > keypad 0 acts the same as the number row 0. If you wanted to map the > keypad numbers to a different set of commands, you can still do so with > the original "" key. If you do so, that also implicitly overrides > this translation. > > 3. key-translation-map. I've never actually used this directly so I'm > not entirely clear on its intent. The docs make it sound like it is > intended for changing keyboard layouts. Which explains why I have never > used it -- I generally use OSes that allow keyboard layout translating > natively. > > EXAMPLE: > Based on my guess above, key-translation-map would let me map between > QWERTY and Dvorak inside Emacs. This would be nice if I was running > directly in a Linux terminal and did not have permission to run "sudo > loadkeys". > > As a final note, notice that all three of these examples involve > changing a key into a different key. None of them are for binding > commands. Commands being bound to a key always is the job of the local > and global keymaps. > > I hope these examples help you understand the setup here! > > -- MJF From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 07:46:32 2023 Received: (at 49253-done) by debbugs.gnu.org; 16 Dec 2023 12:46:32 +0000 Received: from localhost ([127.0.0.1]:54148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEU3r-0006yR-JJ for submit@debbugs.gnu.org; Sat, 16 Dec 2023 07:46:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEU3p-0006yD-U7 for 49253-done@debbugs.gnu.org; Sat, 16 Dec 2023 07:46:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEU3g-0003Rg-Ni; Sat, 16 Dec 2023 07:46:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hleNdsdTK8jQ2r047VDp51Z0cqqgpCULYEyclfRHWaA=; b=dvIK0UZZmUt+ x+k8K8hohgZE8nJhE8WPiBe6kzh1qxVxwaAB7IlelEaTWSUmElLVVJUj/a7lFo3wGXBA5YL4j6XJE Xr3/oXmAwXv/i6KGYMYGq5MwWxMfiWiJTz8mnk/vGuH0eqzXcYJRr59/j84UQJG5Whe5VZEpXoW9x W8fyM2EiwunIZPk33Ms8Muv1lZGEbgqcGh3Tsx4eoRH9DhLCsUKyIS70hBQh7VoxkC1PSK/GR7/EZ epIaqIzGM8NXCSydk4b7LDD1oWy99DTjyfnxtcCnXIWyUBtbl5S2rQMnyaKrxxgQUl3Y0b9KY76HT OicZF1p8HeEdeE2clua25Q==; Date: Sat, 16 Dec 2023 14:46:00 +0200 Message-Id: <83msuami2f.fsf@gnu.org> From: Eli Zaretskii To: Jared Finder In-Reply-To: <5d8850165ca6f3d344e764397339abf0@finder.org> (message from Jared Finder on Mon, 11 Dec 2023 14:13:24 -0800) Subject: Re: bug#49253: 27.2; Emacs non-responsive when pasting into terminal-mode References: <87r12lqmco.fsf@gnus.org> <838r63y6kj.fsf@gnu.org> <11108ebcb87fae9390410fa4f3355967@finder.org> <5d8850165ca6f3d344e764397339abf0@finder.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49253-done Cc: larsi@gnus.org, bisson.m@gmail.com, 49253-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 11 Dec 2023 14:13:24 -0800 > From: Jared Finder > Cc: Eli Zaretskii , larsi@gnus.org, 49253@debbugs.gnu.org > > On 2023-12-11 08:10, Matt Bisson wrote: > > TL;DR: It works! > > Thank you for the testing! > > Eli, I think the fully correct definition for term--xterm-paste is the > following, which has additional error checking: > > (defun term--xterm-paste (event) > "Insert the text pasted in an XTerm bracketed paste operation." > (interactive "e") > (unless (eq (car-safe event) 'xterm-paste) > (error "term--xterm-paste must be found to xterm-paste event")) > (let ((str (nth 1 event))) > (unless (stringp str) > (error "term--xterm-paste provided event does not contain paste > text")) > (term-send-raw-string str))) Thanks, installed on the emacs-29 branch, and closing the bug. From unknown Sat Jun 14 04:56:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 14 Jan 2024 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator