GNU bug report logs - #13350
24.2; term.el is confused when bash prints almost 4096 bytes

Previous Next

Package: emacs;

Reported by: Johan Claesson <johanclaesson <at> bredband.net>

Date: Thu, 3 Jan 2013 20:32:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 24.2

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: npostavs <at> users.sourceforge.net
To: Johan Claesson <johanclaesson <at> bredband.net>
Cc: 13350 <at> debbugs.gnu.org
Subject: bug#13350: 24.2; term.el is confused when bash prints almost 4096 bytes
Date: Wed, 28 Dec 2016 21:20:38 -0500
[Message part 1 (text/plain, inline)]
tags 13350 patch
quit

Johan Claesson <johanclaesson <at> bredband.net> writes:

> emacs -Q
> M-x ansi-term
> /bin/bash
> cd /tmp
> printf '%4090s' x
>
> On my system this gives the error message:
>
> error in process filter: No such directory found via CDPATH environment variable
>
> I think the following is happening:
>
> - Bash will after each command send ?\032 and the current directory
>   "/tmp" to inform term.el. 
> - Bash output is buffered in 4096 bytes chunks.  The end of the first
>   chunk will be "/tm"
> - term.el interprets "/tm" as the current directory and tries to cd
>   there.  Since /tm does not exist it signals an error.
>

Yes, by doing M-x trace-function RET term-emulate-terminal RET, it's
easy to see the chunking.

> I don't know if this buffer size of 4096 varies from system to system.
> In that case maybe the above recipe will not trigger the error on all
> systems. 
>

I needed to use printf '%4088s' x, not sure why the difference.
 
> The following term.el patch is an attempt to fix this:

Patch looks good.  I will push to master in a week or so, unless there
are objections (I added a commit message, see attached).

[v1-0001-Fix-term.el-handling-of-Z-sequences-spanning-chun.patch (text/plain, attachment)]

This bug report was last modified 8 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.