From: Eli Zaretskii <eliz@gnu.org>
To: Joost <joostkremers@fastmail.fm>
Cc: emacs-devel@gnu.org
Subject: Re: `interrupt-process` doesn't work for Python on Windows
Date: Thu, 10 Feb 2022 15:01:02 +0200 [thread overview]
Message-ID: <83h796ub8x.fsf@gnu.org> (raw)
In-Reply-To: <dba7c01a-663c-4ca9-8cee-60cd81969acb@www.fastmail.com> (message from Joost on Wed, 09 Feb 2022 10:17:33 +0100)
> Date: Wed, 09 Feb 2022 10:17:33 +0100
> From: Joost <joostkremers@fastmail.fm>
>
> https://github.com/jdtsmith/python-mls/issues/8#issuecomment-1033120469
>
> To quote the relevant section:
>
> ====================
> Here is the issue: `interrupt-process` (and internal C function) does not function correctly to interrupt Python on Windows emacs! While at the command prompt, a simple `C-c` does correctly interrupt (and returns `Keyboard Interrupt\n>>> ` promptly), `interrupt-process` does not, and leads to the double-traceback you reported earlier, but _only after you send another newline_. This is incorrect behavior, and seems to represent a bug in the way Emacs sends interrupts on Windows, which differs from `C-c` in the command prompt.
>
> It's easy to verify the difference:
>
> * `C-c` at `>>> ` python prompt in "Command Prompt": immediate `KeyboardInterrupt` and prompt.
> * `C-c C-c` at `>>> ` python prompt in Emacs _Python_: no `KeyboardInterrupt`.
>
> ====================
>
> Should I file a bug report about this? Or is this something Emacs can do nothing about?
As I responded there, Emacs on MS-Windows emulates SIGINT to a
sub-process by injecting an actual Ctrl-C character into the
sub-process's input stream. But that might not do what you expect,
because Emacs on Windows communicates with sub-processes via pipes,
not via (pseudo)console devices, and thus Python could react to Ctrl-C
differently than it reacts when run from the console.
So at least at the moment, this doesn't look like an Emacs problem.
prev parent reply other threads:[~2022-02-10 13:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 9:17 `interrupt-process` doesn't work for Python on Windows Joost
2022-02-10 13:01 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83h796ub8x.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=joostkremers@fastmail.fm \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).