Input attempt from subprocesses ignored
fosskers opened this issue · 1 comments
fosskers commented
My program calls out to certain external programs, and they themselves have certain confirmation prompts. I used to use raw shell calls from base
, but am trying to port to Shelly. Shelly seems to ignore attempts by the subprogarms to get input:
colin@yumi ~/c/h/aura> stack exec -- sudo aura -Rsu pkgbuilder
checking dependencies...
Packages (5) asp-2-1 pyalpm-0.8.2-2 python-parse-1.8.2-1 python-srcinfo-0.0.8-2 pkgbuilder-4.2.17-1
Total Removed Size: 0.81 MiB
:: Do you want to remove these packages? [Y/n]
aura:
Ran commands:
pacman -R -s -u pkgbuilder
which pacman
Exception: error running: pacman -R -s -u pkgbuilder
exit status: 1
stderr: :: Do you want to remove these packages? [Y/n]
colin@yumi ~/c/h/aura>
and as you can see, the subprogram pacman
immediatel exists with 1
instead of being allowed to accept user input.
Thoughts? Thank you.
fosskers commented
The answer was to use runHandles
and set the various handles to Inherit
, as in:
runHandles c args [ InHandle Inherit, OutHandle Inherit, ErrorHandle Inherit ] f