# Simple launch config

In most instances, you will need to specify a "Launch Configuration" for VS Code. These are commonly referred to as "Launch Configs". This is a file that specifies how VS Code should run your project.

The exercise in the folder "2-launch-configs" is a project written in TypeScript. It is also a console application. If you try and run it, it will run, but it won't appear to do anything. This is because by default, VS Code runs console applications on an "internal" terminal that you can't see. We need to configure VS Code to run this app correctly so we can use and debug it.

{% tabs %}
{% tab title="First Tab" %}
Open the "2-launch-configs" project. Add a launch config to this application that instructs VS Code to use the "integrated" terminal.

Add a breakpoint to the application. Run it with VS Code and hit the breakpoint.
{% endtab %}

{% tab title="Second Tab" %}
* Press **Cmd/Ctrl + Shift + D** to the Debug Sidebar view

![](https://1151923643-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlvtEHKkq5bvzPq1pJ4%2F-Lm5WIB-swfdJcB6Is3B%2F-Lm16ZXJ4-uNGFkQ7sZR%2Fimage.png?alt=media\&token=33b25c67-8b21-4f6e-90ed-4b5d86e35c91)

* Open the Dropdown List at the top and select "Add Config (2-launch-configs)..."

![](https://1151923643-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlvtEHKkq5bvzPq1pJ4%2F-Lm5WIB-swfdJcB6Is3B%2F-Lm16hvU0pUPoO1LBcaM%2Fimage.png?alt=media\&token=a2992425-3d97-4799-a486-5f30a5c2e55c)

* Select "Node.js"
* A folder called ".vscode" will be added to the project "2-launch-configs"
* Inside that folder will be a file called "launch.json". This file will be opened automatically by the editor.
* Change the name to "Start Project 2"

![](https://1151923643-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlvtEHKkq5bvzPq1pJ4%2F-Lm5WIB-swfdJcB6Is3B%2F-Lm18NezpccMEhB38WDk%2Fimage.png?alt=media\&token=115600b4-ae3f-4222-9f7d-ed16d074a279)

```
"name": "Start Project 2"
```

* Change the "program" value to "${workspaceFolder}/index.ts"

```
"program": "${workspaceFolder/index.ts"
```

* Underneath "outFiles", add a line that tells VS Code to use the integrated terminal

```
"console": "integratedTerminal"
```

* Make sure that "Start Project 2" is selected in the dropdown list at the top of the Debug view and press the green arrow

![](https://1151923643-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlvtEHKkq5bvzPq1pJ4%2F-Lm5WIB-swfdJcB6Is3B%2F-Lm17sT5c5XNCtYad9Tf%2Fimage.png?alt=media\&token=8d32ab93-9e4f-4155-9416-71f796e92bf4)

* The application will run and the integrated terminal will open
* In the "index.ts" file, put a breakpoint on line 13

![](https://1151923643-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlvtEHKkq5bvzPq1pJ4%2F-Lm5WIB-swfdJcB6Is3B%2F-Lm18Zmidq5G-jXIac0Z%2Fimage.png?alt=media\&token=3fb97390-b817-4bf6-a5e1-976a2543e23e)

* Enter a color value in the terminal and see that the breakpoint is hit

![](https://1151923643-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlvtEHKkq5bvzPq1pJ4%2F-Lm5WIB-swfdJcB6Is3B%2F-Lm18g4zxKhrXTragq3o%2Fimage.png?alt=media\&token=af8a3442-2879-490f-8cc1-bb0ab98272ad)

{% hint style="info" %}
Note that no special configuration is required for VS Code to handle TypeScript files. If you want VS Code to build or watch/build your TypeScript, press **Cmd/Ctrl + Shift + B** and select "watch" or "build".
{% endhint %}

![](https://1151923643-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LlvtEHKkq5bvzPq1pJ4%2F-Lm5WIB-swfdJcB6Is3B%2F-Lm18vt-91wF-P83pFFp%2Fimage.png?alt=media\&token=fc79ad7a-f660-4975-85a8-7682b66b722b)
{% endtab %}
{% endtabs %}



