process icon indicating copy to clipboard operation
process copied to clipboard

`pb {:in "foo"}` hangs

Open dbohdan opened this issue 2 years ago • 2 comments

I have run into an apparent hang when using pb in babashka on Linux. I can't determine if I am using the interface wrong or if this is a bug. Please advise.

> bb --version
babashka v1.3.176
> bb -e '(-> (babashka.process/process {:in "hi"} "cat") (babashka.process/process "cat") :out slurp)'
"hi"
> bb -e '(-> (babashka.process/pipeline (babashka.process/pb {:in :inherit} "cat") (babashka.process/pb "cat")) last :out slurp)'
^D
""
> bb -e '(-> (babashka.process/pipeline (babashka.process/pb {:in "hi"} "cat") (babashka.process/pb "cat")) last :out slurp)'

This is where babashka seems to wait forever. It does not react to ^D, only ^C.

dbohdan avatar Apr 16 '23 18:04 dbohdan

@dbohdan This is probably a bug.

E.g. this works:

$ bb -e '(-> (babashka.process/pipeline (babashka.process/pb "echo hello") (babashka.process/pb "cat")) last deref :out slurp)'
"hello\n"

but the :in option is probably not respected with pipeline / pb.

borkdude avatar Apr 16 '23 19:04 borkdude

I see. Thanks. I've replaced my use with babashka.process/process.

dbohdan avatar Apr 16 '23 21:04 dbohdan