From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 03 15:31:37 2013 Received: (at submit) by debbugs.gnu.org; 3 Jan 2013 20:31:37 +0000 Received: from localhost ([127.0.0.1]:41991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqrRw-0008If-1y for submit@debbugs.gnu.org; Thu, 03 Jan 2013 15:31:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46585) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TqrRs-0008IT-QT for submit@debbugs.gnu.org; Thu, 03 Jan 2013 15:31:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqrRn-00028y-1f for submit@debbugs.gnu.org; Thu, 03 Jan 2013 15:31:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:39310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqrRm-00028u-UV for submit@debbugs.gnu.org; Thu, 03 Jan 2013 15:31:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqrRl-0006ca-08 for bug-gnu-emacs@gnu.org; Thu, 03 Jan 2013 15:31:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqrRi-00028R-J3 for bug-gnu-emacs@gnu.org; Thu, 03 Jan 2013 15:31:24 -0500 Received: from smtprelay-b21.telenor.se ([195.54.99.212]:51786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqrRi-000287-23 for bug-gnu-emacs@gnu.org; Thu, 03 Jan 2013 15:31:22 -0500 Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-b21.telenor.se (Postfix) with ESMTP id 9AFC3E9FCA for ; Thu, 3 Jan 2013 21:31:18 +0100 (CET) X-SMTPAUTH-B2: [b157288] X-SENDER-IP: [85.224.212.168] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkZUALrp5VBV4NSoPGdsb2JhbABFg0iCCbAhh14XAwEBAQE4NIJ7EwEnJA8lAQQlCkuHeZgznhIUjFkFgQGDJwOXKJIhgWgIFw X-IronPort-AV: E=Sophos;i="4.84,405,1355094000"; d="scan'208";a="259627219" Received: from c-a8d4e055.1542-1-64736c20.cust.bredbandsbolaget.se (HELO goblin) ([85.224.212.168]) by ipb3.telenor.se with ESMTP; 03 Jan 2013 21:31:17 +0100 From: Johan Claesson To: bug-gnu-emacs@gnu.org Subject: 24.2; term.el is confused when bash prints almost 4096 bytes Date: Thu, 03 Jan 2013 21:31:16 +0100 Message-ID: <87y5gat3e3.fsf@bredband.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --=-=-= Content-Type: text/plain 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. 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. The following term.el patch is an attempt to fix this: --- original/term.el 2013-01-03 20:33:13.862726000 +0100 +++ elisp/term.el 2013-01-03 20:35:02.374726000 +0100 @@ -2895,11 +2895,11 @@ (beep t)) ((and (eq char ?\032) (not handled-ansi-message)) - (let ((end (string-match "\r?$" str i))) + (let ((end (string-match "\r?\n" str i))) (if end (funcall term-command-hook (prog1 (substring str (1+ i) end) - (setq i (match-end 0)))) + (setq i (1- (match-end 0))))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) I guess that all 032 escape sequences ends with a newline and that this is what the regex wants to detect. But the current regex "\r?$" will match all strings. And therefore the mechanism for saving the first part of the command until the second part arrives will never run. Regards, /Johan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=term.patch --- original/term.el 2013-01-03 20:33:13.862726000 +0100 +++ elisp/term.el 2013-01-03 20:35:02.374726000 +0100 @@ -2895,11 +2895,11 @@ (beep t)) ((and (eq char ?\032) (not handled-ansi-message)) - (let ((end (string-match "\r?$" str i))) + (let ((end (string-match "\r?\n" str i))) (if end (funcall term-command-hook (prog1 (substring str (1+ i) end) - (setq i (match-end 0)))) + (setq i (1- (match-end 0))))) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) (setq i str-length)))) --=-=-= Content-Type: text/plain In GNU Emacs 24.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-09-03 on goblin Windowing system distributor `The X.Org Foundation', version 11.0.11203000 Configured using: `configure '--prefix=/home/jcl/usr' '--without-toolkit-scroll-bars' '-C' '--disable-maintainer-mode' '--without-compress-info'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Buffer Menu Minor modes in effect: global-cwarn-mode: t which-function-mode: t display-time-mode: t icomplete-mode: t minibuffer-depth-indicate-mode: t diff-auto-refine-mode: t shell-dirtrack-mode: t ido-everywhere: t electric-layout-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-q C-q SPC C-r C-n C-n C-n C-n C-n C-n C-n C-a C-k C-k C-k C-k C-k C-k C-k C-k C-x C-s M-x m a n d i f f C-s n a u r M-x m a n p a t c h C-s C-s d i f f SPC - N a u r SPC o r i e l i t e r C-) SPC t e r m . p a t c h C-x C-f C-f t e r M-x r e p o r t - e m b - q C-g M-x q c d C D P A T H SPC t e r m C-x o C-x C-b M-x f i n d - f u n r e p l o r t - e m b u - q M-f C-s C-d C-r C-r C-s C-d C-s C-s M-x r e p o r t - e m b Recent messages: Quit call-interactively: Buffer is read-only: # Contacting host: debbugs.gnu.org:80 Reporting new bug! [2 times] Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %; q to quit; ? for help. Reporting new bug! Making completion list... Mark saved where search started [2 times] scroll-down: Beginning of buffer [2 times] Reverting buffer `procmail_inbox'. Load-path shadows: /home/jcl/elisp/term hides /home/jcl/usr/share/emacs/24.2/lisp/term /home/jcl/elisp/elpa/emms-20121219.1939/tq hides /home/jcl/usr/share/emacs/24.2/lisp/emacs-lisp/tq Features: (shadow emacsbug smerge-mode gnus-fun vc-bzr man tabify w3m-form w3m-lnum w3m-bookmark w3m-tabmenu w3m-session cl-specs edebug jcl-wesnoth-init wesnoth-mode wesnoth-wml-data wesnoth-update emms-bookmarks emms-lastfm-client emms-cue emms-mode-line-icon emms-browser emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd emms-lyrics emms-url emms-streams emms-tag-editor emms-info-metaflac emms-mark emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode elp nnrss xml mm-url tramp-cache mailalias hippie-exp dabbrev gnus-dired url-cache url-http url-gw url-auth haskell-mode jcl-w3m w3m-search jcl-work-buffer jcl-games jcl-text-translator-init text-translator text-translator-window text-translator-vars text-translator-sites jcl-muse htmlize-hack htmlize muse-latex muse-html muse-xml-common muse-colors cus-edit cus-start cus-load muse-publish muse-project muse-protocols muse-regexps muse muse-nested-tags muse-mode jcl-dictem-init dictem jcl-yaoddmuse yaoddmuse-extension w3m doc-view jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util yaoddmuse url url-proxy url-privacy url-expand url-methods url-history url-cookie url-util url-parse url-vars sgml-mode find-lisp flow-fill sort smiley gnus-cite mail-extr gnus-bcklg flymake gnus-async skeleton misearch multi-isearch add-log vc-git scheme org-indent image-file org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-info org-gnus org-docview org-bibtex bibtex org-bbdb jcl-renegade-goblin jcl-home-boot eldoc jcl-status autorevert network-stream tls jcl-stumpwm jcl-slime slime-fancy slime-fontifying-fu slime-package-fu slime-references slime-scratch slime-presentations slime-fuzzy slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-parse slime-repl slime derived hyperspec browse-url mule-util flyspell qp parse-time gnus-ml nndraft nnmh nnfolder nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig nntp gnus-cache jcl-gnus-init jcl-gnus gnus-sum nnoo gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range gnus-win mailcap starttls smtpmail sendmail message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus gnus-ems nnheader mail-utils wid-edit jcl-goblin fuzzy-match jcl-load-beta jcl-torrent text-translator-load jcl-calendar-init appt jcl-calendar holidays hol-loaddefs diary-lib diary-loaddefs jcl-emms-init emms-playing-time emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-info later-do emms-playlist-mode emms-player-vlc emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file locate emms-setup emms emms-compat jcl-org-init org-latex org-export-latex org-beamer org-exp ob-exp org-exp-blocks org-agenda footnote org ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys ob ob-eval org-pcomplete org-list org-faces org-compat org-entities org-macs cal-menu calendar cal-loaddefs jcl-erc-init jcl-file-cache-init jcl-grep-sbg sbg jcl-ido-init jcl-dired dired-x dired-details wdired dired-aux jcl-register-init jcl-command-subset-init jcl-generic generic-x jcl-erlang-init jcl-ssit jcl-sbg jcl-erlang-log bookmark pp jcl-eel bindat jcl-sbg-ssit erlang-eunit jcl-erlang distel-ie edb patmatch erl-service derl erlext epmd net-fsm erl distel erlang etags tempo jcl-safe jcl-abbrev-init jcl-swedish-postfix quail help-mode jcl-ediff ediff-merg ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff jcl-term time-stamp ange-ftp jcl-face hl-line jcl-modes-init jcl-rfc rfcview view goto-addr proced table picture noutline outline inf-ruby edmacro ruby-mode sh-script hideshow cwarn jcl-imenu jcl-global-init which-func imenu time winner thingatpt paren mic-paren printing ps-print ps-def lpr icomplete ispell uniquify mb-depth midnight whitespace ffap saveplace dired-details-autoloads eimp-autoloads emms-autoloads erlang-autoloads fuzzy-match-autoloads haskell-mode-autoloads htmlize-autoloads inf-ruby-autoloads lua-mode-autoloads mediawiki-autoloads mic-paren-autoloads muse-autoloads nrepl-autoloads clojure-mode-autoloads slime-autoloads tabbar-autoloads w3m-autoloads yaoddmuse-autoloads package tabulated-list jcl-keys-init diff-mode easy-mmode term disp-table ehelp kmacro tramp tramp-compat auth-source eieio assoc gnus-util mm-util mail-prsvr password-cache shell pcomplete format-spec tramp-loaddefs windmove jcl-keys jcl-load-functions jcl-file-cache ert find-func ewoc debug filecache jcl-elisp byte-opt warnings bytecomp byte-compile cconv macroexp hi-lock jcl-register jcl-grep grep compile jcl-command-subset ido jcl-emacsclient jcl-duff jcl-template-init jcl-template jcl-motion jcl-windows jcl-misc newcomment jcl-compile jcl-recommended jcl-site-start fpl electric cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs jpt-mode erlang-start clearcase tq reporter executable dired comint regexp-opt ansi-color ring info easymenu jcl-times-init advice help-fns advice-preload jcl-times jcl-util server jcl-load-path cl time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 04 04:44:43 2013 Received: (at 13350) by debbugs.gnu.org; 4 Jan 2013 09:44:43 +0000 Received: from localhost ([127.0.0.1]:42638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tr3pT-0008WV-H2 for submit@debbugs.gnu.org; Fri, 04 Jan 2013 04:44:43 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:38692) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tr3pN-0008WJ-AV for 13350@debbugs.gnu.org; Fri, 04 Jan 2013 04:44:41 -0500 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3Yd1L25jsyz3hjXH; Fri, 4 Jan 2013 10:44:26 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3Yd1L24g3Czbbhx; Fri, 4 Jan 2013 10:44:26 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id P27peBKPZft2; Fri, 4 Jan 2013 10:44:08 +0100 (CET) X-Auth-Info: adTDlIW/vfJ/gJ6vEAjZy/BEKPt9gdAnTGsEMFKLRL4= Received: from igel.home (ppp-88-217-116-23.dynamic.mnet-online.de [88.217.116.23]) by mail.mnet-online.de (Postfix) with ESMTPA; Fri, 4 Jan 2013 10:44:24 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id A7708CA2A2; Fri, 4 Jan 2013 10:44:24 +0100 (CET) From: Andreas Schwab To: Johan Claesson Subject: Re: bug#13350: 24.2; term.el is confused when bash prints almost 4096 bytes References: <87y5gat3e3.fsf@bredband.net> X-Yow: Clear the laundromat!! This whirl-o-matic just had a nuclear meltdown!! Date: Fri, 04 Jan 2013 10:44:24 +0100 In-Reply-To: <87y5gat3e3.fsf@bredband.net> (Johan Claesson's message of "Thu, 03 Jan 2013 21:31:16 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 13350 Cc: 13350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Johan Claesson writes: > I don't know if this buffer size of 4096 varies from system to system. Presumably that is PIPE_BUF. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 07:43:03 2013 Received: (at 13350) by debbugs.gnu.org; 26 Oct 2013 11:43:03 +0000 Received: from localhost ([127.0.0.1]:44863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va2Gk-00028x-DY for submit@debbugs.gnu.org; Sat, 26 Oct 2013 07:43:03 -0400 Received: from mail-ea0-f171.google.com ([209.85.215.171]:37486) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va2Gi-00028P-0A for 13350@debbugs.gnu.org; Sat, 26 Oct 2013 07:43:00 -0400 Received: by mail-ea0-f171.google.com with SMTP id n15so1223951ead.2 for <13350@debbugs.gnu.org>; Sat, 26 Oct 2013 04:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:organization:date:message-id:mime-version :content-type; bh=WhnUHq/Fi55waHDVrq/xXN3E72eb4J4DQN/k60kJC6U=; b=zFLzE7m8vtGqxNxuvdfrvABm2ZLtxRqKAu9/9ILFc9FoHqvJKZKMQYM9MKGj0Eo4LA 5j+MeNfGSpjGZF3YwnZa4kTJektYkSIr2O/I4Vacfx8+6sBYDwpNCFcM7VqSUtCMniXa knszI7638OSwBQLltUJu4GUHf4NxUFQcCcG8B4/lpNPb6T59BvoPO8Cj3qfHYU7s19YT TFoA9Bw6icyAvYfSwZpsY2RaqgTebjzKbL0zLdj4/LMuvx3Ne+36E4Tz3jtOGKMnbVPc mdKWi8cLbze3py/xQpqHbq5xQrWxM6A4mT1ukPTPWM6fptRIzYpa4LxagNpxocm/XpXq TrZQ== X-Received: by 10.14.37.4 with SMTP id x4mr12703932eea.16.1382787773780; Sat, 26 Oct 2013 04:42:53 -0700 (PDT) Received: from desktop.home.int ([37.229.15.72]) by mx.google.com with ESMTPSA id z12sm29973577eev.6.2013.10.26.04.42.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 26 Oct 2013 04:42:52 -0700 (PDT) From: Oleksandr Gavenko To: 13350@debbugs.gnu.org, Johan Claesson , Andreas Schwab Subject: I have same issue in Emacs 24.3.1 (error in process filter: cd: No such directory found via CDPATH environment variable) Organization: Oleksandr Gavenko , http://gavenkoa.users.sf.net Date: Sat, 26 Oct 2013 14:42:50 +0300 Message-ID: <877gd0mf5x.fsf@gavenkoa.example.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13350 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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(# "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 -- Best regards! From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 10:14:12 2013 Received: (at 13350) by debbugs.gnu.org; 26 Oct 2013 14:14:12 +0000 Received: from localhost ([127.0.0.1]:45535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va4d1-00060c-PA for submit@debbugs.gnu.org; Sat, 26 Oct 2013 10:14:12 -0400 Received: from smtprelay-b21.telenor.se ([195.54.99.212]:33372) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Va4cy-00060K-6B for 13350@debbugs.gnu.org; Sat, 26 Oct 2013 10:14:09 -0400 Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b21.telenor.se (Postfix) with ESMTP id 26902EBE18 for <13350@debbugs.gnu.org>; Sat, 26 Oct 2013 16:14:01 +0200 (CEST) X-SMTPAUTH-B2: [b157288] X-SENDER-IP: [85.224.212.70] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgVOAPvNa1JV4NRGPGdsb2JhbABZEwEBgnI4gw2pW5I6P2AXAwEBAQE4NYIlAQEBAQIBAQJIAQojBQsIAxMOGgsPAQQNBAMRChoTh3UDCQoBCKpPAYNaDYlrFoxPgnAHhCwDkC2FD2ODGoshhx+BQDo X-IronPort-AV: E=Sophos;i="4.93,576,1378850400"; d="el'?scan'208";a="641120906" Received: from c-46d4e055.1542-1-64736c20.cust.bredbandsbolaget.se (HELO goblin) ([85.224.212.70]) by ipb2.telenor.se with ESMTP; 26 Oct 2013 16:14:01 +0200 From: Johan Claesson To: Oleksandr Gavenko Subject: Re: I have same issue in Emacs 24.3.1 (error in process filter: cd: No such directory found via CDPATH environment variable) References: <877gd0mf5x.fsf@gavenkoa.example.com> Date: Sat, 26 Oct 2013 16:14:05 +0200 In-Reply-To: <877gd0mf5x.fsf@gavenkoa.example.com> (Oleksandr Gavenko's message of "Sat, 26 Oct 2013 14:42:50 +0300") Message-ID: <87r4b8unki.fsf@bredband.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13350 Cc: 13350@debbugs.gnu.org, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=term-fix.el Content-Transfer-Encoding: quoted-printable (defun term-emulate-terminal (proc str) (with-current-buffer (process-buffer proc) (let* ((i 0) char funny count ; number of decoded chars in substring count-bytes ; number of bytes decoded-substring save-point save-marker old-point temp win (buffer-undo-list t) (selected (selected-window)) last-win handled-ansi-message (str-length (length str))) (save-selected-window =20=20=20=20=20=20=20=20 (let ((newstr (term-handle-ansi-terminal-messages str))) (unless (eq str newstr) (setq handled-ansi-message t str newstr))) (setq str-length (length str)) =20=20=20=20=20=20=20=20 (when (marker-buffer term-pending-delete-marker) ;; Delete text following term-pending-delete-marker. (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil)) =20=20=20=20=20=20=20=20 (when (/=3D (point) (process-mark proc)) (setq save-point (point-marker))) =20=20=20=20=20=20=20=20 ;; Note if the window size has changed. We used to reset ;; point too, but that gives incorrect results (Bug#4635). (if (eq (window-buffer) (current-buffer)) (progn (setq term-vertical-motion (symbol-function 'vertical-motion)) (term-check-size proc)) (setq term-vertical-motion (symbol-function 'term-buffer-vertical-motion))) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) =20=20=20=20=20=20=20=20 (save-restriction ;; If the buffer is in line mode, and there is a partial ;; input line, save the line (by narrowing to leave it ;; outside the restriction ) until we're done with output. (when (and (> (point-max) (process-mark proc)) (term-in-line-mode)) (narrow-to-region (point-min) (process-mark proc))) =20=20=20=20=20=20=20=20=20=20 (when term-log-buffer (princ str term-log-buffer)) (cond ((eq term-terminal-state 4) ;; Have saved pending output. (setq str (concat term-terminal-parameter str)) (setq term-terminal-parameter nil) (setq str-length (length str)) (setq term-terminal-state 0))) =20=20=20=20=20=20=20=20=20=20 (while (< i str-length) (setq char (aref str i)) (cond ((< term-terminal-state 2) ;; Look for prefix of regular chars (setq funny (string-match "[\r\n\000\007\033\t\b\032\016\017]" str i)) (when (not funny) (setq funny str-length)) (cond ((> funny i) ;; Decode the string before counting ;; characters, to avoid garbling of certain ;; multibyte characters (bug#1006). (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system)) (cond ((eq term-terminal-state 1) ;; We are in state 1, we need to wrap ;; around. Go to the beginning of ;; the next line and switch to state ;; 0. (term-down 1 t) (term-move-columns (- (term-current-column= ))) (setq term-terminal-state 0))) (setq count (length decoded-substring)) (setq temp (- (+ (term-horizontal-column) count) term-width)) (cond ((<=3D temp 0)) ;; All count chars fit in l= ine. ((> count temp) ;; Some chars fit. ;; This iteration, handle only what fits. (setq count (- count temp)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 cou= nt) 'binary))) (setq temp 0) (setq funny (+ count-bytes i))) ((or (not (or term-pager-count term-scroll-with-delete)) (> (term-handle-scroll 1) 0)) (term-adjust-current-row-cache 1) (setq count (min count term-width)) (setq count-bytes (length (encode-coding-string (substring decoded-substring 0 cou= nt) 'binary))) (setq funny (+ count-bytes i)) (setq term-start-line-column term-current-column)) (t ;; Doing PAGER processing. (setq count 0 funny i) (setq term-current-column nil) (setq term-start-line-column nil))) (setq old-point (point)) =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 ;; Insert a string, check how many columns ;; we moved, then delete that many columns ;; following point if not eob nor insert-mode. (let ((old-column (current-column)) columns pos) (insert (decode-coding-string (substring str i = funny) locale-coding-system)) (setq term-current-column (current-column) columns (- term-current-column old-column= )) (when (not (or (eobp) term-insert-mode)) (setq pos (point)) (term-move-columns columns) (delete-region pos (point))) ;; In insert mode if the current line ;; has become too long it needs to be ;; chopped off. (when term-insert-mode (setq pos (point)) (end-of-line) (when (> (current-column) term-width) (delete-region (- (point) (- (current-colum= n) term-width)) (point))) (goto-char pos))) (setq term-current-column nil) =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 (put-text-property old-point (point) 'font-lock-face term-current-f= ace) ;; If the last char was written in last column, ;; back up one column, but remember we did so. ;; Thus we emulate xterm/vt100-style line-wrappin= g. (cond ((eq temp 0) (term-move-columns -1) (setq term-terminal-state 1))) (setq i (1- funny))) ((and (setq term-terminal-state 0) (eq char ?\^I)) ; TAB (terminfo: ht) (setq count (term-current-column)) ;; The line cannot exceed term-width. TAB at ;; the end of a line should not cause wrapping. (setq count (min term-width (+ count 8 (- (mod count 8))))) (if (> term-width count) (progn (term-move-columns (- count (term-current-column))) (setq term-current-column count)) (when (> term-width (term-current-column)) (term-move-columns (1- (- term-width (term-current-column))))) (when (=3D term-width (term-current-column)) (term-move-columns -1)))) ((eq char ?\r) ;; (terminfo: cr) (term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eq char ?\n) ;; (terminfo: cud1, ind) (unless (and term-kill-echo-list (term-check-kill-echo-list)) (term-down 1 t))) ((eq char ?\b) ;; (terminfo: cub1) (term-move-columns -1)) ((eq char ?\033) ; Escape (setq term-terminal-state 2)) ((eq char 0)) ; NUL: Do nothing ((eq char ?\016)) ; Shift Out - ignored ((eq char ?\017)) ; Shift In - ignored ((eq char ?\^G) ;; (terminfo: bel) (beep t)) ((and (eq char ?\032) (not handled-ansi-message)) (let ((end (string-match "\r?\n" str i))) (if end (funcall term-command-hook (prog1 (substring str (1+ i) end) (setq i (1- (match-end 0))))) (setq term-terminal-parameter (substring str = i)) (setq term-terminal-state 4) (setq i str-length)))) (t ; insert char FIXME: Should never happen (term-move-columns 1) (backward-delete-char 1) (insert char)))) ((eq term-terminal-state 2) ; Seen Esc (cond ((eq char ?\133) ;; ?\133 =3D ?[ =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 ;; Some modifications to cope with multiple ;; settings like ^[[01;32;43m -mm ;; Note that now the init value of ;; term-terminal-previous-parameter has been ;; changed to -1 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 (setq term-terminal-parameter 0) (setq term-terminal-previous-parameter -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-more-parameters 0) (setq term-terminal-state 3)) ((eq char ?D) ;; scroll forward (term-handle-deferred-scroll) (term-down 1 t) (setq term-terminal-state 0)) ;; ((eq char ?E) ;; (terminfo: nw), not used for ;; ;; now, but this is a working ;; ;; implementation ;; (term-down 1) ;; (term-goto term-current-row 0) ;; (setq term-terminal-state 0)) ((eq char ?M) ;; scroll reversed (terminfo: ri) (if (or (< (term-current-row) term-scroll-start) (>=3D (1- (term-current-row)) term-scroll-start)) ;; Scrolling up will not move outside ;; the scroll region. (term-down -1) ;; Scrolling the scroll region is needed. (term-down -1 t)) (setq term-terminal-state 0)) ((eq char ?7) ;; Save cursor (terminfo: sc) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face) ) (setq term-terminal-state 0)) ((eq char ?8) ;; Restore cursor (terminfo: rc) (when term-saved-cursor (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))) (setq term-terminal-state 0)) ((eq char ?c) ;; \Ec - Reset (terminfo: rs1) ;; This is used by the "clear" program. (setq term-terminal-state 0) (term-reset-terminal)) ;; The \E#8 reset sequence for xterm. We ;; probably don't need to handle it, but this ;; is the code to parse it. ;; ((eq char ?#) ;; (when (eq (aref str (1+ i)) ?8) ;; (setq i (1+ i)) ;; (setq term-scroll-start 0) ;; (setq term-scroll-end term-height) ;; (setq term-terminal-state 0))) ((setq term-terminal-state 0)))) ((eq term-terminal-state 3) ; Seen Esc [ (cond ((and (>=3D char ?0) (<=3D char ?9)) (setq term-terminal-parameter (+ (* 10 term-terminal-parameter) (- char ?= 0)))) ((eq char ?\;) ;; Some modifications to cope with multiple ;; settings like ^[[01;32;43m -mm (setq term-terminal-more-parameters 1) (setq term-terminal-previous-parameter-4 term-terminal-previous-parameter-3) (setq term-terminal-previous-parameter-3 term-terminal-previous-parameter-2) (setq term-terminal-previous-parameter-2 term-terminal-previous-parameter) (setq term-terminal-previous-parameter term-terminal-parameter) (setq term-terminal-parameter 0)) ((eq char ??)) ; Ignore ? (t (term-handle-ansi-escape proc char) (setq term-terminal-more-parameters 0) (setq term-terminal-previous-parameter-4 -1) (setq term-terminal-previous-parameter-3 -1) (setq term-terminal-previous-parameter-2 -1) (setq term-terminal-previous-parameter -1) (setq term-terminal-state 0))))) (when (term-handling-pager) ;; Finish stuff to get ready to handle PAGER. (if (> (% (current-column) term-width) 0) (setq term-terminal-parameter (substring str i)) ;; We're at column 0. Goto end of buffer; to compensate, ;; prepend a ?\r for later. This looks more consistent. (if (zerop i) (setq term-terminal-parameter (concat "\r" (substring str i))) (setq term-terminal-parameter (substring str (1- i))) (aset term-terminal-parameter 0 ?\r)) (goto-char (point-max))) (setq term-terminal-state 4) (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 (1+ i)))) =20=20=20=20=20=20=20=20 (when (>=3D (term-current-row) term-height) (term-handle-deferred-scroll)) =20=20=20=20=20=20=20=20 (set-marker (process-mark proc) (point)) (when save-point (goto-char save-point) (set-marker save-point nil)) =20=20=20=20=20=20=20=20 ;; Check for a pending filename-and-line number to display. ;; We do this before scrolling, because we might create a new windo= w. (when (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil) ;; We have created a new window, so check the window size. (term-check-size proc)) =20=20=20=20=20=20=20=20 ;; Scroll each window displaying the buffer but (by default) ;; only if the point matches the process-mark we started with. (setq win selected) ;; Avoid infinite loop in strange case where minibuffer window ;; is selected but not active. (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)) (when (eq (window-buffer win) (process-buffer proc)) (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (when (or (=3D (point) save-marker) (eq scroll t) (eq scroll 'all) ;; Maybe user wants point to jump to the end. (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) ;; Optionally scroll so that the text ;; ends at the bottom of the window. (when (and term-scroll-show-maximum-output (>=3D (point) (process-mark proc))) (save-excursion (goto-char (point-max)) (recenter -1))))) (not (eq win last-win)))) =20=20=20=20=20=20=20=20 ;; Stolen from comint.el and adapted -mm (when (> term-buffer-maximum-size 0) (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point)))) (set-marker save-marker nil))) ;; This might be expensive, but we need it to handle something ;; like `sleep 5 | less -c' in more-or-less real time. (when (get-buffer-window (current-buffer)) (redisplay)))) --=-=-= Content-Type: text/plain Oleksandr Gavenko 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(# "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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 29 17:52:05 2016 Received: (at 13350) by debbugs.gnu.org; 29 Jan 2016 22:52:05 +0000 Received: from localhost ([127.0.0.1]:40865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aPHtc-0001ZV-Py for submit@debbugs.gnu.org; Fri, 29 Jan 2016 17:52:05 -0500 Received: from mail-yk0-f170.google.com ([209.85.160.170]:35131) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aPHk4-0001Ks-Tu for 13350@debbugs.gnu.org; Fri, 29 Jan 2016 17:42:13 -0500 Received: by mail-yk0-f170.google.com with SMTP id r207so42963141ykd.2 for <13350@debbugs.gnu.org>; Fri, 29 Jan 2016 14:42:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=NODVrOCURVxNXaObi3VFFuS4Ffce9yK0nOATxG4p+JA=; b=VTf4FVIntTCUlhuUOrL/lVrAM2i6aJNt/nA6vea88Gs7HmK9QKLgTH81oO774byOF5 m8CVKXxR8QLuavs9CKs1UOO3UCmhmn3/3pHUq248SUh1FviTmL9h0OTp2k0FokQvZ2/I YIPCbZKjrdS5+AVhaLyUS6vgtTur1ldaPDtETyqeEiYqU0J8rCpnJmAWUPJhZcICHRsu DEE3FOSzXqdnVaPwoWzTWqHufJVwhEQvgqOb2BTdy22T2NZ5/C5y7TaqppCSQcH0KHU5 r9oMFypb2H1hmwjz7FMFJNePsEf+Ti8rhqtlram8jsOJplEpiA3EicRkWcAZTN7x1OZO 7Ohg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=NODVrOCURVxNXaObi3VFFuS4Ffce9yK0nOATxG4p+JA=; b=WBIzh3SBYEwSg7drl88ZJDnsYjg3Rldv0zv8GsInWCA7Vmu92F1aF1z/60wC9PXdi/ aDU1KZL2Mj2GgrleN0CvikEBIpHYL3B+sNXc8m6VxMpzTfrbiH9wodtpEn3Wbsi7Y5lI MWCtAqP27pwTSoR2ma30gY7BufHqNwsQP3/OIc5wrIGYrzUlobkDJYReOEGDxljvlzKR itqdQ0rBQVcwOL2K9qenIHCUqgJNp8hOJvQQiflb7hYVo+NrDTEiEfBV9V07SYaKk6zK EPJiVT9S++ZmcAOaPS44zyzA6Ljc387ryskuySbrRxi1y9IxpNLMSmCT5zE7AwyQw7kv P0TQ== X-Gm-Message-State: AG10YOReV+QhpW1anOPTHb2h01kzu2kyb/Mz6zwwuIAiKmJAGlv6tNf7zEm2U+DXxkpWiwR9+PXDGaI16/lsIA== X-Received: by 10.37.2.208 with SMTP id 199mr6073117ybc.44.1454107327423; Fri, 29 Jan 2016 14:42:07 -0800 (PST) MIME-Version: 1.0 From: Jiangbin Zhao Date: Fri, 29 Jan 2016 22:41:58 +0000 Message-ID: Subject: Ran into this term.el bug To: 13350@debbugs.gnu.org Content-Type: multipart/alternative; boundary=001a113d4980b76c97052a80beef X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13350 X-Mailman-Approved-At: Fri, 29 Jan 2016 17:52:02 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a113d4980b76c97052a80beef Content-Type: text/plain; charset=UTF-8 In Emacs version 24.5.3. The error went away after applying the fix by Johan Claesson. It seems that term.el has changed since this bug was first reported two years ago. Is there a reason that Johan's patch isn't accepted? By the looking, this bug can bite term.el users at random time. It would be great to have it fixed in the mainline sooner. Regards, Jiangbin --001a113d4980b76c97052a80beef Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In Emacs version 24.5.3.

