Question
Does D have built in support for pseudo-terminals via the Phobos runtime libraries ?...I'm assuming there isn't since ptys are highly platform specific. Are there other third party alternatives ? Ultimately, I'd like to implement an Expect-like library for D if it doesn't already exist.
Solution
If by "support for pseudo-terminals via the Phobos runtime" you mean some higher level abstraction on top of the pseudo-terminals supported by the underlying operating-system, then I must say I have never seen such a thing. Like C++, D can directly call C functions, so I believe writing an expect-like application in D should not be difficult if you already did something similar in C or C++.
On Linux people typically call openpty(3)
, forkpty(3)
or login_tty(3)
functions. I do not know about other systems.