[squeak-dev] OSProcess Question

David T. Lewis lewis at mail.msen.com
Thu Aug 25 12:41:06 UTC 2022


Hi Eric,

On Thu, Aug 25, 2022 at 08:10:35AM -0400, Eric Gade wrote:
> Hello,
> 
> I've been unable to find good documentation / examples of an OSProcess use
> case. How can I start an external process that remains running while I pipe
> data into its stdin and read data from its stdout?
> 

For this you will want to use a PipeableOSProcess, which allows you to
start and external process, write to its stdin, and read from its stdout
and stderr. The class comment gives an overview.

PipeableOSProcess is part of the CommandShell package, so be sure to load
CommandShell along with OSProcess.

> To be specific, I am starting to toy around with the JS/Typescript LSP
> server
> <https://github.com/typescript-language-server/typescript-language-server>,
> which seems to expect input on stdin (rather than using sockets or whatnot)
> 

If you happen to have tk/wish installed on your computer, try evaluating
"PipeableOSProcess tkExample" to see something that may be similar to what
you have in mind. It starts an external process running /usr/bin/wish with
pipes connected to stdin/stdout/stderr to send commands to the wish shell
and to read its output.

HTH,

Dave



More information about the Squeak-dev mailing list