The erro= r went away after applying the fix by Johan Claesson.

It= seems that term.el has changed since this bug was first reported two years= ago. Is there a reason that Johan's patch isn't accepted?

=
By the looking, this bug can bite term.el users at random time. = It would be great to have it fixed in the mainline sooner.

Regards,
Jiangbin
--001a113d4980b76c97052a80beef-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 21:19:48 2016 Received: (at 13350) by debbugs.gnu.org; 29 Dec 2016 02:19:48 +0000 Received: from localhost ([127.0.0.1]:58386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMQJn-0005Qg-Qs for submit@debbugs.gnu.org; Wed, 28 Dec 2016 21:19:48 -0500 Received: from mail-io0-f175.google.com ([209.85.223.175]:35552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMQJl-0005QN-P5; Wed, 28 Dec 2016 21:19:46 -0500 Received: by mail-io0-f175.google.com with SMTP id n85so110773493ioi.2; Wed, 28 Dec 2016 18:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=82HUAJS0QrXTr0fsH+dMd2SGlgmkm0lFSIMcAGIQO/k=; b=PeBWm0HrZfkXttnUG44oyR6qDXcSKCG2uQdPnB8DJDji0g4YpKZzl2f3G0BtQynFBj d1X8u/dFeAkCPGwM/ubK2ae7zDI2F2XX07jjl4eZSr5ho37k54UY4rgWrMqiH2ptwaqr v4YapDNAKfI1Ux7jDatEve3puW72zb8VZUzy8pMejx2EQ0Kn3+pdzMhsgBrpV68nl2bl D0f7RbCgBF0C6C1kBfQo8LmlBYkYcFJAbXWMz8ZCUHHqoaWyOmmlLNc2sPC8PFFaIwsg GntSUT0O8tge02sSoZMyiVjCA1t3JLw630N6b6+41T0V3M/hIlyTq+kq3mLgOtblx8v+ Ggcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=82HUAJS0QrXTr0fsH+dMd2SGlgmkm0lFSIMcAGIQO/k=; b=lJnpV2WyP1UXnVe3kPhZ74ll04Z2C5q1K5I5k6Qn61zCpqWFzoDPmCqAEmnAi2O0Kd u0jLwtFnWSVszpgx1fOqUoS97RcNj0rT9l/yFq/aPirWiADM0i82i3qTEoLg7AfdoA80 ZOD9hC4C222SUaPTCNm4AzqZnisEnNyDjzAhjKBcucW+V2W0OwhkdskbtF1ch6htIrUf yvUBtDjL5iNEFU4RZzrKSJHHBAQ1Zqxe73vMxLEwEk7gxpMaeAGpa0V+SNgyAkQc/Lod PoP2Gyw/Ly4lX6pdJnhKG+mZ0pGvorQm68lKjvqRrkffIJtShProewDxXogxBwP1eDrJ 7DXQ== X-Gm-Message-State: AIkVDXL6Gw0/Gf6DiYDwqwTar+rg4zaF1MFq2ohk6lSYBy8M/30fcc1Z2beNaNKB7Mp9nA== X-Received: by 10.107.36.65 with SMTP id k62mr12088982iok.130.1482977980105; Wed, 28 Dec 2016 18:19:40 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id d77sm1776295itc.10.2016.12.28.18.19.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Dec 2016 18:19:39 -0800 (PST) From: npostavs@users.sourceforge.net To: Johan Claesson Subject: Re: bug#13350: 24.2; term.el is confused when bash prints almost 4096 bytes In-Reply-To: <87y5gat3e3.fsf@bredband.net> (Johan Claesson's message of "Thu, 03 Jan 2013 21:31:16 +0100") References: <87y5gat3e3.fsf@bredband.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Date: Wed, 28 Dec 2016 21:20:38 -0500 Message-ID: <87lguz8oi1.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 13350 Cc: 13350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) --=-=-= Content-Type: text/plain tags 13350 patch quit Johan Claesson 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). --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=v1-0001-Fix-term.el-handling-of-Z-sequences-spanning-chun.patch Content-Description: patch >From 6660c98d36dbe39e12906a6d02f1faff22c95590 Mon Sep 17 00:00:00 2001 From: Johan Claesson Date: Wed, 28 Dec 2016 12:56:11 -0500 Subject: [PATCH v1] Fix term.el handling of ^Z-sequences spanning chunks Bash will after each command send ?\032 and the current directory "/tmp" to inform term.el. Bash output is buffered in 4096 bytes chunks. If a command outputs roughly 4096 bytes then the end of the first chunk will be "/tm" (Bug#13350). * lisp/term.el (term-emulate-terminal): Change the regexp to find the end of the ?\032 sequence to use \n instead of $, the latter can match end of string as well. Copyright-paperwork-exempt: yes --- lisp/term.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index a4c652b..d3d6390 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2880,12 +2880,12 @@ term-emulate-terminal (beep t)) ((and (eq char ?\032) (not handled-ansi-message)) - (let ((end (string-match "\r?$" str i))) + (let ((end (string-match "\r?\n" str i))) (if end (funcall term-command-hook (decode-coding-string (prog1 (substring str (1+ i) end) - (setq i (match-end 0))) + (setq i (1- (match-end 0)))) locale-coding-system)) (setq term-terminal-parameter (substring str i)) (setq term-terminal-state 4) -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 04 23:25:57 2017 Received: (at 13350) by debbugs.gnu.org; 5 Jan 2017 04:25:57 +0000 Received: from localhost ([127.0.0.1]:41656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOzcj-0003h4-8k for submit@debbugs.gnu.org; Wed, 04 Jan 2017 23:25:57 -0500 Received: from mail-it0-f54.google.com ([209.85.214.54]:38868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOzch-0003gn-J4; Wed, 04 Jan 2017 23:25:55 -0500 Received: by mail-it0-f54.google.com with SMTP id x2so337914432itf.1; Wed, 04 Jan 2017 20:25:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=V9qb+o3hdAjdCbGgHOt/2sf3n7sJOn7k5RWsGSp6Qdg=; b=lXfhujDgpKxDqL5AVtN9Qec70Kl7qyJgyB3Uj30KVzUs4gQij0VAHhHQtVyMByhaQ5 1tc+0BIbNR/v3AEe0orWdciExt4STJYIo8lxUFXCQe32rnp2A7JNlKwb+NoqQO4qJvcS LlRCbk+meNBKZbyAqGrXEZ/GiFNNkB7DyKVP5JNv3Jf04mq0X9yR2fHGoKy0yEXmlPVt yii1rJN/eieA2+oGIPC7fabjoig0vczfgeZdn/XPzKXRQHmDeyTqD4BSf4jG5sumIMau Ny/fYV7Ub5hCgPC499gm2ptjh/FWTmutRRLkPORUv2m3KBHED/08qj1xQo4hV9sCNnyn RfNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=V9qb+o3hdAjdCbGgHOt/2sf3n7sJOn7k5RWsGSp6Qdg=; b=WKYWCW3KoEsKyxYWBpNnikCYOVU+cZeycAWNM+SCU1vb++she7lMk7oAVZwmRgktRm hv3CNnm5dqYAqV3lOBkCAlI6+8t7blV14ybPwkAJXAm4eCsmmXrZ2kWKPhERs2KYo8QW V1OkIJ5BKRsUPpfVZqbYOZptjAFji7dCIX/sMeY0T4X4sLoo9SmUPgzGWHKNncccgaQ0 NZLR8S/55kW9BgNV5k8dnjEVaB5tcdy+/4AbQMc/iBKQQemrHrenUE93CLl+R+etmWe0 SHawIsnCmt9iEo1f7Yna7g6i5UwUXnXeSWt+FXmEnhZL4L8fmY0gZqf27mSzSst4mMG8 z5GQ== X-Gm-Message-State: AIkVDXIqRmtgtPaeeoCBkOZsdmL0tyiMFyjVh2H50Ltxh5PHhrA6IzAd4jjTBGq6bniisA== X-Received: by 10.36.216.70 with SMTP id b67mr57695647itg.5.1483590350128; Wed, 04 Jan 2017 20:25:50 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id j143sm39665781ita.1.2017.01.04.20.25.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jan 2017 20:25:49 -0800 (PST) From: npostavs@users.sourceforge.net To: Johan Claesson Subject: Re: bug#13350: 24.2; term.el is confused when bash prints almost 4096 bytes References: <87y5gat3e3.fsf@bredband.net> <87lguz8oi1.fsf@users.sourceforge.net> Date: Wed, 04 Jan 2017 23:26:52 -0500 In-Reply-To: <87lguz8oi1.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Wed, 28 Dec 2016 21:20:38 -0500") Message-ID: <8737gy5dyr.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 13350 Cc: 13350@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) tags 13350 fixed close 13350 26.1 quit npostavs@users.sourceforge.net writes: > Patch looks good. I will push to master in a week or so, unless there > are objections (I added a commit message, see attached). Pushed as d88cdad28477. From unknown Sat Jun 14 19:00:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 02 Feb 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator