I am trying to write an extension that opens a terminal and executes a script on startup. How do I do that?
I am using the code in the HelloWorld extension generated from the yo-generator.
This is what I currently have
However, only the terminal appears but without any input (“echo Test”) or any output.
[original thread by Zhang Bosen]
terminalWidget has method “sendText”. You can use it.
I tried it but it there is not output on the terminal. What I am looking for is something like this after theia startup.
It is something like gitpod’s auto configuration when you initially load into gitpod.
sounds like a bug, that
sendText does nothing
Hi there, I’m looking to implement some terminal script commands but im not sure where to implement this code in.
@nicholasl00 Could you elaborate a bit more? Using
sendText should be fine if you don’t need output. If you want to get output when you should use tasks or processes.
@anton-kosyakov i want to run a few commands on the terminal and get the returned output.
The returned output is a link to a novnc display, which i intend to parse it to the OpenURL in the command palette.
Specifically where/how should i implement this?
The issue is that terminal manipulates streams, where are no such concepts like tasks or commands. So i don’t think it is a proper API. I have not used this part of Theia often and not very familiar. On your place I would look into the process and task Theia extensions, sorry cannot give more help right now. @elaihau @paul-marechal maybe you can help to find a proper API to use