WSL: clip.exe hangs when redirecting output into it.

Environment

Windows build number: 10.0.20175.1000
Your Distribution version: Ubuntu 18.04
WSL 2: Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020

Steps to reproduce

echo "AAAA" | clip.exe

Expected behavior

AAAA get copied to my windows clipboard

Actual behavior

The command hangs and nothing is copied

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 9
  • Comments: 30 (2 by maintainers)

Most upvoted comments

This Bug also breaks Docker 😕

Folks here for Docker issues. This WSL2 bug does effect Docker, it is not an issue with Docker. We are hopeful for a fix soon. Right now Windows 20175 and 20180 have this issue. You can disable the WSL2 backend in your Docker settings for now. You won’t find docker in your WSL2 path anymore but you can work around this temporarily with:

alias docker=docker.exe

Docker on the Windows side (powershell, cmd, etc) will behave normally.

Still there in 20185 😦

/fixed 20190.

This bug seems that still persists as I’m experimenting the hangs with docker in build 22621

This bug seems that still persists as I’m experimenting the hangs with docker in build 4.27.2 137060

I apologize everyone for my english!

After 10 unsuccessful attempts, I thought to do reinstall windows. But at the very last moment I changed my mind …

  1. We completely remove the Docker use script via PoweShell https://stackoverflow.com/questions/42161471/how-to-uninstall-docker-machine-under-windows-10/51167323#51167323

  2. Run the latest Docker installation, I took 2.3.4.0

  3. When installing, DO NOT select support for WSL2

  4. Docker is installed … and a notification appears at startup, about the start of the WSL2 subsystem, I don’t understand how, but the launch still occurs

  5. Docker itself did not completely start for me

  6. You need to get to the settings and run hard reset

  7. He is started, but unfortunately past manipulations cleared it 😕 Nevertheless, I have already launched my working project P/s Because of something, I had to execute “docker-compose up” under sudo

  8. Also check that the marks about integration with wsl 2 distributions have not gone off (Resources / Wsl integration)

image image

  1. maybe he’s pretending … that he works through wsl2 😃

image

It’s not a problem on another computer that’s still on build 20170.

Those are the words I was looking for. Thanks.

Anyways to get Docker Desktop installed? Docker Desktop 2.3.0.4 Installation failed at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext() at System.Linq.Enumerable.<CastIterator>d__971.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Linq.Enumerable.Any[TSource](IEnumerable1 source) at CommunityInstaller.EnableFeaturesAction.GetFeaturesToEnable() at CommunityInstaller.EnableFeaturesAction.<DoAsync>d__37.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at CommunityInstaller.InstallWorkflow.<HandleD4WPackageAsync>d__34.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CommunityInstaller.InstallWorkflow.<DoProcessAsync>d__29.MoveNext()

This bug also breaks the git credentials manager trick to authenticate in git under WSL via the Windows credential manager (git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager.exe")

This is also the case with win32yank which is automatically detected by Neovim meaning it’s not currently possible to yank to the system clipboard from Neovim in WSL 2.

echo 'please please me?' | win32yank.exe -i hangs as per previous comments. It’s not a problem on another computer that’s still on build 20170.

Happy to gather additional info if someone can point me in the right direction. 🙂

Work-around I’m using is just to output to a file first and then read it in to clip.exe

echo "AAAA" > file.tmp
clip.exe < file.tmp

@shadowmaster63

$lsb_release -r                                                                 
Release:        18.04

$cat /proc/version
Linux version 4.19.121-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Fri Jun 19 21:06:10 UTC 2020

> wsl --list -v
  NAME            STATE           VERSION
* kali-linux      Stopped         2
  Ubuntu-18.04    Running         2
  Debian          Stopped         2

I have updated to build 2018 but when i install docker still:

 在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   在 System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   在 System.Linq.Enumerable.<CastIterator>d__97`1.MoveNext()
   在 System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   在 System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   在 System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   在 CommunityInstaller.EnableFeaturesAction.GetFeaturesToEnable()
   在 CommunityInstaller.EnableFeaturesAction.<DoAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 CommunityInstaller.InstallWorkflow.<HandleD4WPackageAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 CommunityInstaller.InstallWorkflow.<DoProcessAsync>d__27.MoveNext()

Is this still not fix in build 2018?