aliases.sh: allow pipe to work#414
Conversation
Signed-off-by: Florian Traverse <florian.traverse@gmail.com>
|
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 |
|
Let's just close this PR, it's multi-year stale. |
After investigating for a while why this issue, by which I have been affected recently, happened, I found out that we could avoid this
pipeproblem.this is how typically it materializes :
We just need to use the undocumented switch from
winptyto 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: