From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#58608: 29.0.50; Nasty bug with pasting primary selection in term buffers Date: Tue, 18 Oct 2022 23:10:27 +1300 Message-ID: <4b9aa5bac2d1bfe5af7c246ae9648c87@webmail.orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24221"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Orcon Webmail To: 58608@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 18 12:12:33 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1okjaL-00065I-H8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Oct 2022 12:12:33 +0200 Original-Received: from localhost ([::1]:47878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okjaK-0006D8-Aa for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Oct 2022 06:12:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okjYs-00068R-Mc for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 06:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okjYs-0002F7-FC for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 06:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1okjYs-0000iI-3w for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 06:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Oct 2022 10:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58608 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16660878442708 (code B ref -1); Tue, 18 Oct 2022 10:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Oct 2022 10:10:44 +0000 Original-Received: from localhost ([127.0.0.1]:51241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okjYZ-0000hb-Cx for submit@debbugs.gnu.org; Tue, 18 Oct 2022 06:10:44 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okjYW-0000hO-Vk for submit@debbugs.gnu.org; Tue, 18 Oct 2022 06:10:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okjYW-000619-1Q for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 06:10:40 -0400 Original-Received: from smtp-2.orcon.net.nz ([60.234.4.43]:39419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okjYS-0002DV-OC for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 06:10:38 -0400 Original-Received: from [10.253.37.70] (port=56602 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1okjYJ-0006UO-Se for bug-gnu-emacs@gnu.org; Tue, 18 Oct 2022 23:10:29 +1300 Original-Received: from ip-116-251-140-135.kinect.net.nz ([116.251.140.135]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Tue, 18 Oct 2022 23:10:27 +1300 X-Sender: psainty@orcon.net.nz X-GeoIP: -- Received-SPF: pass client-ip=60.234.4.43; envelope-from=psainty@orcon.net.nz; helo=smtp-2.orcon.net.nz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:245784 Archived-At: This one has been causing me occasional pain for years, but only rarely, and I didn't have a recipe to reproduce it until now. The following steps don't all need to be followed to the letter, but hopefully demonstrate the issue well. 0. emacs -Q 1. M-x term (and run your shell; term must be in char-mode) 2. Run "ls" # or anything else to produce a decent amount of output. 3. Run "cat >/dev/null" # for safety 4. Using the mouse, select any small piece of text several lines above the bottom of the term buffer (e.g. double- click a word). 5. Move the mouse to the shell prompt at the end of the buffer and middle click to paste that selected text as input. 6. Without moving the mouse, middle click again at the same position. 7. Be thankful for step 3. My impression is that the first middle-click unexpectedly creates a new primary selection based on the current mouse position, so the second middle-click then pastes that new selection as input. This has bitten me on many occasions when I wanted to repeat the previously-pasted command as input again, and find that I've instead asked the shell to execute a ton of unintended commands! (which, thankfully, tend to only rarely be valid). This bug exists in all the versions of Emacs I have installed at present (back to 26.3), and I think this is severe enough to fix in the emacs-28 branch as well as master. -Phil In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.10, Xaw scroll bars) of 2022-10-18 built on phil-lp Repository revision: be3d9f717dd317eafc8f511072040a5ff8c1071c Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Ubuntu 18.04.6 LTS Configured using: 'configure --prefix=/home/phil/emacs/trunk/usr/local --with-x-toolkit=lucid --without-sound '--program-transform-name=s/^ctags$/ctags_emacs/'' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LC_MONETARY: en_NZ.UTF-8 value of $LC_NUMERIC: en_NZ.UTF-8 value of $LC_TIME: en_NZ.UTF-8 value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8 Major mode: Term Minor modes in effect: minibuffer-line-mode: t global-edit-server-edit-mode: t savehist-mode: t magit-wip-initial-backup-mode: t magit-wip-before-change-mode: t magit-wip-after-apply-mode: t magit-wip-after-save-mode: t magit-wip-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t my-contextual-help-mode: t global-so-long-mode: t display-battery-mode: t my-visible-bell-mode: t global-display-fill-column-indicator-mode: t display-fill-column-indicator-mode: t minibuffer-depth-indicate-mode: t which-key-mode: t windmove-mode: t winner-mode: t global-subword-mode: t display-time-mode: t keep-buffers-mode: t my-keys-local-minor-mode: t auto-compile-on-load-mode: t auto-compile-on-save-mode: t url-handler-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-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 buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/el-get/scratch/el-get hides /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/el-get/el-get/el-get /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/el-get/delight/delight hides /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/elpa/delight-1.7/delight /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/el-get/transient/lisp/transient hides /home/phil/emacs/trunk/usr/local/share/emacs/29.0.50/lisp/transient /home/phil/.emacs.d.sandboxes/trunk/HOME/.emacs.d/lisp/python hides /home/phil/emacs/trunk/usr/local/share/emacs/29.0.50/lisp/progmodes/python Features: (shadow sort project-local-variables ecomplete mail-extr emacsbug term disp-table ehelp dired-aux elisp-slime-nav etags fileloop generator xref project hl-sexp lexbind-mode idle-highlight-mode tramp-sh warnings docker-tramp tramp-cache time-stamp tramp tramp-loaddefs trampver tramp-integration cus-start files-x tramp-compat parse-time iso8601 ls-lisp tabify minibuffer-line edit-server my-org my-projects my-session savehist desktop frameset my-theme zenburn-theme my-mail autoloads my-libraries sudo my-version-control magit-wip magit-log which-func imenu edebug debug backtrace find-func magit-diff smerge-mode diff git-commit rx log-edit message sendmail yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ansi-osc server ansi-color magit-mode transient pcase edmacro kmacro compat compat-macs format-spec magit-git magit-section magit-utils crm dash my-text my-programming my-python so-long my-whitespace ws-trim my-rectangles my-utilities browse-kill-ring my-configuration cus-edit pp cus-load wid-edit dired-details dired-x highlight-parentheses battery delight delsel cua-base ffap display-fill-column-indicator mb-depth which-key framemove windmove winner ring cap-words superword subword hl-line time my-externals .loaddefs windcycle transpose-frame simple-wiki derived sdcv-mode noutline outline icons sauron rainbow-mode notify dbus xml multiple-cursors mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more thingatpt mc-cycle-cursors mc-edit-lines multiple-cursors-core rect mo-git-blame keep-buffers iedit fic-mode dtrt-indent browse-at-remote vc-git diff-mode easy-mmode vc-dispatcher s el-get cl-extra help-mode autoload loaddefs-gen radix-tree lisp-mnt cl dired dired-loaddefs jka-compr my-local my-keybindings auto-compile packed compat-autoloads etags-select-autoloads info project-local-variables-autoloads advice wtf-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile cconv url-vars cl-loaddefs cl-lib rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 257815 38654) (symbols 48 24320 0) (strings 32 74590 14132) (string-bytes 1 2492927) (vectors 16 39953) (vector-slots 8 456801 46856) (floats 8 202 110) (intervals 56 886 0) (buffers 1000 14))