Is there a way to programmatically open a NEW built-in terminal in VSCode from the terminal/bash? - visual-studio-code

Specifically I'd like to run a terminal command from vscode's built in terminal and have that command open another new vscode built-in terminal. Is this possible?
This is related to my question here - https://github.com/mklement0/ttab/issues/51#issuecomment-1372825316
Say I have the following command in my package.json scripts:
"sayHello": "ttab echo hello",
And I run npm run sayHello from the vscode integrated terminal. Is
there a way to have it so that the new terminal that is created is
created within the integrated terminal instead of from (in my case)
the default mac terminal application?

Related

I have to "source ~/.zshrc" everytime I open a new terminal only in vscode

Currently have to manually write source ./zshrc to get my zsh plugins to work within the vscode terminal window, however I dont have this issue if I open a zsh shell outside of vscode. I am using Debian on wsl2.
In terminal I get proper syntax example (due to a plugin)
However in vscode I dont unless i run source ./zshrc
As seen here:

Visual Studio Code Opens and run scripts on the non-default terminal

Until yesterday, my VSC worked fine. I opened, edited, and run my python scripts without a problem.
However since today when I start my VSC session, it starts on Powershell Terminal, that doesn't recognize my conda enviroment despite I set the default terminal as cmd:
When I open the cmd terminal manually, automatically loads my conda env, however when I run the command "Run Python File in terminal" it always opens on Powershell
Any suggestion on how to fix this?

How can I run an independent dart file in Visual Studio Code when my app is already running?

I have an already running Flutter project in Visual Studio Code,
but I want to run a separate Dart file in the same project without terminate my running project.
When i tried to run this file, the running project stops.
You can open your terminal and execute your dart file like
$ dart ./file.dart
To open the terminal, use any of this options:
Use the ⌃` keyboard shortcut with the backtick character.
Use the View > Terminal menu command.
From the Command Palette (⇧⌘P), use the View: Toggle Integrated Terminal command.
https://code.visualstudio.com/docs/editor/integrated-terminal

How to open VS Code and pass commands to integrated termianal via CLI

I wonder how to use the code command to open the VS Code with the integrated terminal launching within with some commands running that I pass directly to the integrated terminal.
Right now I need to do a couple of actions to get it done:
open VS Code via code .
manually open the built-in terminal and run a command like npm run start
Maybe it's possible to open VS Code like this: code . --exec 'npm run start', and it may open the editor and also run another command in the integrated terminal just after VS Code is ready for work.
I look through the documentation and I couldn't find anything useful for this case. Maybe I need to look for something like plugin or tricky bash/zsh script?
Reminder: it’s important to run these “passed” commands via CLI directly in the integrated (built-in) terminal of the newly opened VS Code instance. I know that it's possible to open the editor and then run commands, like code . && npm run start, but it will be just another command in sequence after code, it's not the same as running commands in integrated terminal.
Thanks.

What's the command to open a new integrated terminal from within the integrated terminal in vscode?

I'm trying to setup a chain of tasks that need a terminal for each one. To do so, I need to use a command that opens a new integrated terminal tab from a previous integrated terminal. Is there any way to do so in vs-code integrated terminal?
In mac I would use
open -a Terminal
Or something like ttab that immediately opens a tab in the current iterm terminal.
Thanks
(edited: I'm looking for a command to type in the terminal, not hotkeys)
Ctrl+Shift+` (Tilda) is the keyboard shortcut to open another terminal on Windows.
Cmd+Shift+` (Tilda) is the keyboard shortcut to open another terminal on Mac.