You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In Windows Subsystem for Linux, piping from cat to sed causes an error. #3454
Have you checked if problem occurs with fish 2.3.1?
Tried fish without third-party customizations (check sh -c 'env HOME=$(mktemp -d) fish')?
fish version installed(fish --version): 2.3.1
OS/terminal used: Windows 10 (Windows Subsystem for Linux), mintty (also checked on cmd.exe)
Reproduction steps
Launch a WSL terminal (cmd.exe or mintty; the bug is reproducible in both). By default, this will be bash.
Launch fish.
Create a text file.
Pipe the contents of the text file through sed with a simple substitution.
Results
~ $ echo "text" > file.txt~ $ cat file.txt | sed 's/e/f/g'Could not send process 212, 'sed' in job 1, 'cat file.txt | sed 's/e/f/g'' from group 3 to group 211setpgid: Operation not permittedsed: read error on stdin: Input/output error~ $
Notes
Piping from echo to sed works as expected.
The above steps work as expected in bash, both in mintty and cmd.exe
The obvious question here is if this is something fish should do anything about. WSL is meant to be bug-for-bug binary compatible with linux, and I've never seen this error in linux.
Of course it's possible this is something we should cope with.
FWIW,I can reproduce the problem. Replacing cat with head and tail fail in a similar manner. But using grep works because it's a function that wraps the external command and thus doesn't fork that side of the pipe. This is clearly an artifact of an incomplete mapping of Linux semantics for process management to the Windows model. TBD is whether there is anything fish can reasonably do to workaround this WSL quirk.
Activity
faho commentedon Oct 14, 2016
The obvious question here is if this is something fish should do anything about. WSL is meant to be bug-for-bug binary compatible with linux, and I've never seen this error in linux.
Of course it's possible this is something we should cope with.
krader1961 commentedon Oct 14, 2016
FWIW,I can reproduce the problem. Replacing
catwithheadandtailfail in a similar manner. But usinggrepworks because it's a function that wraps the external command and thus doesn't fork that side of the pipe. This is clearly an artifact of an incomplete mapping of Linux semantics for process management to the Windows model. TBD is whether there is anything fish can reasonably do to workaround this WSL quirk.ridiculousfish commentedon Oct 22, 2016
This seems surprising to me - why isn't bash, etc. affected? I'll try to take a look.
saschagehlich commentedon Nov 24, 2016
@ridiculousfish Were you able to find something out about this?
ridiculousfish commentedon Nov 26, 2016
I had to reinstall Windows and haven't taken a look yet
krader1961 commentedon Apr 6, 2017
I updated my Windows 10 WSL environment and fish. I can no longer reproduce this failure so I'm closing the issue.