From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Howard Newsgroups: gmane.emacs.bugs Subject: bug#51877: 27.2; term: error in process filter Date: Thu, 20 Jan 2022 13:01:12 -0900 Message-ID: References: <835yst2plx.fsf@gnu.org> <9693d2632ad1e9ae162fef7e25571dfcdfebe7a2.camel@librehacker.com> <834k8c3hrn.fsf@gnu.org> <87fsppta6s.fsf@gnus.org> <87mtjq4ufk.fsf@gnus.org> <83mtjqpa1l.fsf@gnu.org> <83lezap459.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8601"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 51877@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 21 02:10:03 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAiRH-000226-GA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jan 2022 02:10:03 +0100 Original-Received: from localhost ([::1]:38028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAiRG-0005zH-JB for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Jan 2022 20:10:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAfVL-0003jG-A1 for bug-gnu-emacs@gnu.org; Thu, 20 Jan 2022 17:02:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAfVK-0007Xg-To for bug-gnu-emacs@gnu.org; Thu, 20 Jan 2022 17:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAfVK-0001y0-KQ for bug-gnu-emacs@gnu.org; Thu, 20 Jan 2022 17:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Howard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Jan 2022 22:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51877 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 51877-submit@debbugs.gnu.org id=B51877.16427160937516 (code B ref 51877); Thu, 20 Jan 2022 22:02:02 +0000 Original-Received: (at 51877) by debbugs.gnu.org; 20 Jan 2022 22:01:33 +0000 Original-Received: from localhost ([127.0.0.1]:59547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAfUp-0001x6-Am for submit@debbugs.gnu.org; Thu, 20 Jan 2022 17:01:32 -0500 Original-Received: from mx.kolabnow.com ([212.103.80.153]:38758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAfUm-0001wr-D1 for 51877@debbugs.gnu.org; Thu, 20 Jan 2022 17:01:30 -0500 Original-Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id B941F4209E; Thu, 20 Jan 2022 23:01:21 +0100 (CET) Authentication-Results: ext-mx-out003.mykolab.com (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= in-reply-to:content-transfer-encoding:content-disposition :content-type:content-type:mime-version:references:message-id :subject:subject:from:from:date:date:received:received:received; s=dkim20160331; t=1642716080; x=1644530481; bh=xwCe6O4O6UxqxGIV +tTrc0ac8mOo4GOlTf+utsWerl4=; b=IZyTCfi3eQ4/7CnjNnLJzCsiCV830PWd e+2RshjSRWjIhhFToNYFSMkAQb8M0ajgDQZCR5gTzfU4vZSW8PRESEmWnJ9hLwyb CcZ0ScHeV+lNJZl1y5Z3LwlaP0iBfBy70Md+xbYhs3g6u73RKfU7m0arGx0wl7hf 8sB5n+1TOhDCBOisEMzJcGLdYTNo5xLXVe8e+6k7hFnejj+Zzvf3kCqbpyMRiffo 10osAd/XO35m5qcsbkWovuchn0eOjIlq6eWKOdyxtzdDeGjA+GUUmLkiWk3uvksf EiXg37uUmTR9owsiccB7awEsYonmmEzVJmaAheF+SwkNShiSTGmdDOFpgmQ2xjx1 DwG8jgsMBKYZrjYAs20vzTkUd0gxnh8yGdFPi+NSvJWYr5G/qsDS3JY1hXrh6fVj yo/21YDfiLZLHJQA5FUOxmbCB/54hhmojxU7pmfU5lHw553+GFA6vtIg22xAZfIV UXsEQICEcn1lbRhzF0dqzrI0pJmPQ9WBkIZbW3L+PMqkJ X-Virus-Scanned: amavisd-new at mykolab.com Original-Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M1yts7Misj50; Thu, 20 Jan 2022 23:01:20 +0100 (CET) Original-Received: from int-mx003.mykolab.com (unknown [10.9.13.3]) by mx.kolabnow.com (Postfix) with ESMTPS id 631B44209A; Thu, 20 Jan 2022 23:01:19 +0100 (CET) Original-Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx003.mykolab.com (Postfix) with ESMTPS id 8BB8B474A; Thu, 20 Jan 2022 23:01:18 +0100 (CET) Content-Disposition: inline In-Reply-To: <83lezap459.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224715 Archived-At: On Thu, Jan 20, 2022 at 10:02:10PM +0200, Eli Zaretskii wrote: > I don't think this would help. Can you manually modify the function > term-emulate-terminal to use 'raw-text instead of > locale-coding-system, and then re-run the scenario in which you get > these problems? This seems to generate the same result, except with more elaborate debugger= output: ``` Debugger entered--Lisp error: (args-out-of-range "l \3\220\0332Nn\f\217" 0 = -48) substring("l \3\220\0332Nn\f\217" 0 -48) (insert (substring decoded-substring 0 (- term-width old-column))) (while (> (+ (length decoded-substring) old-column) term-width) (insert (= substring decoded-substring 0 (- term-width old-column))) (delete-region (p= oint) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-curr= ent-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t = rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- = term-width old-column))) (setq old-column 0)) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring= ) old-column) term-width) (insert (substring decoded-substring 0 (- term-wi= dth old-column))) (delete-region (point) (line-end-position)) (term-down 1 = t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (= point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substri= ng (substring decoded-substring (- term-width old-column))) (setq old-colum= n 0))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) = (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) = old-column) term-width) (insert (substring decoded-substring 0 (- term-widt= h old-column))) (delete-region (point) (line-end-position)) (term-down 1 t)= (term-move-columns (- (term-current-column))) (add-text-properties (1- (po= int)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring= (substring decoded-substring (- term-width old-column))) (setq old-column = 0))) (insert decoded-substring) (setq term-current-column (current-column) = columns (- term-current-column old-column)) (if (not (or (eobp) term-insert= -mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-reg= ion pos (point)) (setq term-current-column nil)))) (if term-insert-mode (pr= ogn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) = (progn (delete-region (- ... ...) (point)))) (goto-char pos)))) (put-text-p= roperty old-point (point) 'font-lock-face term-current-face)) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-col= umn 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-c= oding-string (substring str i funny) 'raw-text t)) (if (=3D funny str-lengt= h) (progn (let ((partial 0) (count (length decoded-substring))) (while (and= (< partial count) (eq (char-charset ...) 'eight-bit)) (setq partial (1+ pa= rtial))) (if (> count partial 0) (progn (setq term-terminal-undecoded-bytes= (substring decoded-substring ...)) (setq decoded-substring (substring deco= ded-substring 0 ...)) (setq str-length (- str-length partial)) (setq funny = (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-po= int (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (leng= th decoded-substring) old-column) term-width) (insert (substring decoded-su= bstring 0 (- term-width old-column))) (delete-region (point) (line-end-posi= tion)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-t= ext-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (= setq decoded-substring (substring decoded-substring (- term-width old-colum= n))) (setq old-column 0))) (insert decoded-substring) (setq term-current-co= lumn (current-column) columns (- term-current-column old-column)) (if (not = (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-column= s columns) (delete-region pos (point)) (setq term-current-column nil)))) (i= f term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (curren= t-column) term-width) (progn (delete-region ... ...))) (goto-char pos)))) (= put-text-property old-point (point) 'font-lock-face term-current-face)) (if= (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq = term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i fun= ny)) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (= term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-sub= string (decode-coding-string (substring str i funny) 'raw-text t)) (if (=3D= funny str-length) (progn (let ((partial 0) (count (length decoded-substrin= g))) (while (and (< partial count) (eq ... ...)) (setq partial (1+ partial)= )) (if (> count partial 0) (progn (setq term-terminal-undecoded-bytes ...) = (setq decoded-substring ...) (setq str-length ...) (setq funny ...)))))) (l= et ((old-column (term-horizontal-column)) (old-point (point)) columns) (if = term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-= column) term-width) (insert (substring decoded-substring 0 (- term-width ol= d-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (te= rm-move-columns (- (term-current-column))) (add-text-properties (1- (point)= ) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (su= bstring decoded-substring (- term-width old-column))) (setq old-column 0)))= (insert decoded-substring) (setq term-current-column (current-column) colu= mns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mod= e)) (progn (let ((pos ...)) (term-move-columns columns) (delete-region pos = (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let= ((pos ...)) (end-of-line) (if (> ... term-width) (progn ...)) (goto-char p= os)))) (put-text-property old-point (point) 'font-lock-face term-current-fa= ce)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1= ) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (se= tq i funny))) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and = funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-= match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-= undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-len= gth)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down = 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decod= ed-substring (decode-coding-string (substring str i funny) 'raw-text t)) (i= f (=3D funny str-length) (progn (let ((partial 0) (count ...)) (while (and = =2E.. ...) (setq partial ...)) (if (> count partial 0) (progn ... ... ... .= =2E.))))) (let ((old-column (term-horizontal-column)) (old-point (point)) c= olumns) (if term-suppress-hard-newline nil (while (> (+ ... old-column) ter= m-width) (insert (substring decoded-substring 0 ...)) (delete-region (point= ) (line-end-position)) (term-down 1 t) (term-move-columns (- ...)) (add-tex= t-properties (1- ...) (point) '...) (setq decoded-substring (substring deco= ded-substring ...)) (setq old-column 0))) (insert decoded-substring) (setq = term-current-column (current-column) columns (- term-current-column old-col= umn)) (if (not (or (eobp) term-insert-mode)) (progn (let (...) (term-move-c= olumns columns) (delete-region pos ...) (setq term-current-column nil)))) (= if term-insert-mode (progn (let (...) (end-of-line) (if ... ...) (goto-char= pos)))) (put-text-property old-point (point) 'font-lock-face term-current-= face)) (if (eq (term-current-column) term-width) (progn (term-move-columns = -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (= setq i funny))) (let* ((val (and (<=3D ctl-end str-length) (aref str i)))) = (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column = (min (1- term-width) (+ col 8 ...))))) ((eql val 13) (funcall term-vertical= -motion 0) (setq term-current-column term-start-line-column)) ((eql val 10)= (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1= t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val= 26) (funcall term-command-function (decode-coding-string (substring str (1= + i) (- ctl-end ...)) locale-coding-system t))) ((eql val 27) (let* ((val (= aref str ...))) (cond ((eql val 91) (if ... ...)) ((eql val 68) (term-handl= e-deferred-scroll) (term-down 1 t)) ((eql val 77) (if ... ... ...)) ((eql v= al 55) (term-handle-deferred-scroll) (setq term-saved-cursor ...)) ((eql va= l 56) (if term-saved-cursor ...)) ((eql val 99) (term-reset-terminal)) ((eq= l val 65) (term-handle-ansi-terminal-messages ...)) (t nil)))) ((memql val = '(nil 15 14 0)) nil) (t (let ((x0 val)) (error "No clause matching `%S'" x0= ))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrappin= g nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term= -width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (=3D = 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) = (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-term= inal-undecoded-bytes 0 13)) (goto-char (point-max))) (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 ctl= -end))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp= str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-en= d (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (= string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-te= rminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ = str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (ter= m-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (set= q decoded-substring (decode-coding-string (substring str i funny) 'raw-text= t)) (if (=3D funny str-length) (progn (let (... ...) (while ... ...) (if .= =2E. ...)))) (let ((old-column (term-horizontal-column)) (old-point (point)= ) columns) (if term-suppress-hard-newline nil (while (> ... term-width) (in= sert ...) (delete-region ... ...) (term-down 1 t) (term-move-columns ...) (= add-text-properties ... ... ...) (setq decoded-substring ...) (setq old-col= umn 0))) (insert decoded-substring) (setq term-current-column (current-colu= mn) columns (- term-current-column old-column)) (if (not (or ... term-inser= t-mode)) (progn (let ... ... ... ...))) (if term-insert-mode (progn (let ..= =2E ... ... ...))) (put-text-property old-point (point) 'font-lock-face ter= m-current-face)) (if (eq (term-current-column) term-width) (progn (term-mov= e-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-col= umn nil) (setq i funny))) (let* ((val (and (<=3D ctl-end str-length) (aref = str i)))) (cond ((eql val 9) (let ((col ...)) (term-move-to-column (min ...= ...)))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-= column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list = (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-= columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-fun= ction (decode-coding-string (substring str ... ...) locale-coding-system t)= )) ((eql val 27) (let* ((val ...)) (cond (... ...) (... ... ...) (... ...) = (... ... ...) (... ...) (... ...) (... ...) (t nil)))) ((memql val '(nil 15= 14 0)) nil) (t (let ((x0 val)) (error "No clause matching `%S'" x0))))) (i= f (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) = (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) = 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (=3D 0 i) (se= tq term-terminal-undecoded-bytes (concat "\15" ...)) (setq term-terminal-un= decoded-bytes (substring str ...)) (aset term-terminal-undecoded-bytes 0 13= )) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (s= etq term-pager-old-filter (process-filter proc)) (set-process-filter proc t= erm-pager-filter) (setq i str-length)) (setq i ctl-end)))) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (= current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (pr= ocess-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-un= decoded-bytes nil))) (while (< i str-length) (setq funny (string-match term= -control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 st= r))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-e= nd 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if = funny (setq term-terminal-undecoded-bytes ...) (setq funny str-length)) (1+= str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (te= rm-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (se= tq decoded-substring (decode-coding-string (substring str i funny) 'raw-tex= t t)) (if (=3D funny str-length) (progn (let ... ... ...))) (let ((old-colu= mn ...) (old-point ...) columns) (if term-suppress-hard-newline nil (while = =2E.. ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-c= urrent-column (current-column) columns (- term-current-column old-column)) = (if (not ...) (progn ...)) (if term-insert-mode (progn ...)) (put-text-prop= erty old-point (point) 'font-lock-face term-current-face)) (if (eq (term-cu= rrent-column) term-width) (progn (term-move-columns -1) (setq term-do-line-= wrapping ...))) (setq term-current-column nil) (setq i funny))) (let* ((val= (and (<=3D ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let (..= =2E) (term-move-to-column ...))) ((eql val 13) (funcall term-vertical-motio= n 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (= and term-kill-echo-list ...) nil (term-down 1 t))) ((eql val 8) (term-move-= columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-fun= ction (decode-coding-string ... locale-coding-system t))) ((eql val 27) (le= t* (...) (cond ... ... ... ... ... ... ... ...))) ((memql val '...) nil) (t= (let (...) (error "No clause matching `%S'" x0))))) (if (eq term-do-line-w= rapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-l= ocal-map (progn (if (> (% ... term-width) 0) (setq term-terminal-undecoded-= bytes (substring str i)) (if (=3D 0 i) (setq term-terminal-undecoded-bytes = =2E..) (setq term-terminal-undecoded-bytes ...) (aset term-terminal-undecod= ed-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-o= ld-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-= filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (progn (if (marker-buffer term-pending-delete-marker) (progn (delete-regi= on term-pending-delete-marker (process-mark proc)) (set-marker term-pending= -delete-marker nil))) (if (/=3D (point) (process-mark proc)) (progn (setq s= ave-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buff= er) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq= save-marker (copy-marker (process-mark proc))) (goto-char (process-mark pr= oc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (e= q (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) = (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffe= r))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-termin= al-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal= -undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match t= erm-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1= str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (matc= h-end 0) (setq funny ...) (if funny ... ...) (1+ str-length)))) (if (> funn= y i) (progn (if term-do-line-wrapping (progn ... ... ...)) (setq decoded-su= bstring (decode-coding-string ... ... t)) (if (=3D funny str-length) (progn= ...)) (let (... ... columns) (if term-suppress-hard-newline nil ...) (inse= rt decoded-substring) (setq term-current-column ... columns ...) (if ... ..= =2E) (if term-insert-mode ...) (put-text-property old-point ... ... term-cu= rrent-face)) (if (eq ... term-width) (progn ... ...)) (setq term-current-co= lumn nil) (setq i funny))) (let* ((val (and ... ...))) (cond ((eql val 9) (= let ... ...)) ((eql val 13) (funcall term-vertical-motion 0) (setq term-cur= rent-column term-start-line-column)) ((eql val 10) (if ... nil ...)) ((eql = val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcal= l term-command-function ...)) ((eql val 27) (let* ... ...)) ((memql val ...= ) nil) (t (let ... ...)))) (if (eq term-do-line-wrapping (point)) nil (setq= term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> ...= 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-cha= r ...)) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-f= ilter (process-filter proc)) (set-process-filter proc term-pager-filter) (s= etq i str-length)) (setq i ctl-end))))) (if (>=3D (term-current-row) term-h= eight) (progn (term-handle-deferred-scroll))) (set-marker (process-mark pro= c) (point)) (if (stringp decoded-substring) (progn (term-watch-for-password= -prompt decoded-substring))) (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-f= rame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win s= elected) (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-s= croll-to-bottom-on-output)) (select-window win) (if (or ... ... ... ... ...= ) (progn ... ... ... ...)) (if (and term-scroll-show-maximum-output ...) (p= rogn ...))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) = (progn (save-excursion (goto-char (process-mark (get-buffer-process (curren= t-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line= ) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (unwind-protect (progn (if (marker-buffer term-pending-delete-marker) (pr= ogn (delete-region term-pending-delete-marker (process-mark proc)) (set-mar= ker term-pending-delete-marker nil))) (if (/=3D (point) (process-mark proc)= ) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if = (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertica= l-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char = (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mar= k proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-reg= ion (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ st= r term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (co= ncat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (se= tq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny= (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny= ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...)= )) (if (> funny i) (progn (if term-do-line-wrapping ...) (setq decoded-subs= tring ...) (if ... ...) (let ... ... ... ... ... ... ...) (if ... ...) (set= q term-current-column nil) (setq i funny))) (let* ((val ...)) (cond (... ..= =2E) (... ... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... n= il) (t ...))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line= -wrapping nil)) (if term-pager-old-local-map (progn (if ... ... ... ...) (m= ake-local-variable ...) (setq term-pager-old-filter ...) (set-process-filte= r proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (if (>= =3D (term-current-row) term-height) (progn (term-handle-deferred-scroll))) = (set-marker (process-mark proc) (point)) (if (stringp decoded-substring) (p= rogn (term-watch-for-password-prompt decoded-substring))) (if save-point (p= rogn (goto-char save-point) (set-marker save-point nil))) (if (and term-pen= ding-frame (eq (window-buffer selected) (current-buffer))) (progn (term-dis= play-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pen= ding-frame nil))) (setq win selected) (while (window-minibuffer-p win) (set= q 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 (...) (select-window win) (if ... ...) (if ... ...)))) (not (= eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursi= on (goto-char (process-mark (get-buffer-process ...))) (forward-line (- ter= m-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (poi= nt))))) (set-marker save-marker nil)) (internal--after-save-selected-window= save-selected-window--state)) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-pendi= ng-delete-marker) (progn (delete-region term-pending-delete-marker (process= -mark proc)) (set-marker term-pending-delete-marker nil))) (if (/=3D (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-mar= k proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (po= int-max) (process-mark proc)) (not (eq ... term-raw-map))) (progn (narrow-t= o-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (pri= nc str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq st= r (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)= ) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq = funny (string-match term-control-seq-regexp str i)) (let ((ctl-params ...) = (ctl-params-end ...) (ctl-end ...)) (if (> funny i) (progn ... ... ... ... = =2E.. ... ...)) (let* (...) (cond ... ... ... ... ... ... ... ... ...)) (if= (eq term-do-line-wrapping ...) nil (setq term-do-line-wrapping nil)) (if t= erm-pager-old-local-map (progn ... ... ... ... ...) (setq i ctl-end))))) (i= f (>=3D (term-current-row) term-height) (progn (term-handle-deferred-scroll= ))) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring= ) (progn (term-watch-for-password-prompt decoded-substring))) (if save-poin= t (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 p= roc)) (progn (let ... ... ... ...))) (not (eq win last-win)))) (if (> term-= buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark ...)= ) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-r= egion (point-min) (point))))) (set-marker save-marker nil)) (internal--afte= r-save-selected-window save-selected-window--state))) (let ((save-selected-window--state (internal--before-save-selected-window= ))) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-pen= ding-delete-marker) (progn (delete-region term-pending-delete-marker (proce= ss-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/=3D (poi= nt) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq te= rm-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-moti= on 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-m= ark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> .= =2E. ...) (not ...)) (progn (narrow-to-region ... ...))) (if term-log-buffe= r (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (p= rogn (setq str ...) (setq str-length ...) (setq term-terminal-undecoded-byt= es nil))) (while (< i str-length) (setq funny (string-match term-control-se= q-regexp str i)) (let (... ... ...) (if ... ...) (let* ... ...) (if ... nil= ...) (if term-pager-old-local-map ... ...)))) (if (>=3D (term-current-row)= term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-m= ark proc) (point)) (if (stringp decoded-substring) (progn (term-watch-for-p= assword-prompt decoded-substring))) (if save-point (progn (goto-char save-p= oint) (set-marker save-point nil))) (if (and term-pending-frame (eq (window= -buffer selected) (current-buffer))) (progn (term-display-line (car term-pe= nding-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (set= q 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 ... ...) (progn ...)) (not (eq win last-win)))) (if (> term-buf= fer-maximum-size 0) (progn (save-excursion (goto-char ...) (forward-line ..= =2E) (beginning-of-line) (delete-region ... ...)))) (set-marker save-marker= nil)) (internal--after-save-selected-window save-selected-window--state)))) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-= read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (st= r-length (length str))) (let ((save-selected-window--state (internal--befor= e-save-selected-window))) (save-current-buffer (unwind-protect (progn (if (= marker-buffer term-pending-delete-marker) (progn (delete-region term-pendin= g-delete-marker ...) (set-marker term-pending-delete-marker nil))) (if (/= =3D (point) (process-mark proc)) (progn (setq save-point ...))) (setq term-= vertical-motion (if (eq ... ...) 'vertical-motion 'term-buffer-vertical-mot= ion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (proc= ess-mark proc)) (save-restriction (if (and ... ...) (progn ...)) (if term-l= og-buffer (progn ...)) (if term-terminal-undecoded-bytes (progn ... ... ...= )) (while (< i str-length) (setq funny ...) (let ... ... ... ... ...))) (if= (>=3D (term-current-row) term-height) (progn (term-handle-deferred-scroll)= )) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring)= (progn (term-watch-for-password-prompt decoded-substring))) (if save-point= (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-= pending-frame (eq ... ...)) (progn (term-display-line ... ...) (setq term-p= ending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (s= etq win (next-window win nil t))) (setq last-win win) (while (progn (setq w= in ...) (if ... ...) (not ...))) (if (> term-buffer-maximum-size 0) (progn = (save-excursion ... ... ... ...))) (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) funn= y decoded-substring save-point save-marker win (inhibit-read-only t) (buffe= r-undo-list t) (selected (selected-window)) last-win (str-length (length st= r))) (let ((save-selected-window--state (internal--before-save-selected-win= dow))) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-= pending-delete-marker) (progn ... ...)) (if (/=3D ... ...) (progn ...)) (se= tq term-vertical-motion (if ... ... ...)) (setq save-marker (copy-marker ..= =2E)) (goto-char (process-mark proc)) (save-restriction (if ... ...) (if te= rm-log-buffer ...) (if term-terminal-undecoded-bytes ...) (while ... ... ..= =2E)) (if (>=3D ... term-height) (progn ...)) (set-marker (process-mark pro= c) (point)) (if (stringp decoded-substring) (progn ...)) (if save-point (pr= ogn ... ...)) (if (and term-pending-frame ...) (progn ... ...)) (setq win s= elected) (while (window-minibuffer-p win) (setq win ...)) (setq last-win wi= n) (while (progn ... ... ...)) (if (> term-buffer-maximum-size 0) (progn ..= =2E)) (set-marker save-marker nil)) (internal--after-save-selected-window s= ave-selected-window--state))))) (if (get-buffer-window (current-buffer)) (p= rogn (redisplay)))) term-emulate-terminal(# "l\0$\334\236\217\2\214#\2\342n= \4\4\f\204\4l\344\fc|\216\203\3\344\23\333r\223B\204\fc\204\373oN\276\0lNn\= 234\343\354\fc\34p...") ```