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


Message #14 received at 13350 <at> debbugs.gnu.org (full text, mbox):

From: Johan Claesson <johanclaesson <at> bredband.net>
To: Oleksandr Gavenko <gavenkoa <at> gmail.com>
Cc: 13350 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: I have same issue in Emacs 24.3.1 (error in process filter: cd:
 No such directory found via CDPATH environment variable)
Date: Sat, 26 Oct 2013 16:14:05 +0200
[Message part 1 (text/plain, inline)]

Hi Oleksandr,

This error is also depending on the current directory.  Or actually just
how long the current $PWD is.  

If you go to /tmp then printf '%4090s' x should trigger the error. 

I think this error is triggered when the commands output is less than
4096 but the sum of the commands output plus the size of current $PWD is
above 4096. (Or N*4096).  Bash appends the $PWD to the commands output
to tell term.el the current directory.  This is made invisible by
term.el.  On the way from the shell to term.el there seem to be
something that splits stuff that is greater than 4096 into fragments.
And term.el do not currently handle when the $PWD is split across two
fragments.

Attached is term-fix.el which contains the term-emulate-terminal
function with the patch applied.  If you evaluate that the error should
go away.

Regards,

/Johan

[term-fix.el (application/emacs-lisp, attachment)]
[Message part 3 (text/plain, inline)]




Oleksandr Gavenko <gavenkoa <at> gmail.com> writes:

> I get:
>
>   error in process filter: cd: No such directory found via CDPATH environment variable
>   error in process filter: No such directory found via CDPATH environment variable
>
> when in "M-x term" run:
>
>   ldd `which emacs`
>
> *Backtrace* shown:
>
> Debugger entered--Lisp error: (error "No such directory found via CDPATH environment variable")
>   signal(error ("No such directory found via CDPATH environment variable"))
>   error("No such directory found via CDPATH environment variable")
>   cd("/home/user/devel/my-deve") #[(string) "\306\232\203.\307\207\310H\311U\2031.\312\313\314#.\312\313	T#.\314	O.\315	T\nO!.\fB\211.,\207\310H\316U\203@.\317\314\320O!\207\307\207" [string first-colon second-colon filename fileline term-pending-frame "" t 0 26 string-match ":" 1 string-to-number 47 cd nil] 4]("//home/user/devel/my-deve")  term-emulate-terminal(#<process terminal> "6_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f01a9ba5000).\n --==XXXXXXX==--	libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f01a1589000).\n.//home/user/devel/my-deve")
>
> I drop about 4KiB of ldd output at --==XXXXXXX==-- point.
>
> Original example with:
>
>   printf '%4090s' x
>
> and
>
>  printf '%40000s' x
>
> work without problem.
>
> Links:
>
>   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13350
>                 24.2; term.el is confused when bash prints almost 4096 bytes
>   http://lists.gnu.org/archive/html/bug-gnu-emacs/2006-10/msg00036.html
>                 CDPATH problem reappears when using octave-2.9.9 from Emacs 23

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.