-
Notifications
You must be signed in to change notification settings - Fork 2.5k
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to run commands in terminal on startup? #3929
Comments
It seems to be a race between opening a connection and calling |
@akosyakov Is there an alternative way which I can achieve the same goal while avoiding this race condition? |
please try to await on |
@akosyakov I tried The flow now is like this: let terminalWidget = await this.terminalService.newTerminal({});
await terminalWidget.start();
await terminalWidget.sendText("ls -all")
await this.terminalService.activateTerminal(terminalWidget); |
yes, I think it is expected
|
@akosyakov Thanks for the solution! It works. However, there seems to be a small issue. The command to be ran appear on top of the terminal. This is the code that triggers it: let terminalWidget = await this.terminalService.newTerminal({});
await terminalWidget.start();
await terminalWidget.sendText('echo "Test"\n')
await this.terminalService.activateTerminal(terminalWidget); Is there something that I am missing? |
I think it is timing issue again, |
@akosyakov It works! Thanks for the help! |
I am unable to run terminal commands on startup.
The issue has been discussed here: https://spectrum.chat/theia/general/how-to-run-terminal-commands-on-theia-startup~d6caa472-bd00-4e69-8772-d3e99929c622
The text was updated successfully, but these errors were encountered: