Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: piping seems broken #5270

Open
anki-code opened this issue Jan 24, 2024 · 5 comments
Open

Windows: piping seems broken #5270

anki-code opened this issue Jan 24, 2024 · 5 comments

Comments

@anki-code
Copy link
Member

anki-code commented Jan 24, 2024

Originally posted by @guraltsev in #5150 (comment):

Part 1. Piping

Piping seems broken in general. For example:

echo "hello" |  C:\Programs.global\msys2\app.noinstall\ucrt64\bin\cat.exe

freezes in xonsh but

echo "hello" | C:\\Programs.global\\msys2\\app.noinstall\\ucrt64\\bin\\cat.exe

works normally under git-bash for windows or msys bash

Part 2. Piping from unthreadable alias

#5317 (comment)

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@Spitfire1900
Copy link

Spitfire1900 commented Jan 29, 2024

Not reproducing using Git for Windows.

XXXXXX ~ [1] @ where cat.exe
C:\Program Files\Git\usr\bin\cat.exe
XXXXXX ~ @ echo 'hello' | cat.exe
hello

@Spitfire1900
Copy link

I've reproduced a hang on xonfig info -j | cat in Ubuntu 22.04.3

@Spitfire1900
Copy link

The following seems to be a workaround

_ = $(xonfig info -j); echo @(_) | jq .

@anki-code
Copy link
Member Author

From another thread. Reported by guraltsev:

I am having the same exact problem and specifically with jq! I tried it with the python from msys2 with ucrt64 as well as with the standard windows python (3.11.7 and 3.12.1). In both cases jq hangs from the command:

echo "{\"a\":2}"  |  jq .

but works perfectly if one does

echo "{\"a\":2}"  > test
jq . test

Also, the same problem happens if one does

echo "{\"a\":2}"  > test
cat test | jq . 

However

tail test | jq .

works ok!

The problem, I believe, is that both cat and echo are xonsh commands while tail is a "true" executable.

The problem seems to lie in the piping logic of xonsh

@anki-code
Copy link
Member Author

Reported Awpteamoose:

history | grep foo outputs matches and then hangs on Windows, regardless of whether there actually were matches or not. I'm using wt.exe for terminal, xonsh --no-rc and GNU grep for Windows (in PATH). Other things like cat foo | grep bar work fine.

@anki-code anki-code changed the title Piping seems broken in windows Windows: piping seems broken May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants