From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#49186: ansi-term switch to char mode immediately executes string at prompt Date: Wed, 23 Jun 2021 15:21:01 +0200 Message-ID: <871r8sn2de.fsf@gnus.org> References: <40461101.185172.1624452937072@office.mailbox.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: simon254@mailbox.org To: 49186@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 23 15:22:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lw2pV-0000yh-4W for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Jun 2021 15:22:09 +0200 Original-Received: from localhost ([::1]:37580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lw2pU-0007P6-65 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Jun 2021 09:22:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lw2pO-0007Ov-JD for bug-gnu-emacs@gnu.org; Wed, 23 Jun 2021 09:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57284) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lw2pO-0000c6-13 for bug-gnu-emacs@gnu.org; Wed, 23 Jun 2021 09:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lw2pN-0007nh-Ul for bug-gnu-emacs@gnu.org; Wed, 23 Jun 2021 09:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Jun 2021 13:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49186 X-GNU-PR-Package: emacs Original-Received: via spool by 49186-submit@debbugs.gnu.org id=B49186.162445447229924 (code B ref 49186); Wed, 23 Jun 2021 13:22:01 +0000 Original-Received: (at 49186) by debbugs.gnu.org; 23 Jun 2021 13:21:12 +0000 Original-Received: from localhost ([127.0.0.1]:40597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw2oa-0007mZ-Dj for submit@debbugs.gnu.org; Wed, 23 Jun 2021 09:21:12 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:48454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw2oY-0007mM-Jk for 49186@debbugs.gnu.org; Wed, 23 Jun 2021 09:21:11 -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:In-Reply-To:Date: References: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=CL8Fc+DNY0QGnGouaFx6y/DecTJk3FP7IN3/QyrSU0E=; b=XK7lTCY2mHJrlqn0hdcacVNbRq Rv/idVyujiC8eHc61886ls5CElvrMv1fdAuN0A0FDXMVQFKuFgYQ96850rJY/Li7MPIDExUaDkpnJ OQ8qKKKmrzZ3tZvgH61RAr17j1MQzBve7lkMK5xn0YFMr1Ix6Fw8e2CDzldHqnTyzkaQ=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lw2oP-0004tM-Kq; Wed, 23 Jun 2021 15:21:04 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEXHvq9gW1ZSJywb FhWPV1v///9jtUDFAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UGFww4FbuLG2MAAAG0SURBVDjLdZSB jesgDIadewyAORbAdICL6QA2x/4znQkkoVKepbYSX39s/xgA/hsBn8IDFCpcKDNxJotceuQfAKZM WV+VXlWkEr0k5FJ/usL+mV+RqEEjqm8lOhRdSeQrvQEUG+Gx2QSccNNeiQKGsABDfha55VVRmOJZ /vapILLiQ+otrIpjuR0Ch9RX3h3kAWaEfAO2jqM2ca21IZhgR7lyQyt0grKrtAu4kq/ku/pNnkF0 zwpEuUHmFdzJR8cD8NndYcknwEewhxSdZbGPE1284jAtiVEN5BVQoETJJibq0fkE5lWwLzTbIxKt ihAoh05gQ7y9MrMLJUjfHMBFq4snaBhYvbRvqgDe3QpQ3UUQopoDsl3AMsHuAeHXO4aegxfQu/7n NSneVZ3A2bzp19L57rxtLzahLtXf1SuMDVUQ1QZ0jMnpbpQgiuJw65Z9WDLCRLSeR7dwDuiqsIHr a7FFRW1N9eMEA1q141D046AmmEWtyZPd7Ova2h2Uqyq/4X2fH8Bdbr8Fdr9brP0n10w8H4BSuS9Z sWefXEfy/lq88ljrrwEfWw0rknkRrgzjJJ7jD7BVjujBIt4hAAAAJXRFWHRkYXRlOmNyZWF0ZQAy MDIxLTA2LTIzVDEyOjU2OjIxKzAwOjAwHtSp5QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wNi0y M1QxMjo1NjoyMSswMDowMG+JEVkAAAAASUVORK5CYII= X-Now-Playing: The Clash's _Sandinista!_: "The Crooked Beat" In-Reply-To: <40461101.185172.1624452937072@office.mailbox.org> (simon's message of "Wed, 23 Jun 2021 13:55:37 +0100 (BST)") 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:208896 Archived-At: simon254--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > For example, C-c C-j, then typing ls and then C-c C-k -> ls is > executed. However, If I type ls and then C-c C-j followed by C-c C-k, it does not execute ls > > Bug affects emacs version 27 and 28 I can reproduce the behaviour. To reproduce: emacs -Q M-x ansi-term RET RET `C-c C-j l s C-c C-k' In Emacs 26, this won't execute ls, but in Emacs 28 it does (and so it does in Emacs 25.1). The code for `term-char-mode' (i.e., `C-c C-k') seems to indicate that the intention of the `C-c C-k' was to behave like Emacs 28 does now: ;; Send existing partial line to inferior (without newline). (let ((pmark (process-mark (get-buffer-process (current-buffer)))) (save-input-sender term-input-sender)) (when (> (point) pmark) (unwind-protect (progn (setq term-input-sender (symbol-function 'term-send-string)) (end-of-line) (term-send-input)) (setq term-input-sender save-input-sender)))) But this didn't work in Emacs 26.1, but has been fixed now. I don't use ansi-term myself much -- I think it's pretty peculiar that `C-c C-k' sends partial line inputs to the shell. Does anybody know what the rationale for this is? The code has been like this since 1994, and Emacs 25 works like Emacs 28. (So it's Emacs 26.1 that's broken here.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no