-
Notifications
You must be signed in to change notification settings - Fork 612
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
aliases.sh: allow pipe to work #414
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Florian Traverse <[email protected]>
Interesting! This switch was introduced in rprichard/winpty@222ecb9. The commit message suggests that those options might be pulled at any point, but then, they have been in |
Seems that the |
Moving instead to a wrapper script running |
I don't think you'll get a response, active |
Since we're talking about a Bash alias, we could do the same in the alias itself, too, right? |
Seems that I was wrong about aliases: they cannot contain if-then-else blocks. But shell functions can: $ unalias node
$ function node () { if test -t 0 -a -t 1; then winpty.exe node.exe "$@"; else node.exe "$@"; fi; }
$ node
Welcome to Node.js v16.15.0.
Type ".help" for more information.
> console.log("123")
123
undefined
> process.exit(0)
$ node -e 'console.log("123")' | cat
123 |
@temsa how about trying your hand at patching |
After investigating for a while why this issue, by which I have been affected recently, happened, I found out that we could avoid this
pipe
problem.this is how typically it materializes :
We just need to use the undocumented switch from
winpty
to allow for the pipe to another command to actually work without getting intostdout is not a tty
. It also still provides the value ofwinpty
, e.g. for running an interactive shellThis PR just adds the switch, which should allow both of those commands to work in the intended manner: