Hello. Is there any way to open a new terminal in VS Code and execute a command using code or command line?
Hi @amulobaev ,
I’m not sure I understand:
- Do you mean from inside the IDE? Then it’s as easy as
Create new terminal→
- Or automatically on workspace startup? Then you can find documentation over here
Hope that helps!
Just an example: we can open URL inside VS Code using command ‘/ide/bin/code --command gitpod.api.preview URL’.
Is it possible to use the same or another approach to start some script (or command) inside a new terminal in VS Code?
--command is most likely going to be remove in upsteam (original VS Code)
You can provide VS Code extension that creates new terminals.
I tried a few commands, i.e. ‘workbench.action.terminal.new’ and it worked.
But I was not able to pass any arguments, i.e. the following command does not accept ‘name’ argument in any format:
code --command workbench.action.terminal.renameWithArg ...
As I said, don’t rely on
code --command. It is not complete and likely will be removed.