unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Henrik Ahlgren <pablo@seestieto.com>
Cc: 43226@debbugs.gnu.org, michael.albinus@gmx.de
Subject: bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote
Date: Wed, 26 Oct 2022 15:01:12 +0300	[thread overview]
Message-ID: <83bkpyoktz.fsf@gnu.org> (raw)
In-Reply-To: <87wn8mhl8u.fsf@seestieto.com> (message from Henrik Ahlgren on Wed, 26 Oct 2022 14:34:09 +0300)

> From: Henrik Ahlgren <pablo@seestieto.com>
> Cc: Michael Albinus <michael.albinus@gmx.de>, 43226@debbugs.gnu.org
> Date: Wed, 26 Oct 2022 14:34:09 +0300
> 
> This issue is documented on the FAQ section of the Magit manual:
> 
>   A.2.13 I am unable to stage when using Tramp from MS Windows
>   ------------------------------------------------------------
> 
>   Magit may be unable to stage (or otherwise apply) individual hunks when
>   you are connected to remote machine using Tramp and the local machine
>   uses MS Windows.
> 
>      There appears to be a problem with ‘process-send-eof’ in this
>   scenario, as mentioned at the end of ‘tramp-tests.el’.  I have contacted
>   the Tramp maintainer about this.  For now this unfortunately means that
>   it just doesn’t work and we cannot do anything about it.  If you have
>   more information, then please comment on
>   <https://github.com/magit/magit/issues/3624>.

This doesn't really add any useful information.

> After some debugging I figured out that by simply adding
> (process-send-string process "\004") in magic-process.el before (maybe
> even instead?) of process-send-eof, it works perfectly well. Maybe it's
> a valid workaround, or even the proper fix, but clearly there is some
> point of having a separate function for sending EOF.
> 
> In the C implementation of process-send-eof (Emacs 27.1), it seems to only
> send EOF if the process has pty_flag set:
> 
>   if (XPROCESS (proc)->pty_flag)
>     send_process (proc, "\004", 1, Qnil);
> 
> I think this could be the reason: after all I believe PTYs are a fairly
> recent feature in Windows and Emacs does not support it yet?

Emacs doesn't (and probably will not) support the Windows
Pseudo-Console because it falls short of what Emacs needs: it doesn't
allow to send stuff in arbitrary encoding via this channel.  I filed a
bug report with the developers many moons ago, but their response was
that it will probably never fixed.  So you can only talk to a program
that uses the current system codepage, which is useless for Emacs.

So the ->pty_flag case is not for Windows.  And even if we did try
using it, it wouldn't have worked for local processes, because Ctrl-D
is NOT the EOF character on Windows; it's Ctrl-Z, and then only if the
sub-process does text-mode reads (in binary mode, there's no way to
send EOF to a subprocess, only kill it).





  reply	other threads:[~2022-10-26 12:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05 16:38 bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote Eli Zaretskii
2020-09-05 19:04 ` bug#43226: Fwd: bug#26911: 25.2; eshell "cd .." doesn't work correctly with TRAMP Michael Albinus
2020-09-05 19:04 ` Michael Albinus
2020-09-05 19:16   ` bug#43226: 28.0.50; Running Tramp tests on MS-Windows leaves zombie processes on the remote Michael Albinus
2020-09-05 19:25     ` Eli Zaretskii
2020-09-06  8:49       ` Michael Albinus
2020-09-06 15:14         ` Eli Zaretskii
2020-09-06 15:54           ` Michael Albinus
2020-09-06 16:07             ` Eli Zaretskii
2022-10-25  9:39               ` Henrik Ahlgren
2022-10-25 11:26                 ` Eli Zaretskii
2022-10-25 13:56                   ` Henrik Ahlgren
2022-10-25 16:49                     ` Michael Albinus
2022-10-25 19:17                     ` Eli Zaretskii
2022-10-26 11:34                       ` Henrik Ahlgren
2022-10-26 12:01                         ` Eli Zaretskii [this message]
2022-10-26 14:15                           ` HA
2022-10-29 14:48                             ` Michael Albinus

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=83bkpyoktz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=43226@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=pablo@seestieto.com \
    /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).