I also discovered that `direct-async-process' doesn't fix things: that setting has no effect for the sshx method! It turns out that, while I was trying to get `M-x rgrep' to work locally on MS Windows, I added a bunch of MSYS2 tools to my PATH (I already had them thanks to the MS Windows version of Git). I wanted to get `find' and `grep', but it turns out this also came with `ssh', so I was using a different build of SSH. On the one hand, it works correctly (I can even use the scpx method on files with spaces![1]); on the other hand, it would be nice if we could figure out how to get this to work with the Microsoft-provided version.
This makes me a lot more confident that there's a bug in the native Win32 version of OpenSSH. I'm not totally sure what to do about it though. While I always prefer to report bugs so they can get fixed upstream, it's taken a lot of work to debug this, and there still isn't enough information that I could forward this on to Microsoft for them to fix it. Since I (and every other MS Windows system with a Git installation) have a more-reliable version of ssh already available, there's an argument that we should just give up on Win32-OpenSSH and rely on the MSYS2 port instead. - Jim [1] This is *without* the fix you merged in c5f1f9bfa82f07d7e8912fde3e3a6748a093f9d9. I'll test that patch with Win32-OpenSSH (v7.7 and v8.1) as well as the MSYS2 port when I get the chance this week. On Thu, May 6, 2021 at 11:20 AM Jim Porter <[email protected]> wrote: > > On Thu, May 6, 2021 at 9:24 AM Michael Albinus <[email protected]> wrote: > > > > Oh, rgrep is as good as something else to test. After you ran it for the > > first time, you can place the cursor in the *grep* buffer, and type > > again and again 'g' (revert-buffer). This re-invokes the async > > process. I have tested it it this way, w/o pain. > > rgrep is pretty easy to test this with, although if this is really a > Win32-OpenSSH bug, it'll be helpful to have a test case that doesn't > require someone to install Emacs or check out the Tramp repository. :) > > > > However, I *don't* see this issue when I run `M-x shell-command RET > > > python3 test.py RET'. I always see the full output. > > > > This doesn't count. shell-command runs a synchronous process, which is a > > completely different story. In order to test it asynchronously, you > > must call async-shell-command. > > Ah ha. Using `async-shell-command' (or appending an "&" to my command) > does show the bug again. That's at least helped me narrow things down > a bit further, to where Tramp gets involved. I'm sure you've gotten > well past this point already, but I'm hoping that if I can narrow this > down enough, I can make a Python script that reproduces the issue > (assuming it's a Win32-OpenSSH bug). Then I should have something > simple enough that I can tell Microsoft about it. Hopefully with more > information, we can work around the problem in Emacs/Tramp too. > > - Jim
