From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: misbehavior in shell window with ksh Date: Mon, 01 May 2017 17:52:31 +0200 Message-ID: <87bmrczi9s.fsf@rosalinde> References: <12812.1493593946@alto> <83o9vdjcl6.fsf@gnu.org> <87pofszvue.fsf@rosalinde> <837f20ke4g.fsf@gnu.org> <87inlkzlkt.fsf@rosalinde> <831ss8k40f.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493654001 12335 195.159.176.226 (1 May 2017 15:53:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 May 2017 15:53:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, mkupfer@alum.berkeley.edu To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 01 17:53:15 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5DdR-00032z-7s for ged-emacs-devel@m.gmane.org; Mon, 01 May 2017 17:53:13 +0200 Original-Received: from localhost ([::1]:54820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5DdX-0001vH-2q for ged-emacs-devel@m.gmane.org; Mon, 01 May 2017 11:53:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5Dcx-0001uz-Fj for emacs-devel@gnu.org; Mon, 01 May 2017 11:52:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5Dcu-0005yb-BF for emacs-devel@gnu.org; Mon, 01 May 2017 11:52:43 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:53432) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5Dcu-0005yN-1T; Mon, 01 May 2017 11:52:40 -0400 Original-Received: from rosalinde ([83.135.15.84]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LjaEi-1dgkEi3F1c-00bakL; Mon, 01 May 2017 17:52:32 +0200 In-Reply-To: <831ss8k40f.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 May 2017 18:09:36 +0300") X-Provags-ID: V03:K0:bB2VPKMXdaqMv8ZEGn/gJOYncofnB7uDrSdt7sapS+j/dpM/Dy9 qzwFnsd4loVBfN/qVEEVr7/HE3ooYvJyFilR2lNRxqjv7gB1fZvyBqMADAxOBwcZcms0HXc uqwAaA2oNDA2KOcH4h8Lp3fiFy6ppU4Jq1icHwvSGtMZImKv53fey6ArGJDGjIs9/Ul8lMr leQ2Zq5XgMhGOeZZgJB6g== X-UI-Out-Filterresults: notjunk:1;V01:K0:c9TTUgtkBss=:Il+JRtj5FdP8zvpcqQZlL6 D131+1YGfiRbqsTpPWCQvrG5DZDmymMHqCHZ46JilSCfRpRkp9AUb60KkvdrktXN2We1rWR/U ZGVcSr6TCDoXv3804+Xef6Ws1OxYRQEnfbuLuSxg1wkshLQc9yIVzMrnCJ0keFHVaTvGqYgl9 dk1UwnLKenq3IdPdlJmS+ECDj+u1quT744g8aiOWxSQRcmSeXImPPy6RaQGqlBNCpvgKzsAcM 9pxeOKnsGMsU/YvmTbTwsJVCPmdukD7yMBpeA1nD2gKm7HFgXfY9rctY3amb2vmw+toDJqfHS iJKknUlaXf1/UaN2IRdUpuLubOmSS9QwjmFIBfU6cuUSkuOPN2wdlOWduZjLIfrgQNmAJcv3M G/2hhkBDzMJvt4b2FI6seuc/pfoEoheo88JBFMzByuhrFXuVDtgswZJsqfdGyhP7G68rs3kAK CyuswYE40Gk3msm6ir7AhD+OklN+JNEj7odYZxjYB5EKbzeE+9PxLADI7P2tgC3YmVpKxtjq2 lOhFgEiyM7PFroTn2Buqxois5OCYOSzYLNyaZmWosw4Uq3BRvJjNef7Ap752ywM8o0Gi/t/Kn t4CksRHaQNQTSlHKKa3K4KJnaFI/9o6v7Bq6kyw0FQ5K6lz08xb6zgZBpXBmT94w+Js7H8Xj5 o98xSv1iRXqakzTC9w2JIX4igxH2ztld9e4QiHIlX3JFuEoZZceWGGSzgH+h0EHMco2lKig1q zjp2rG+K7jrcLnr2Mde7u6XzzjJGujfjSIYbEl1HGX0mYadmDjhlWldH5SkGS/bxdH5cGYm+ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214492 Archived-At: On Mon, 01 May 2017 18:09:36 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: mkupfer@alum.berkeley.edu, emacs-devel@gnu.org >> Date: Mon, 01 May 2017 16:41:06 +0200 >> >> By edebugging shell.el and comint.el I see that after typing `C-x 0' in >> the recipe, the function comint-output-filter is invoked with the value >> # for its argument `proc' and the value "> " for its >> argument `string', and the latter value is what is inserted into the >> *shell* buffer. I have failed to find out how that argument gets that >> value or even how comint-output-filter gets invoked. If anyone has any >> advice for how to proceed, I can try it. > > Thanks. > > Can you show the backtrace for the invocation of comint-output-filter? After `M-o' in the recipe I did `M-: (debug-on-entry 'comint-output-filter) RET' (when I tried `M-x debug-on-entry RET' the string "> " was then inserted into the *shell* buffer). This showed this backtrace: Debugger entered--entering a function: * comint-output-filter(# "> ") I typed `q' then proceeded with `M-0' from the recipe, which produced the same backtrace. Why isn't the caller of comint-output-filter shown? On Mon, 01 May 2017 08:29:13 -0700 Mike Kupfer wrote: > Stephen Berman wrote: > >> By edebugging shell.el and comint.el I see that after typing `C-x 0' in >> the recipe, the function comint-output-filter is invoked with the value >> # for its argument `proc' and the value "> " for its >> argument `string', and the latter value is what is inserted into the >> *shell* buffer. I have failed to find out how that argument gets that >> value or even how comint-output-filter gets invoked. If anyone has any >> advice for how to proceed, I can try it. > > The "> " is coming from the PS2 environment variable (secondary prompt > string). If I change PS2 to "foo> ", then "foo> " is what gets > inserted. (This probably isn't what you were asking for, but I thought > I'd note it.) FTR the same thing happens here. > Also, I looked into Eli's question > >> Could this be related to some of your shell customizations? > > Having EDITOR set to emacs (or emacsclient) seems to be required for me > to reproduce the problem. > > $ export EDITOR=emacs > $ emacs -Q -nw > => problem reproduces > > $ emacs -Q -nw (w/o EDITOR set) > M-x shell RET > export EDITOR=emacs RET > ksh RET > => problem reproduces > > $ export EDITOR=emacs > $ emacs -Q -nw > M-x shell RET > unset EDITOR RET > ksh RET > => problem does not reproduce Here, EDITOR had not been set when I tested previously, and it makes no difference if I set it and execute the recipe, also after unsetting it; in all cases I get the problematic behavior. Steve Berman