<div dir="ltr"><div>I am having a problem (I think) getting even basic external process to run. For example, if I execute this code and inspect it:</div><div>```</div><div>proc := ExternalUnixOSProcess <br>      forkAndExec: '/opt/homebrew/bin/typescript-language-server'<br>   arguments: { '--stdio' }<br>      environment: nil</div><div>```</div><div><br></div><div>The process status is complete immediately (if it works the process should run until explicitly terminated). This is also the case if  I append `/bin/zsh ` or `/bin/sh ` to the command.</div><div>  <br></div><div>What am I missing?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 25, 2022 at 8:41 AM David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Eric,<br>
<br>
On Thu, Aug 25, 2022 at 08:10:35AM -0400, Eric Gade wrote:<br>
> Hello,<br>
> <br>
> I've been unable to find good documentation / examples of an OSProcess use<br>
> case. How can I start an external process that remains running while I pipe<br>
> data into its stdin and read data from its stdout?<br>
> <br>
<br>
For this you will want to use a PipeableOSProcess, which allows you to<br>
start and external process, write to its stdin, and read from its stdout<br>
and stderr. The class comment gives an overview.<br>
<br>
PipeableOSProcess is part of the CommandShell package, so be sure to load<br>
CommandShell along with OSProcess.<br>
<br>
> To be specific, I am starting to toy around with the JS/Typescript LSP<br>
> server<br>
> <<a href="https://github.com/typescript-language-server/typescript-language-server" rel="noreferrer" target="_blank">https://github.com/typescript-language-server/typescript-language-server</a>>,<br>
> which seems to expect input on stdin (rather than using sockets or whatnot)<br>
> <br>
<br>
If you happen to have tk/wish installed on your computer, try evaluating<br>
"PipeableOSProcess tkExample" to see something that may be similar to what<br>
you have in mind. It starts an external process running /usr/bin/wish with<br>
pipes connected to stdin/stdout/stderr to send commands to the wish shell<br>
and to read its output.<br>
<br>
HTH,<br>
<br>
Dave<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Eric</div></div></div>