How to attach a frontend terminal to a backend terminal process?

I have created a terminal process in the backend, and used ProcessManager to access to it, and have passed the terminal id to the frontend:

image

However, in frontend, i don’t know how to open a terminal and acttach to this terminal process.

I have used let term = TerminalFrontendContribution.getById(terminalId) and TerminalFrontendContribution.activateTerminal(term) to try, but it didn’t work.

Please help, thank you very much.

@PeimingMo1 you can likely use the TerminalService implemented by the TerminalFrontendContribution.
You’ll have access to methods such as:

Among others. If you’d like to learn how to attach to a terminal a simple search for attach in the extension should suffice:

Yes, function start works. Thank you.