How do I attach a terminal process that was not started from the UI?March 30, 2019 at 12:37pm
I am looking at the
TerminalServiceand I am wondering how I can attach a terminal to a process that was not started from the UI. I saw that
start()only takes a
terminalIdbut I can't see a way to attach to a running process. In our case we want to start a process when the container is started, and then when the UI (Theia) loads, we would like to attach to that process. Is this possible?
March 30, 2019 at 12:44pm
Hi, i think the process has to be started via Theia, otherwise Theia does not have a chance listen to process streams.
I don't know Node.js api allowing attachment to an existing process.
March 30, 2019 at 8:07pm
March 31, 2019 at 2:45am
You can start processes on Theia start up before a client connects using
/processpackage, i.e. use
IShellTerminalServerto create a terminal process and
ProcessManagerto access it. You can also add an http endpoint to start a new terminal process on a request. When a client connects it can fetch a terminal id and attach to it.
April 1, 2019 at 8:34am