unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Christopher Howard <christopher@librehacker.com>
Cc: larsi@gnus.org, 51877@debbugs.gnu.org
Subject: bug#51877: 27.2; term: error in process filter
Date: Fri, 21 Jan 2022 10:04:12 +0200	[thread overview]
Message-ID: <837datplab.fsf@gnu.org> (raw)
In-Reply-To: <YenbqPJEKwcmnrHy@theoden> (message from Christopher Howard on Thu, 20 Jan 2022 13:01:12 -0900)

> Date: Thu, 20 Jan 2022 13:01:12 -0900
> From: Christopher Howard <christopher@librehacker.com>
> 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.





  reply	other threads:[~2022-01-21  8:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 19:10 bug#51877: 27.2; term: error in process filter Christopher Howard
2021-11-15 19:14 ` Christopher Howard
2021-11-15 19:19 ` Eli Zaretskii
2021-11-15 19:33   ` Christopher Howard
2021-11-15 22:36   ` Christopher Howard
2021-11-16  3:23     ` Eli Zaretskii
2022-01-15 13:12       ` Lars Ingebrigtsen
2022-01-16  6:14         ` Christopher Howard
2022-01-17 19:30         ` Christopher Howard
2022-01-20  9:39           ` Lars Ingebrigtsen
2022-01-20 17:39             ` Christopher Howard
2022-01-20 17:46               ` Lars Ingebrigtsen
2022-01-20 17:54               ` Eli Zaretskii
2022-01-20 19:06                 ` Christopher Howard
2022-01-20 20:02                   ` Eli Zaretskii
2022-01-20 22:01                     ` Christopher Howard
2022-01-21  8:04                       ` Eli Zaretskii [this message]
2022-02-19 12:58                         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837datplab.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=51877@debbugs.gnu.org \
    --cc=christopher@librehacker.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).