From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Apr 2018 13:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 31193@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.152397004828485 (code B ref -1); Tue, 17 Apr 2018 13:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Apr 2018 13:00:48 +0000 Received: from localhost ([127.0.0.1]:56853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8QE3-0007PN-MT for submit@debbugs.gnu.org; Tue, 17 Apr 2018 09:00:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8QE1-0007P6-Ja for submit@debbugs.gnu.org; Tue, 17 Apr 2018 09:00:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8QDs-0008D9-Ey for submit@debbugs.gnu.org; Tue, 17 Apr 2018 09:00:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39805) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f8QDs-0008D2-BP for submit@debbugs.gnu.org; Tue, 17 Apr 2018 09:00:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8QDl-0004hG-V0 for bug-gnu-emacs@gnu.org; Tue, 17 Apr 2018 09:00:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8QDb-00085O-Tu for bug-gnu-emacs@gnu.org; Tue, 17 Apr 2018 09:00:30 -0400 Received: from smtp-3.orcon.net.nz ([60.234.4.44]:40001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8QDb-000838-Hy for bug-gnu-emacs@gnu.org; Tue, 17 Apr 2018 09:00:19 -0400 Received: from [10.253.37.70] (port=56611 helo=webmail.orcon.net.nz) by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1f8QDX-0002ei-25 for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2018 01:00:15 +1200 Received: from [150.107.175.140] via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 18 Apr 2018 01:00:14 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Apr 2018 01:00:14 +1200 From: Phil Sainty Message-ID: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) 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: -5.3 (-----) In a `term' buffer, seemingly after any window configuration change, the process filter triggers an error due to `term-current-row' being nil unexpectedly. Recipe: emacs -Q M-x toggle-debug-on-error M-x term RET RET #repeatedly -- all is fine at this point... C-c 2 RET Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) term-down(1 t) term-emulate-terminal(# "\015\033[K$ \015\n\032//home/phil\015\n") That window config change could be C-c 2 or C-c 3 or, if already split, C-c 1; it doesn't seem to matter. With an uncompiled `term-down': Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) =(nil 0) (and (= term-current-row 0) (< down 0)) (if (and (= term-current-row 0) (< down 0)) ...) (let ((start-column (term-horizontal-column))) ...) term-down(1 t) term-emulate-terminal(# "\015\033[K$ \015\n\032//home/phil\015\n") That test of (= term-current-row 0) occurs twice in the function. Trivially, testing (bound-and-true-p term-current-row) beforehand in both pieces of code circumvents the error and appears in practice to resolve the issue, but I don't know whether that's the *right* fix. -Phil In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2018-04-15 built on shodan Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 System Description: Ubuntu 16.04.4 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Debug on Error enabled globally Entering debugger... term-emulate-terminal: Wrong type argument: number-or-marker-p, nil Configured using: 'configure --prefix=/home/phil/emacs/26.1rc1/usr/local --with-x-toolkit=lucid --without-sound' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 THREADS LCMS2 Important settings: value of $LANG: en_NZ.UTF-8 locale-coding-system: utf-8-unix Major mode: Debugger Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: (only . t) Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode cl-print byte-opt gv bytecomp byte-compile cl-loaddefs cl-lib cconv debug term disp-table easymenu ehelp ring cus-start cus-load elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer 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 dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 108699 9507) (symbols 48 22248 1) (miscs 40 76 129) (strings 32 32773 1265) (string-bytes 1 829787) (vectors 16 14995) (vector-slots 8 503659 11454) (floats 8 61 115) (intervals 56 287 0) (buffers 992 13) (heap 1024 42349 1368)) From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Apr 2018 13:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Phil Sainty Cc: 31193@debbugs.gnu.org Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152397143530632 (code B ref 31193); Tue, 17 Apr 2018 13:24:02 +0000 Received: (at 31193) by debbugs.gnu.org; 17 Apr 2018 13:23:55 +0000 Received: from localhost ([127.0.0.1]:56892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8QaR-0007xz-LG for submit@debbugs.gnu.org; Tue, 17 Apr 2018 09:23:55 -0400 Received: from mail-it0-f53.google.com ([209.85.214.53]:56100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8QaQ-0007xn-0J for 31193@debbugs.gnu.org; Tue, 17 Apr 2018 09:23:54 -0400 Received: by mail-it0-f53.google.com with SMTP id 145-v6so9871164itf.5 for <31193@debbugs.gnu.org>; Tue, 17 Apr 2018 06:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7X7/CBo0tLHqaGx1a7g4hKhnZGipYiMcjIsIDDJPcj0=; b=dpHi387vvKHm90ppp6oZZtRn5aeL7RkqQTxQ7wvywBDW0/lwjm2Pz7f/+K/BT0lJmX GtuHcRG9yHGpsZgZaHoFzUl6z/B6Yew7PFbPhs73m3xE+OrVEOVELDLwKjrLWSBqszcI Z85joRsxKiVfEzh87jZPWwlFsM6do8rwtpWTjPdUAt0CT1G+t+0hxMNV4XX4XcuPo/51 w8aHKtJJC3V3z5OefUbyww046qAkfhpPutFV3P0CGyfk6rUYjJRO40PNZBQY+2tJGhVA 5lKJFRltr5UrP7EmNVS3LXOMGHRmqP9MRnDB8PS5xrNTDjLhQYkulilB1p9M5Tt4gPJy rrbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7X7/CBo0tLHqaGx1a7g4hKhnZGipYiMcjIsIDDJPcj0=; b=rNHSpgL90wJSRkc7whre5Sdjz77BQA+br9sFOfnHLgEijVw8OZz/558fPWSjDjZwrO aMDHGQ+Rjf8eMm8Py1Cvkx4R2yOH9KkSxGcEv138d1bKTIAxT8vmbiE+yubJ6A5Cp7wt SCy9LzBvzYlspEU/pb7jgTc+VJSrMd3LXYG5IwN+hGBPtza4Md6iHPh1e5u+awEjTq+N yFD3xMohcPnHkWqVJi7MUo90hu+sNdqORLEcUbm4x+TFlnhlcECuDRBXEm5FavoLONJK kMgeWoGU5NPLBtV/kzqI4ZhfjKQUfLrQZn4VSO31/s3NCRvtVPhY675+xBGBjC3Q+wZL Xl2A== X-Gm-Message-State: ALQs6tDwYv+VuRJPqTdXyyOE4QsJB/BFULhRgYf798/L1mgcmug9ApDz oJnypFo8vUkSWAaCqyUXYFr6gw== X-Google-Smtp-Source: AIpwx49LkGElUnO+balflEQ29lMAre06SthVfMmpGMn7WXNkbuIRNzLCVaRkJg4enQyf4Ru84a6w0g== X-Received: by 2002:a24:d8f:: with SMTP id 137-v6mr1236026itx.30.1523971428202; Tue, 17 Apr 2018 06:23:48 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id t4-v6sm4965185ita.3.2018.04.17.06.23.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Apr 2018 06:23:47 -0700 (PDT) From: Noam Postavsky References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> Date: Tue, 17 Apr 2018 09:23:46 -0400 In-Reply-To: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> (Phil Sainty's message of "Wed, 18 Apr 2018 01:00:14 +1200") Message-ID: <87sh7ut199.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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.7 (-) Phil Sainty writes: > In a `term' buffer, seemingly after any window configuration change, the > process filter triggers an error due to `term-current-row' being nil > unexpectedly. > > Recipe: > > emacs -Q > M-x toggle-debug-on-error > M-x term > RET > RET #repeatedly -- all is fine at this point... > C-c 2 > RET > > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p > nil) > term-down(1 t) > term-emulate-terminal(# "\015\033[K$ > \015\n\032//home/phil\015\n") Hmm, I'm not able to reproduce this, even though it makes sense to me that my fix for Bug#30544 [1: a64c11a3aa] would cause this. Perhaps it depends on your shell prompt as well? > That test of (= term-current-row 0) occurs twice in the function. > > Trivially, testing (bound-and-true-p term-current-row) beforehand in > both pieces of code circumvents the error and appears in practice to > resolve the issue, but I don't know whether that's the *right* fix. I think changing them to function calls, i.e., (term-current-row) instead of term-current-row would be the right thing; all the other term functions use the function rather than accessing the variable directly. [1: a64c11a3aa]: 2018-04-02 06:57:53 -0400 Fix term.el rendering following a window resize (Bug#30544) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a64c11a3aa49121ceab79a2acc99c829d42417bd> From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Apr 2018 13:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 31193@debbugs.gnu.org Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.1523972964459 (code B ref 31193); Tue, 17 Apr 2018 13:50:01 +0000 Received: (at 31193) by debbugs.gnu.org; 17 Apr 2018 13:49:24 +0000 Received: from localhost ([127.0.0.1]:56905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8Qz6-00007K-6X for submit@debbugs.gnu.org; Tue, 17 Apr 2018 09:49:24 -0400 Received: from smtp-3.orcon.net.nz ([60.234.4.44]:56535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8Qz4-00007C-HB for 31193@debbugs.gnu.org; Tue, 17 Apr 2018 09:49:22 -0400 Received: from [10.253.37.70] (port=49589 helo=webmail.orcon.net.nz) by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1f8Qz2-0004lJ-Ro; Wed, 18 Apr 2018 01:49:20 +1200 Received: from [150.107.175.140] via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 18 Apr 2018 01:49:20 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Apr 2018 01:49:20 +1200 From: Phil Sainty In-Reply-To: <87sh7ut199.fsf@gmail.com> References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> Message-ID: <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) 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.7 (-) On 2018-04-18 01:23, Noam Postavsky wrote: > Hmm, I'm not able to reproduce this, even though it makes sense to me > that my fix for Bug#30544 [1: a64c11a3aa] would cause this. Perhaps it > depends on your shell prompt as well? I do have a non-trivial prompt; but after setting PS1="$ " I still see the same issue, so I'm unsure whether that's a factor. My shell is bash. > I think changing them to function calls, i.e., (term-current-row) > instead of term-current-row would be the right thing; all the other > term > functions use the function rather than accessing the variable directly. That sounds sane, and I can confirm that it fixes the problem. From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 00:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Phil Sainty Cc: 31193@debbugs.gnu.org Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152401007226819 (code B ref 31193); Wed, 18 Apr 2018 00:08:02 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 00:07:52 +0000 Received: from localhost ([127.0.0.1]:58236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8adc-0006yQ-6M for submit@debbugs.gnu.org; Tue, 17 Apr 2018 20:07:52 -0400 Received: from mail-it0-f47.google.com ([209.85.214.47]:55356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8ada-0006y9-Mg; Tue, 17 Apr 2018 20:07:51 -0400 Received: by mail-it0-f47.google.com with SMTP id 145-v6so314554itf.5; Tue, 17 Apr 2018 17:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=SI+Y8q5ucyJ14VKZr1wfKjBjz7hx4QpvH6JNfT/fy8I=; b=YwqpK2WJ/ZA0MbKVrmnqmBLw/pg5PHGVxWUrNiTlSqchnXzCcjzDVmOhiRddwiSOGk Xi6DsS/iT1VLsZg+rwB6QL/+rUcpFz6NWwx3tzBJplgh/DI8G+NEV3Gq/7uVnc+n51/s 4W0EDAV8aJUt3GQkM3u+tFZaNAYMIOq3+057va9I0pEnoMc2TUXQndPxFxsMyKxTyETH bSRTm8n7DiJy3rkNOgX3wqjHRgsO4yNfIscXfh4HRJmC8g15Ho6BHYO8QbHDEzrzpou2 k+TQPEkeR3pYNsm4H7MPaZUVOvldkCdKvZoxD7nCarVmCWn2JCeMNEMuoxM65wmKX2LH LZrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=SI+Y8q5ucyJ14VKZr1wfKjBjz7hx4QpvH6JNfT/fy8I=; b=DHgnTa0IInEwQIknDoY2kjXQiC4PMixYDrcDBXhPKvVQ0sLhyDv5GmbrwRD1p2Deth Gq/H/hUOGYljgZ9lTe1lUTUJuuVgs/QbpV2JarcbVmyBCa2J9AX8DCf86WagMcIuufjt LjSVMMGRLP5rzf16Ve1xtgnPCbeP3HU3hd5uGGPu0eCIQSds1ZEd4mB2h/2tECfn27zm nh056DUCbLFTlmAPczEBpBmAldznW5PwPMSZNCnot8rU1yqxfOV0PEQG9GnNYFQUsIiR IRKmooJCo54RyxFh7uGrwIYOH3fweY2FosP88C4LXsWkbLgaPOU0R4Np9EgpFOgZ9RM4 M75g== X-Gm-Message-State: ALQs6tAWPjelTWPpgDo2gXQgwsuvTVXJbwiYZrXCdIPoYL7NA2WY4kgb +mQrkdV6F3OXculXigN7JqeKtw== X-Google-Smtp-Source: AIpwx48l9yAOlEsgFsz2bnyI50cLTtbsBtSe9ddceQv+/Qov2IL2maWlPUR5UlQi0fb3pE067q+Sbg== X-Received: by 2002:a24:718a:: with SMTP id n132-v6mr312648itc.7.1524010064908; Tue, 17 Apr 2018 17:07:44 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id j195-v6sm124341itb.40.2018.04.17.17.07.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Apr 2018 17:07:43 -0700 (PDT) From: Noam Postavsky References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> Date: Tue, 17 Apr 2018 20:07:41 -0400 In-Reply-To: <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> (Phil Sainty's message of "Wed, 18 Apr 2018 01:49:20 +1200") Message-ID: <87muy1tm0i.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) 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 (-) --=-=-= Content-Type: text/plain tags 31193 + patch quit Phil Sainty writes: > On 2018-04-18 01:23, Noam Postavsky wrote: >> Hmm, I'm not able to reproduce this, even though it makes sense to me >> that my fix for Bug#30544 [1: a64c11a3aa] would cause this. Perhaps it >> depends on your shell prompt as well? > > I do have a non-trivial prompt; but after setting PS1="$ " I still see > the same issue, so I'm unsure whether that's a factor. My shell is > bash. Hmm, maybe it's a difference in bash versions? I tried adding a newline to my prompt with PS1=$'one\ntwo$ ', but bash doesn't send the newline after the terminal resizes. Seems it's clever enough just to redraw the last line. GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) And since terminal-emulate-terminal doesn't receive a \n character, it doesn't call term-down before calling (term-current-row) near the end of that function: (when (>= (term-current-row) term-height) (term-handle-deferred-scroll)) So I definitely can't see how you trigger this with PS1="$ ", but perhaps your version of bash sends a newline for some other reason? Can you show the backtrace with PS1="$ "? >> I think changing them to function calls, i.e., (term-current-row) >> instead of term-current-row would be the right thing; all the other >> term >> functions use the function rather than accessing the variable directly. > > That sounds sane, and I can confirm that it fixes the problem. Okay, here's the patch with message. Eli, should I apply this to emacs-26? I believe it's safe because the term-current-row function simply returns the value of the term-current-row variable if that is non-nil. Hence it should only affect cases where we were going to signal an error due to type-mismatch anyway. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Don-t-assume-term-current-row-cache-is-valid-Bug-311.patch Content-Description: patch >From c1faca2b07ac86f84450bbb95ecb6d8635410281 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 17 Apr 2018 19:17:18 -0400 Subject: [PATCH] Don't assume term-current-row cache is valid (Bug#31193) * lisp/term.el (term-down): Call `term-current-row' instead of directly accessing the variable `term-current-row. Following a resize of the terminal's window, `term-current-row' is reset to nil, so it is not safe to assume it is a number. --- lisp/term.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index 0a5efa4abc..6860ea6934 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3764,7 +3764,7 @@ term-down (let ((start-column (term-horizontal-column))) (when (and check-for-scroll (or term-scroll-with-delete term-pager-count)) (setq down (term-handle-scroll down))) - (unless (and (= term-current-row 0) (< down 0)) + (unless (and (= (term-current-row) 0) (< down 0)) (term-adjust-current-row-cache down) (when (or (/= (point) (point-max)) (< down 0)) (setq down (- down (term-vertical-motion down))))) @@ -3774,7 +3774,7 @@ term-down (setq term-current-column 0) (setq term-start-line-column 0)) (t - (when (= term-current-row 0) + (when (= (term-current-row) 0) ;; Insert lines if at the beginning. (save-excursion (term-insert-char ?\n (- down))) (save-excursion -- 2.11.0 --=-=-=-- From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 01:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 31193@debbugs.gnu.org, bug-gnu-emacs Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152401346714693 (code B ref 31193); Wed, 18 Apr 2018 01:05:01 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 01:04:27 +0000 Received: from localhost ([127.0.0.1]:58276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8bWK-0003os-Hq for submit@debbugs.gnu.org; Tue, 17 Apr 2018 21:04:27 -0400 Received: from smtp-2.orcon.net.nz ([60.234.4.43]:53088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8bWG-0003oe-S0 for 31193@debbugs.gnu.org; Tue, 17 Apr 2018 21:04:24 -0400 Received: from [10.253.37.70] (port=54406 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1f8bWA-0002Sq-BF; Wed, 18 Apr 2018 13:04:18 +1200 Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 18 Apr 2018 13:04:13 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Apr 2018 13:04:13 +1200 From: Phil Sainty In-Reply-To: <87muy1tm0i.fsf@gmail.com> References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> <87muy1tm0i.fsf@gmail.com> Message-ID: <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) 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.7 (-) On 2018-04-18 12:07, Noam Postavsky wrote: > Hmm, maybe it's a difference in bash versions? I tried adding a > newline > to my prompt with PS1=$'one\ntwo$ ', but bash doesn't send the newline > after the terminal resizes. Seems it's clever enough just to redraw > the > last line. > > GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) Mine is: GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) > Can you show the backtrace with PS1="$ "? Sure. This is with a .bashrc containing only that setting, and an otherwise blank-slate $HOME directory, in case anything else I was doing had an effect. It might still be due to system-wide config, but the bash version difference seems as likely as anything else? Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) =(nil 0) (and (= term-current-row 0) (< down 0)) (if (and (= term-current-row 0) (< down 0)) nil (term-adjust-current-row-cache down) (if (or (/= (point) (point-max)) (< down 0)) (progn (setq down (- down (funcall term-vertical-motion down)))))) (let ((start-column (term-horizontal-column))) (if (and check-for-scroll (or term-scroll-with-delete term-pager-count)) (progn (setq down (term-handle-scroll down)))) (if (and (= term-current-row 0) (< down 0)) nil (term-adjust-current-row-cache down) (if (or (/= (point) (point-max)) (< down 0)) (progn (setq down (- down (funcall term-vertical-motion down)))))) (cond ((>= down 0) (term-insert-char 10 down) (setq term-current-column 0) (setq term-start-line-column 0)) (t (if (= term-current-row 0) (progn (save-excursion (term-insert-char 10 (- down))) (save-excursion (let (p) (forward-line term-height) (setq p (point)) (forward-line (- down)) (delete-region p (point)))))) (setq term-current-column 0) (setq term-start-line-column (current-column)))) (if start-column (progn (term-move-columns start-column)))) term-down(1 t) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t)) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char))) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i))) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (cond ((eq term-terminal-state 4) (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i)))) (progn (let ((newstr (term-handle-ansi-terminal-messages str))) (if (eq str newstr) nil (setq handled-ansi-message t str newstr))) (setq str-length (length str)) (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (cond ((eq term-terminal-state 4) (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i)))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (unwind-protect (progn (let ((newstr (term-handle-ansi-terminal-messages str))) (if (eq str newstr) nil (setq handled-ansi-message t str newstr))) (setq str-length (length str)) (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (cond ((eq term-terminal-state 4) (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i)))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state)) (save-current-buffer (unwind-protect (progn (let ((newstr (term-handle-ansi-terminal-messages str))) (if (eq str newstr) nil (setq handled-ansi-message t str newstr))) (setq str-length (length str)) (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (cond ((eq term-terminal-state 4) (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i)))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (let ((newstr (term-handle-ansi-terminal-messages str))) (if (eq str newstr) nil (setq handled-ansi-message t str newstr))) (setq str-length (length str)) (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (cond ((eq term-terminal-state 4) (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i)))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state)))) (let* ((i 0) char funny count count-bytes decoded-substring save-point save-marker old-point temp win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win handled-ansi-message (str-length (length str))) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (let ((newstr (term-handle-ansi-terminal-messages str))) (if (eq str newstr) nil (setq handled-ansi-message t str newstr))) (setq str-length (length str)) (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (cond ((eq term-terminal-state 4) (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i)))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))))) (save-current-buffer (set-buffer (process-buffer proc)) (let* ((i 0) char funny count count-bytes decoded-substring save-point save-marker old-point temp win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win handled-ansi-message (str-length (length str))) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (let ((newstr (term-handle-ansi-terminal-messages str))) (if (eq str newstr) nil (setq handled-ansi-message t str newstr))) (setq str-length (length str)) (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (cond ((eq term-terminal-state 4) (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) (setq funny (string-match "[\015\n\0\007\033\011\010\032\016\017]" str i)) (if (not funny) (progn (setq funny str-length))) (cond ((> funny i) (cond ((eq term-terminal-state 1) (term-down 1 t) (term-move-columns (- (term-current-column))) (setq term-terminal-state 0))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (setq count (length decoded-substring)) (if (= funny str-length) (progn (let ((partial 0)) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq count (- count partial)) (setq funny (- funny partial))))))) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((or term-suppress-hard-newline (<= temp 0))) ((> count temp) (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 count) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (setq pos (point)) (term-move-columns columns) (delete-region pos (point)))) (if term-insert-mode (progn (setq pos (point)) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (setq term-current-column nil) (put-text-property old-point (point) 'font-lock-face term-current-face) (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char 9)) (setq count (term-current-column)) (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (if (> term-width (term-current-column)) (progn (term-move-columns (1- (- term-width (term-current-column)))))) (if (= term-width (term-current-column)) (progn (term-move-columns -1))))) ((eq char 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eq char 8) (term-move-columns -1)) ((eq char 27) (setq term-terminal-state 2)) ((eq char 0)) ((eq char 14)) ((eq char 15)) ((eq char 7) (beep t)) ((eq char 26) (let ((end (string-match "\015?\n" str i))) (if end (progn (if handled-ansi-message nil (funcall term-command-hook (decode-coding-string (substring str (1+ i) end) locale-coding-system))) (setq i (1- (match-end 0)))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) (t (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) (cond ((eq char 91) (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char 68) (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ((eq char 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t)) (setq term-terminal-state 0)) ((eq char 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face)) (setq term-terminal-state 0)) ((eq char 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor)))) (setq term-terminal-state 0)) ((eq char 99) (setq term-terminal-state 0) (term-reset-terminal)) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) (cond ((and (>= char 48) (<= char 57)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char 48)))) ((eq char 59) (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char 63)) (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) (if (= 0 i) (setq term-terminal-parameter (concat "\015" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 13)) (goto-char (point-max))) (setq term-terminal-state 4) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length))) (setq i (1+ i)))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))))) (if (get-buffer-window (current-buffer)) (progn (redisplay)))) term-emulate-terminal(# "\015\033[K$ \015\n\032//home/phil/emacs/26/26.1rc1/usr/local/share/emacs/26.1/lisp\015\n") From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 02:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Phil Sainty Cc: 31193@debbugs.gnu.org, bug-gnu-emacs Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152401708027785 (code B ref 31193); Wed, 18 Apr 2018 02:05:01 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 02:04:40 +0000 Received: from localhost ([127.0.0.1]:58320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8cSc-0007Dv-QJ for submit@debbugs.gnu.org; Tue, 17 Apr 2018 22:04:40 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:35530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8cSb-0007Dj-PB for 31193@debbugs.gnu.org; Tue, 17 Apr 2018 22:04:38 -0400 Received: by mail-it0-f65.google.com with SMTP id q85-v6so608070itc.0 for <31193@debbugs.gnu.org>; Tue, 17 Apr 2018 19:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WaHH0T1bvunSoXtgWQ6tT/SGVi+nqlVTOLx9XQcHtV0=; b=j8iTOHW9FbCidVNGca8nt+G8/ZrTL8ZWS7Ae3Oup/tvCkm7zCnsgX0ryvnsQiLxge5 Uw+mLGm4YHceRH0A6sOzRtnHcO55kdN2s7EHVo9yPVXpVVq+20NMRQ1S98DK7NkKD2Is H0wFZeVsG6OgROfBr8QalNGKk02pnnl4t+gzFo2kkx14ZJjFxohWk96sTMrZi8wAiycM X8WWu+diBXb7+iks0b56da5t8AmFNkXl0NidI/b3CitdQR6vsjpd+SIsw4SKW0f2nQ4I j9AEK8cEkrHwdCsaXSeD1XHbl+rycTZH08wIFlMdmBOE4Oxj2fVGvcfS/kEtOVu2M0qF pmZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WaHH0T1bvunSoXtgWQ6tT/SGVi+nqlVTOLx9XQcHtV0=; b=pM5zpf6twP91Z6X7PsJjARMCboGxjuLyU1t6D46LGta1/0SglbqfuaRczSLZEXKcsw em3x1Uy0BaeRWG0gedMxOA2cqBJNWIyWkxK+wGO5I+gKZC0ihMN6F1x/XMgatHn4nEi5 DY6XgP1P0K8nT1NeOVW9JEWUwUtlUVw7zY+5flBlTckAT8bZKASjthQn9cIfljTw1Q9+ HajVE2vYNB1u9AS9hjeB04CsOmLoPUznVi+V03/doB162FQqGP/8IhaU3X7NtaGAby8R cO4K908fiN7ZBXuhVUtzudbvduZ+nTvB8bJczor2vV57kQpNdZ1CwX4sz6uQtMuaFjE8 OwNQ== X-Gm-Message-State: ALQs6tDX3mStG7clayC0gQOlBHWyqoDx16YmwVtF+ReL/HM1M7Y/Zv9Q fcfZMpfk93NpYZI0FCgthDE= X-Google-Smtp-Source: AB8JxZq74vaTbiJ/CqqMaMnrHaXId0vq781RUD54DrOBmsTaJlVRImOhKrT4d8k8ErQgw7+KtrZzEQ== X-Received: by 2002:a24:7541:: with SMTP id y62-v6mr536324itc.119.1524017072262; Tue, 17 Apr 2018 19:04:32 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id m22-v6sm69521iob.69.2018.04.17.19.04.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Apr 2018 19:04:31 -0700 (PDT) From: Noam Postavsky References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> <87muy1tm0i.fsf@gmail.com> <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> Date: Tue, 17 Apr 2018 22:04:30 -0400 In-Reply-To: <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> (Phil Sainty's message of "Wed, 18 Apr 2018 13:04:13 +1200") Message-ID: <87h8o9tglt.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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 (-) Phil Sainty writes: > On 2018-04-18 12:07, Noam Postavsky wrote: >> Hmm, maybe it's a difference in bash versions? I tried adding a >> newline to my prompt with PS1=$'one\ntwo$ ', but bash doesn't send >> the newline after the terminal resizes. Seems it's clever enough >> just to redraw the last line. >> >> GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) > > Mine is: > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) > > >> Can you show the backtrace with PS1="$ "? > > Sure. This is with a .bashrc containing only that setting, and an > otherwise blank-slate $HOME directory, in case anything else I was > doing had an effect. It might still be due to system-wide config, > but the bash version difference seems as likely as anything else? > term-emulate-terminal(# "\015\033[K$ > \015\n\032//home/phil/emacs/26/26.1rc1/usr/local/share/emacs/26.1/lisp\015\n") Hmm, yeah, it looks like your bash adds a "\r\n" (\015 is \r) after the prompt, while mine doesn't. Although, wouldn't that extra \n leave your cursor one row below the prompt? I also don't get the \032/\r\n unless I do a 'cd'. From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 04:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 31193@debbugs.gnu.org, bug-gnu-emacs Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152402542215518 (code B ref 31193); Wed, 18 Apr 2018 04:24:02 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 04:23:42 +0000 Received: from localhost ([127.0.0.1]:58350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8edC-00042E-5T for submit@debbugs.gnu.org; Wed, 18 Apr 2018 00:23:42 -0400 Received: from smtp-2.orcon.net.nz ([60.234.4.43]:34731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8edA-000426-Af for 31193@debbugs.gnu.org; Wed, 18 Apr 2018 00:23:41 -0400 Received: from [10.253.37.70] (port=57615 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1f8ed7-000424-R8; Wed, 18 Apr 2018 16:23:38 +1200 Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 18 Apr 2018 16:23:37 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Apr 2018 16:23:37 +1200 From: Phil Sainty In-Reply-To: <87h8o9tglt.fsf@gmail.com> References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> <87muy1tm0i.fsf@gmail.com> <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> <87h8o9tglt.fsf@gmail.com> Message-ID: <77839205bfe30db7b7a50428065d3714@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) 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.7 (-) On 2018-04-18 14:04, Noam Postavsky wrote: >> term-emulate-terminal(# "\015\033[K$ >> \015\n\032//home/phil/emacs/26/26.1rc1/usr/local/share/emacs/26.1/lisp\015\n") > > Hmm, yeah, it looks like your bash adds a "\r\n" (\015 is \r) after the > prompt, while mine doesn't. Although, wouldn't that extra \n leave > your > cursor one row below the prompt? In practice the carriage return shunts the cursor back to the start of the prompt that I was already at, and then gets 'stuck' there -- no new line is created. Typing RET again triggers the same error (with no change to the buffer), but as soon as I start typing other keys, functionality is restored. > I also don't get the \032/\r\n unless I do a 'cd'. I observe that whenever I execute a shell command (or just enter a blank line) and then trigger the error, I get this the first time: term-emulate-terminal(# "\015\033[K$\015\n") but repeatedly re-triggering the error gives me this every time: term-emulate-terminal(# "\015\033[K$\015\n\032/\015\n$") (until I next enter a command or blank line.) The matches the directory tracking -- I can affect it with cd. (but setting default-directory does not affect it). From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 05:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 31193@debbugs.gnu.org, bug-gnu-emacs Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152402794019116 (code B ref 31193); Wed, 18 Apr 2018 05:06:02 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 05:05:40 +0000 Received: from localhost ([127.0.0.1]:58355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8fHo-0004yG-FV for submit@debbugs.gnu.org; Wed, 18 Apr 2018 01:05:40 -0400 Received: from smtp-2.orcon.net.nz ([60.234.4.43]:50245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8fHm-0004y6-UY for 31193@debbugs.gnu.org; Wed, 18 Apr 2018 01:05:39 -0400 Received: from [10.253.37.70] (port=53725 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1f8fHk-0006Ff-Sd; Wed, 18 Apr 2018 17:05:37 +1200 Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 18 Apr 2018 17:05:36 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Apr 2018 17:05:36 +1200 From: Phil Sainty In-Reply-To: <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> <87muy1tm0i.fsf@gmail.com> <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> Message-ID: <4fa6e25ab1517005a52495159f0db996@webmail.orcon.net.nz> X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) 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.7 (-) On 2018-04-18 13:04, Phil Sainty wrote: > On 2018-04-18 12:07, Noam Postavsky wrote: >> Hmm, maybe it's a difference in bash versions? >> GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu) > > GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) I've just compiled bash 4.4.12 and confirmed that this issue does not occur with that version. GNU bash, version 4.4.12(1)-release (x86_64-unknown-linux-gnu) From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 05:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 31193@debbugs.gnu.org, bug-gnu-emacs Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152402984422494 (code B ref 31193); Wed, 18 Apr 2018 05:38:01 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 05:37:24 +0000 Received: from localhost ([127.0.0.1]:58362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8fmW-0005qj-0P for submit@debbugs.gnu.org; Wed, 18 Apr 2018 01:37:24 -0400 Received: from smtp-2.orcon.net.nz ([60.234.4.43]:38816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8fmT-0005qb-OP for 31193@debbugs.gnu.org; Wed, 18 Apr 2018 01:37:22 -0400 Received: from [10.253.37.70] (port=33035 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1f8fmR-0007tk-KE; Wed, 18 Apr 2018 17:37:19 +1200 Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 18 Apr 2018 17:37:19 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Apr 2018 17:37:19 +1200 From: Phil Sainty In-Reply-To: <4fa6e25ab1517005a52495159f0db996@webmail.orcon.net.nz> References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> <87muy1tm0i.fsf@gmail.com> <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> <4fa6e25ab1517005a52495159f0db996@webmail.orcon.net.nz> Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) 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.7 (-) On 2018-04-18 17:05, Phil Sainty wrote: > I've just compiled bash 4.4.12 and confirmed that this issue > does not occur with that version. And conversely the issue *does* occur with both bash-4.3.tar.gz and bash-4.3.30.tar.gz if I compile those from source, so you ought to be able to replicate that behaviour for yourself with either of those. From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 06:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: psainty@orcon.net.nz, 31193@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.152403274326778 (code B ref 31193); Wed, 18 Apr 2018 06:26:01 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 06:25:43 +0000 Received: from localhost ([127.0.0.1]:58385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8gXH-0006xq-7a for submit@debbugs.gnu.org; Wed, 18 Apr 2018 02:25:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8gXF-0006xc-0c for 31193@debbugs.gnu.org; Wed, 18 Apr 2018 02:25:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8gX5-00088D-SD for 31193@debbugs.gnu.org; Wed, 18 Apr 2018 02:25:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8gX5-000886-Od; Wed, 18 Apr 2018 02:25:31 -0400 Received: from [176.228.60.248] (port=3369 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f8gX5-0003re-5W; Wed, 18 Apr 2018 02:25:31 -0400 Date: Wed, 18 Apr 2018 09:25:41 +0300 Message-Id: <83wox5115m.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87muy1tm0i.fsf@gmail.com> (message from Noam Postavsky on Tue, 17 Apr 2018 20:07:41 -0400) References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> <87muy1tm0i.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -6.0 (------) > From: Noam Postavsky > Date: Tue, 17 Apr 2018 20:07:41 -0400 > Cc: 31193@debbugs.gnu.org > > Okay, here's the patch with message. Eli, should I apply this to > emacs-26? Yes, please. > I believe it's safe because the term-current-row function > simply returns the value of the term-current-row variable if that is > non-nil. Hence it should only affect cases where we were going to > signal an error due to type-mismatch anyway. Agreed. Thanks. From unknown Sun Aug 10 02:40:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#31193: 26.1; error in `term-down' after window configuration change Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Apr 2018 12:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31193 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Phil Sainty Cc: 31193@debbugs.gnu.org, bug-gnu-emacs Received: via spool by 31193-submit@debbugs.gnu.org id=B31193.15240537371353 (code B ref 31193); Wed, 18 Apr 2018 12:16:02 +0000 Received: (at 31193) by debbugs.gnu.org; 18 Apr 2018 12:15:37 +0000 Received: from localhost ([127.0.0.1]:58535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8lzs-0000Ll-QB for submit@debbugs.gnu.org; Wed, 18 Apr 2018 08:15:36 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:52799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f8lzo-0000LJ-DC; Wed, 18 Apr 2018 08:15:32 -0400 Received: by mail-it0-f51.google.com with SMTP id f6-v6so2222499ita.2; Wed, 18 Apr 2018 05:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=cY0VYgPx/WiR+KZSnZm7LkN9R9F0/jCvjsBfr4LbvsE=; b=rXZwzS2QLzovIDLhAYwfSmhTBbEIGt9m++cvQLYjsXcJmNESi84u2gFYf+gXdHvrZv U0sCqWfk4XzX6ELmcpVjzS2NoY6dwp64I85j2Y0U28XnxiZnahumZrI0K8koNEJem36R lC5242uGxuc0fF8Irf4LgDxIcDu5LBxh9GgHWUcGZoBXFQntn0qKqno0EJgJJIH3l1PU HwcFCvwER/O8NnRNWG+1X0Si5AyY9lxumLxgwVCQN5Ha3mfv4r3LPk0/we8QhvN0ge/g s5z4mKKuMdQJAmQGSFVpKTz5VNA83sMvbippirc7o8R0TSXoWsZ+kuCSvS4VgUEVPEkz eYpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=cY0VYgPx/WiR+KZSnZm7LkN9R9F0/jCvjsBfr4LbvsE=; b=ErGX1aDhGFV4XscA5HdoLqQ2FLeX7mJmglaoE75uuY8WpzThU9p/zO90RR3UPzPn9c dgOqbNNiOxgo/2AJofiTo9NERcaT6+U2qJvqvViuJWahARskqkPcZnbOQy3AxDCCKm1A 2wnmnjiOIRCmJlCRMQ+ytMxH8wJn2x+GB8zDMKYDx/4X5MdjrCaF8P2u7+qH+3RmPZ7R 5bZkjsdgNHDRBW2zp+BohFDtJvAlBcgycmnyPp9/+ipBwUg4jDQnKbArKaTQOGUa+Nv8 KKje9tWuHFoSQuonLX4dBy3Ris5VmPFyYK9AdoQVB3oVpMmM4eF4XnJdGUiUyM5nqQth CQbg== X-Gm-Message-State: ALQs6tCJKZBdcXJnbbbE5M2uQg7JNhLCB34LrS9MCw9t/i5qJBuMyPAr yRTq+QRn7Jpck8zGRZbQAZM/Eg== X-Google-Smtp-Source: AIpwx48wE5D28mS6OJZ0jtmTmLmZGGJwJxOXsl5ZrKVOwgitixZTccSukH/eXdPCj/8volkoStv2zw== X-Received: by 2002:a24:3a44:: with SMTP id m65-v6mr2217700itm.74.1524053726565; Wed, 18 Apr 2018 05:15:26 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g16-v6sm5014211ita.0.2018.04.18.05.15.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 05:15:25 -0700 (PDT) From: Noam Postavsky References: <5480f11459b73e4cf0aabe12da5ce675@webmail.orcon.net.nz> <87sh7ut199.fsf@gmail.com> <7063321d07dcc711cc24699e095dfb9d@webmail.orcon.net.nz> <87muy1tm0i.fsf@gmail.com> <032fbfe050521617bf7b8c9a76479a16@webmail.orcon.net.nz> <87h8o9tglt.fsf@gmail.com> <77839205bfe30db7b7a50428065d3714@webmail.orcon.net.nz> Date: Wed, 18 Apr 2018 08:15:23 -0400 In-Reply-To: <77839205bfe30db7b7a50428065d3714@webmail.orcon.net.nz> (Phil Sainty's message of "Wed, 18 Apr 2018 16:23:37 +1200") Message-ID: <877ep4u2w4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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 (-) tags 31193 fixed close 31193 quit I could reproduce the error when using bash 4.3. The main difference in versions seems to be that bash-4.4 repaints the last line of the prompt in reponse to the resize event, whereas bash-4.3 doesn't respond to that event; it just waits for the next user input. Phil Sainty writes: > I observe that whenever I execute a shell command (or just enter a blank > line) and then trigger the error, I get this the first time: > > term-emulate-terminal(# "\015\033[K$\015\n") Although I never got this short string. I always get "\015\033[K\015\n\032/\015\n". Not really that important, it's just kind of tickling my curiosity. Anyways, pushed the fixed to emacs-26. [1: b89ff0efdb]: 2018-04-18 07:33:27 -0400 Don't assume term-current-row cache is valid (Bug#31193) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b89ff0efdb65e9febe4c3ed2586a48a2b42233aa