emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: misbehavior in shell window with ksh


From: Stephen Berman
Subject: Re: misbehavior in shell window with ksh
Date: Mon, 01 May 2017 17:52:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Mon, 01 May 2017 18:09:36 +0300 Eli Zaretskii <address@hidden> wrote:

>> From: Stephen Berman <address@hidden>
>> Cc: address@hidden,  address@hidden
>> 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
>> #<process shell> 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(#<process shell> "> ")

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 <address@hidden> 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
>> #<process shell> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]