From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#51877: 27.2; term: error in process filter Date: Fri, 21 Jan 2022 10:04:12 +0200 Message-ID: <837datplab.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17899"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 51877@debbugs.gnu.org To: Christopher Howard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 21 10:59:07 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 1nAqhG-0004UN-PH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jan 2022 10:59:06 +0100 Original-Received: from localhost ([::1]:45796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAqhF-0001ap-Ie for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jan 2022 04:59:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAouw-0006oD-0N for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2022 03:05:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAous-0006kL-9v for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2022 03:05:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAour-0003Jl-V6 for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2022 03:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Jan 2022 08:05:01 +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.164275227812714 (code B ref 51877); Fri, 21 Jan 2022 08:05:01 +0000 Original-Received: (at 51877) by debbugs.gnu.org; 21 Jan 2022 08:04:38 +0000 Original-Received: from localhost ([127.0.0.1]:60100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAouT-0003Iy-Qx for submit@debbugs.gnu.org; Fri, 21 Jan 2022 03:04:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAouP-0003Ij-Rq for 51877@debbugs.gnu.org; Fri, 21 Jan 2022 03:04:37 -0500 Original-Received: from [2001:470:142:3::e] (port=35228 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAouA-0004Ez-HI; Fri, 21 Jan 2022 03:04:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Hh2pvntDAi6t+TgkOhVaXCaTDyDbCqWmDYKHgtfnYhE=; b=NY0h8Tb7gAdQ 1GE+9R5++yYrxYi4TQ2tkOOO7dlU10BqK427QUs58KpJ4U8vLMO7+3U5Q+pnr+CA3xxiuh0ssmnQc 4ddiZI9B88OD9v5ddY/ELO/HQ8e+WfaOprqmQPIxuJ7Zz9ofndAmpVODtiu0mABxOvSPBtgUI5n1L fJh+kdH9gDHtsVwHRDZRZQ2/HADaOiT7PUmvm/K9rME2G4uhaIVLknzMafGWm5A/aosbhzHDC0dZF nCgNY02ytWSk+aFYXNJBOgBQ5JMu22bO3YXJH0uQyMdXIKTM3ee6Bcj1sQ47LLZIzCMcvgZUId/8k 2hx+5f3YE2ApO8+MrsMcww==; Original-Received: from [87.69.77.57] (port=1667 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAou6-0005XB-4b; Fri, 21 Jan 2022 03:04:14 -0500 In-Reply-To: (message from Christopher Howard on Thu, 20 Jan 2022 13:01:12 -0900) 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:224734 Archived-At: > Date: Thu, 20 Jan 2022 13:01:12 -0900 > From: Christopher Howard > Cc: larsi@gnus.org, 51877@debbugs.gnu.org > > 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 (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-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0)) Ouch! This code evidently assumes that every character takes just one column on display, because it uses column counts as indices into strings. That assumption obviously breaks with binary garbage, where many bytes are displayed as octal escapes, which take no less than 4 columns. So my conclusion is that this can never work, unless this central assumption of term.el is removed, and the code redesigned and reimplemented not to depend on column counts. IOW, i its current shape, term.el is utterly incapable of supporting display of raw bytes. Sorry.