unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* "Process shell finished" on Windows
@ 2022-12-22 17:16 Galen Boyer
  2022-12-23  7:05 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Galen Boyer @ 2022-12-22 17:16 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Helpful folks!

I am on Windows 10 Enterprise running Emacs 27.2 but this also happens
on Emacs 28.2.  M-x shell and now I have a buffer running shell.  I then
issue a command that calls some script/executable etc.  It runs
successfully but then when it is complete I see that the command.com
process has been killed.

What I'm showing here is calling cygwins ls.

    c:\GITHUB\edm>ls -la
    ls -la
    total 30
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 .
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 20 10:46 ..
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 19 14:18 .git
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 DBT
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 DataSets
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 External
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 Python
    -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer   35 Dec 17 00:34 README.md
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 Terraform
    -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer 1181 Dec 17 00:34
pull_request_template.md
    -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer   18 Dec 17 00:34 silly.txt

    c:\GITHUB\edm>
    Process shell finished

So, then I issue an M-x shell and get it back

    c:\GITHUB\edm>
    Process shell finished
    Microsoft Windows [Version 10.0.19044.2364]
    (c) Microsoft Corporation. All rights reserved.

    c:\GITHUB\edm>

This just started happening but I've been using Emacs on Windows for years
with the M-x shell as one of my main reasons I'm using it on Windows.  I
cannot pinpoint anything that might have caused this new behaviour.

I originally thought that something about cygwin was an issue.  But it
also happens when I call other executables, but not all of them. For
example, if I execute windows scripts, it is fine.

    c:\GITHUB\edm>dir
    dir
     Volume in drive C is OS
     Volume Serial Number is F228-1278

     Directory of c:\GITHUB\edm

    12/17/2022  12:34 AM    <DIR>          .
    12/17/2022  12:34 AM    <DIR>          ..
    12/17/2022  12:34 AM    <DIR>          DataSets
    12/17/2022  12:34 AM    <DIR>          DBT
    12/17/2022  12:34 AM    <DIR>          External
    12/17/2022  12:34 AM             1,181 pull_request_template.md
    12/17/2022  12:34 AM    <DIR>          Python
    12/17/2022  12:34 AM                35 README.md
    12/17/2022  12:34 AM                18 silly.txt
    12/17/2022  12:34 AM    <DIR>          Terraform
                   3 File(s)          1,234 bytes
                   7 Dir(s)  183,900,532,736 bytes free

    c:\GITHUB\edm>

When I execute something like python, it is fine as well.

    c:\GITHUB\edm>cd Python/
    cd Python/

    c:\GITHUB\edm\Python>python terra.py --help
    python terra.py --help
    usage: terra [-h] [-V] [-O] [-P] [-S] envName

    Spew commands for spinning up projects

    positional arguments:
      envName

    options:
      -h, --help            show this help message and exit
      -V, --vmbool          Do we need to spinup a VM
      -O, --vmonlybool      Just the commands for VM
      -P, --printfunctionnamebool
                            Print the function names at the beginning of the
                            commands
      -S, --sbxbool         Is this a sandbox?

    c:\GITHUB\edm\Python>

But here is another call that exhibits this behaviour:

    c:\GITHUB\edm>bq version
    bq version
    This is BigQuery CLI 2.0.83

    c:\GITHUB\edm>
    Process shell finished

As above, I'll then have to issue M-x shell to get command prompt back

Any ideas on what I should do, look into, debug?

Thanks in advance!

--
Galen Boyer

-- 
Galen Boyer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Process shell finished" on Windows
  2022-12-22 17:16 Galen Boyer
@ 2022-12-23  7:05 ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2022-12-23  7:05 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Galen Boyer <galendboyer@gmail.com>
> Date: Thu, 22 Dec 2022 12:16:14 -0500
> 
> I am on Windows 10 Enterprise running Emacs 27.2 but this also happens
> on Emacs 28.2.  M-x shell and now I have a buffer running shell.  I then
> issue a command that calls some script/executable etc.  It runs
> successfully but then when it is complete I see that the command.com
> process has been killed.

