How do I attach a terminal process that was not started from the UI?
March 30, 2019 at 12:37pmHow do I attach a terminal process that was not started from the UI?
March 30, 2019 at 12:37pmI am looking at the
TerminalService
and 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 terminalId
but 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
/process
package, i.e. use IShellTerminalServer
to create a terminal process and ProcessManager
to 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