This seems to be a common enough need so I’m sure something like this is somewhere in the ocaml ecosystem though I have not found useful something yet.
I could always build stuff from scratch using low level functions but I’m wondering if something is already available. I would prefer it uses Lwt.
Long long long ago I wrote one. I am quite sure I announced it on the mailing list, but I don’t remember where I put it, this was way before git let alone GitHub. Look for something like mlexpect, maybe it’s in the list archive if it goes back far enough, or maybe the way back machine knows.
I hacked together a library just for this: mprocs/pty at master · pvolok/mprocs · GitHub. It also works on windows (with conpty support). It’s not a reusable library but can be used as a working example.
I wont be able to copy paste or reuse any code unless there is some sort of an open source license. I’m assuming that this is your own code and you own the copyright to it – in that case you can add the relevant license to the project and/or source files.
Vendored stuff, as far as my own understanding goes (I am not a lawyer), always maintains its original license and copyright.
Of course, there is no hurry to do any of this. If you’re not ready to add your license to your project just yet that’s totally cool. Thanks for your helpful response!