(On Windows 10, it isn't command.com, it is cmd.exe.)

> What I'm showing here is calling cygwins ls.
> 
>     c:\GITHUB\edm>ls -la
>     ls -la
>     total 30
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 .
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 20 10:46 ..
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 19 14:18 .git
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 DBT
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 DataSets
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 External
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 Python
>     -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer   35 Dec 17 00:34 README.md
>     drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 Terraform
>     -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer 1181 Dec 17 00:34
> pull_request_template.md
>     -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer   18 Dec 17 00:34 silly.txt
> 
>     c:\GITHUB\edm>
>     Process shell finished
> 
> So, then I issue an M-x shell and get it back
> 
>     c:\GITHUB\edm>
>     Process shell finished
>     Microsoft Windows [Version 10.0.19044.2364]
>     (c) Microsoft Corporation. All rights reserved.
> 
>     c:\GITHUB\edm>
> 
> This just started happening but I've been using Emacs on Windows for years
> with the M-x shell as one of my main reasons I'm using it on Windows.  I
> cannot pinpoint anything that might have caused this new behaviour.
> 
> I originally thought that something about cygwin was an issue.  But it
> also happens when I call other executables, but not all of them. For
> example, if I execute windows scripts, it is fine.
> 
>     c:\GITHUB\edm>dir
>     dir
>      Volume in drive C is OS
>      Volume Serial Number is F228-1278
> 
>      Directory of c:\GITHUB\edm
> 
>     12/17/2022  12:34 AM    <DIR>          .
>     12/17/2022  12:34 AM    <DIR>          ..
>     12/17/2022  12:34 AM    <DIR>          DataSets
>     12/17/2022  12:34 AM    <DIR>          DBT
>     12/17/2022  12:34 AM    <DIR>          External
>     12/17/2022  12:34 AM             1,181 pull_request_template.md
>     12/17/2022  12:34 AM    <DIR>          Python
>     12/17/2022  12:34 AM                35 README.md
>     12/17/2022  12:34 AM                18 silly.txt
>     12/17/2022  12:34 AM    <DIR>          Terraform
>                    3 File(s)          1,234 bytes
>                    7 Dir(s)  183,900,532,736 bytes free
> 
>     c:\GITHUB\edm>
> 
> When I execute something like python, it is fine as well.
> 
>     c:\GITHUB\edm>cd Python/
>     cd Python/
> 
>     c:\GITHUB\edm\Python>python terra.py --help
>     python terra.py --help
>     usage: terra [-h] [-V] [-O] [-P] [-S] envName
> 
>     Spew commands for spinning up projects
> 
>     positional arguments:
>       envName
> 
>     options:
>       -h, --help            show this help message and exit
>       -V, --vmbool          Do we need to spinup a VM
>       -O, --vmonlybool      Just the commands for VM
>       -P, --printfunctionnamebool
>                             Print the function names at the beginning of the
>                             commands
>       -S, --sbxbool         Is this a sandbox?
> 
>     c:\GITHUB\edm\Python>
> 
> But here is another call that exhibits this behaviour:
> 
>     c:\GITHUB\edm>bq version
>     bq version
>     This is BigQuery CLI 2.0.83
> 
>     c:\GITHUB\edm>
>     Process shell finished
> 
> As above, I'll then have to issue M-x shell to get command prompt back

Is bq, whatever it is, also a Cygwin program?  If so, maybe post this
on the Cygwin mailing list.  Because I cannot reproduce this here,
using a native port of ls and other programs.

If you use Cygwin program, why don't you use a Cygwin build of Emacs,
btw?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* "Process shell finished" on Windows
@ 2023-01-09 18:42 Galen Boyer
  2023-01-13 14:49 ` Galen Boyer
  0 siblings, 1 reply; 8+ messages in thread
From: Galen Boyer @ 2023-01-09 18:42 UTC (permalink / raw)
  To: help-gnu-emacs

I posted this on reddit /r/emacs.  Took me awhile to find nntp news
server to use.

I am on Windows 10 Enterprise running Emacs 27.2 but this also happens
on Emacs 28.2.  M-x shell and now I have a buffer running shell.  I then
issue a command that calls some script/executable etc.  It runs
successfully but then when it is complete I see that the command.com
process has been killed.

What I'm showing here is calling cygwins ls.

    c:\GITHUB\edm>ls -la
    ls -la
    total 30
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 .
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 20 10:46 ..
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 19 14:18 .git
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 DBT
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 DataSets
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 External
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 Python
    -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer   35 Dec 17 00:34 README.md
    drwxrwx---+ 1 CHARLES+boyer CHARLES+boyer    0 Dec 17 00:34 Terraform
    -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer 1181 Dec 17 00:34 pull_request_template.md
    -rwxrwx---+ 1 CHARLES+boyer CHARLES+boyer   18 Dec 17 00:34 silly.txt

    c:\GITHUB\edm>
    Process shell finished

So, then I M-x shell and get it back

    c:\GITHUB\edm>
    Process shell finished
    Microsoft Windows [Version 10.0.19044.2364]
    (c) Microsoft Corporation. All rights reserved.

    c:\GITHUB\edm>

I originally thought that something about cygwin was an issue.  But it
also happens when I call other executables, but not all of them. For
example, if I execute windows scripts, it is fine.

    c:\GITHUB\edm>dir
    dir
     Volume in drive C is OS
     Volume Serial Number is F228-1278

     Directory of c:\GITHUB\edm

    12/17/2022  12:34 AM    <DIR>          .
    12/17/2022  12:34 AM    <DIR>          ..
    12/17/2022  12:34 AM    <DIR>          DataSets
    12/17/2022  12:34 AM    <DIR>          DBT
    12/17/2022  12:34 AM    <DIR>          External
    12/17/2022  12:34 AM             1,181 pull_request_template.md
    12/17/2022  12:34 AM    <DIR>          Python
    12/17/2022  12:34 AM                35 README.md
    12/17/2022  12:34 AM                18 silly.txt
    12/17/2022  12:34 AM    <DIR>          Terraform
                   3 File(s)          1,234 bytes
                   7 Dir(s)  183,900,532,736 bytes free

    c:\GITHUB\edm>

When I execute something like python, it is fine as well.

    c:\GITHUB\edm>cd Python/
    cd Python/

    c:\GITHUB\edm\Python>python terra.py --help
    python terra.py --help
    usage: terra [-h] [-V] [-O] [-P] [-S] envName

    Spew commands for spinning up projects

    positional arguments:
      envName

    options:
      -h, --help            show this help message and exit
      -V, --vmbool          Do we need to spinup a VM
      -O, --vmonlybool      Just the commands for VM
      -P, --printfunctionnamebool
                            Print the function names at the beginning of the
                            commands
      -S, --sbxbool         Is this a sandbox?

    c:\GITHUB\edm\Python>

Any ideas on what I should do, look into, debug?

Thanks in advance!

--
Galen Boyer




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Process shell finished" on Windows
  2023-01-09 18:42 "Process shell finished" on Windows Galen Boyer
@ 2023-01-13 14:49 ` Galen Boyer
  2023-01-13 15:10   ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Galen Boyer @ 2023-01-13 14:49 UTC (permalink / raw)
  To: help-gnu-emacs

Just hoping someone might be able to give me some pointers on where to
turn to debug this?  

If you know the issue, that is even better, but I'm unclear as to where
to turn.     
--
Galen Boyer




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Process shell finished" on Windows
  2023-01-13 14:49 ` Galen Boyer
@ 2023-01-13 15:10   ` Eli Zaretskii
  2023-01-13 22:04     ` Galen Boyer
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-01-13 15:10 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Galen Boyer <galendboyer@gmail.com>
> Date: Fri, 13 Jan 2023 09:49:07 -0500
> 
> Just hoping someone might be able to give me some pointers on where to
> turn to debug this?  

I would start by looking in the Windows Event Log, under Applications.
It sounds like the shell dies for some reason, and the Windows Event
Log could have some hint about the reason(s).

If that doesn't help, try figuring out what is common to the commands
that cause the shell to exit, vs those which don't.  Could it be that
they use some particular DLL, for example?  Or could it be that they
are 32-bit applications whereas the rest are 64-bit ones? or the other
way around?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Process shell finished" on Windows
  2023-01-13 15:10   ` Eli Zaretskii
@ 2023-01-13 22:04     ` Galen Boyer
  2023-01-13 22:42       ` Galen Boyer
  0 siblings, 1 reply; 8+ messages in thread
From: Galen Boyer @ 2023-01-13 22:04 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Galen Boyer <galendboyer@gmail.com>
>> Date: Fri, 13 Jan 2023 09:49:07 -0500
>> 
>> Just hoping someone might be able to give me some pointers on where to
>> turn to debug this?  
>
> I would start by looking in the Windows Event Log, under Applications.
> It sounds like the shell dies for some reason, and the Windows Event
> Log could have some hint about the reason(s).

I'm already seeing very helpful information.

Thank you so much!

--
Galen Boyer




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Process shell finished" on Windows
  2023-01-13 22:04     ` Galen Boyer
@ 2023-01-13 22:42       ` Galen Boyer
  2023-01-14 11:31         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Galen Boyer @ 2023-01-13 22:42 UTC (permalink / raw)
  To: help-gnu-emacs

Galen Boyer <galendboyer@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Galen Boyer <galendboyer@gmail.com>
>>> Date: Fri, 13 Jan 2023 09:49:07 -0500
>>> 
>>> Just hoping someone might be able to give me some pointers on where to
>>> turn to debug this?  
>>
>> I would start by looking in the Windows Event Log, under Applications.
>> It sounds like the shell dies for some reason, and the Windows Event
>> Log could have some hint about the reason(s).
>
> I'm already seeing very helpful information.
>
> Thank you so much!

Not done, but decided I would try to get some information from edebug.  

In comint.el, line #1914 we see the following code.

        (set-marker comint-accum-marker nil)
        (let ((comint-input-sender-no-newline no-newline))
          (funcall comint-input-sender proc input).)

When the command prompt first displayed "Process shell finished"
the cursor was at the `.' above.

I'm not sure how useful the above might be but maybe long-term Elisp
folks as yourself might be able to let me know if digging further this
route might be helpful?

--
Galen Boyer




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Process shell finished" on Windows
  2023-01-13 22:42       ` Galen Boyer
@ 2023-01-14 11:31         ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2023-01-14 11:31 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Galen Boyer <galendboyer@gmail.com>
> Date: Fri, 13 Jan 2023 17:42:18 -0500
> 
> Galen Boyer <galendboyer@gmail.com> writes:
> 
> In comint.el, line #1914 we see the following code.
> 
>         (set-marker comint-accum-marker nil)
>         (let ((comint-input-sender-no-newline no-newline))
>           (funcall comint-input-sender proc input).)
> 
> When the command prompt first displayed "Process shell finished"
> the cursor was at the `.' above.

Sounds like a bug, but I don't see it here, so it's a bit hard to
investigate.

When you are at that place in the execution, and you see "Process
shell finished", please produce a Lisp backtrace and post it here.  (I
assume you are stepping through the code with Edebug, in which case
typing 'd' will produce the backtrace.)

What are the commands with which you see this issue?  Are they .exe
executables, are they some kinds of shell scripts or batch files, are
they something else?  If they are all executables, where did you get
them?  You only posted a single example of a command which causes
this, and you mentioned Cygwin, but you never described any additional
details.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-01-14 11:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 18:42 "Process shell finished" on Windows Galen Boyer
2023-01-13 14:49 ` Galen Boyer
2023-01-13 15:10   ` Eli Zaretskii
2023-01-13 22:04     ` Galen Boyer
2023-01-13 22:42       ` Galen Boyer
2023-01-14 11:31         ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2022-12-22 17:16 Galen Boyer
2022-12-23  7:05 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).