On Tue, 2021-01-12 at 10:15 -0600, Phoebe Goldman wrote:
Emacs by default allocates a pty for subprocesses. There’s no way to do this portably, as many Lisps don’t support it, so UIOP won’t help you here. If you’re on SBCL and portability is not a concern, you can use sb-ext:run-program with a :pty keyword argument, as described in section 7.7.3 of the SBCL manual. Failing that, it’s probably best to use sudo -S.
While it looks like Pierre has his own solution, I thought I would mention this for posterity on the list: "script" is a relatively portable unix command that will allocate a pty for running. If you need a pty on a unix then it's probably your best-bet if you don't want to be tied to sb-ext:run-program.