Integrated Terminal - A powerful feature!
Tags: vscode, beginners, programming, tutorial
Published: 2023-02-09 03:49:26

VS Code provides a full fledged terminal that starts at the root of the workspace.

To open the terminal:

- Use the ⌃` keyboard shortcut to toggle the terminal panel.
- Use the ⌃⇧` keyboard shortcut to create a new terminal.
- Use the View > Terminal or Terminal > New Terminal menu commands.
- From the Command Palette (⇧⌘P), use the View: Toggle Terminal command.

![Terminal Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unce4d6elw622tf9sl2k.png)

You can open a new terminal session directly in VS Code in your working directory using `ctrl+ backtick` (the key below the escape key).

When you start your terminal it uses your default shell, if you click on the caret it will show you a list of shells you can use if needed. 

![Shells](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/twya90h46i0w0t3xy45k.png)

What often happens though is you may need multiple terminal sessions running at the same time. Like one for your server and other for managing git or tests.

You can also change the name, color, icon of that terminal session, right click on the terminal session you want to change the information for you may see these options 

![terminal sessions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vavnbov1iml1daz70ank.png)

Click on change color, different color options may appear in the command palatte.

![terminal info](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bd1t43if6gealimsb8t.png)

![terminal info](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9d07sjtlnr2pn2u2m8ng.png)

Similarly you can change the icon, name, color etc. And now you need to fumble between the different terminals to figure out what each one is doing. 

Now if you type out an actual command in the terminal and you screw it up you can actually you can use control + arrows(right|left) to navigate through the command your mouse won't even work here. You can clear the terminal using `ctrl|cmd + k` then use up arrow to go to the last command in your history. 

## Tasks 
What if there is a way where you don't have to write the same command over and over again in the same terminal. Like how many time you might have written `npm start` or `npm run dev` to simplify thing you can create a VS Code task which is just a JSON configuration that contains the commands that you want to run in the terminal. 

### Create a task
- Go to command palette `ctrl|cmd + shift + p`
- write task 
- select configure default build task

![vs code tasks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6kjt1gvnkd84vn9ad4o.png)

![vs code tasks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjwnc7wpcasifskrvicl.png)

![vs code tasks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/flwv7913cxe3yk6hfde2.png)

![vs Code tasks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2b9f2u86yh62mllif112.png)

All these powerful features may help you boost your productivity while coding. Let me know in the comments below the productivity hack you use to boost your productivity. 

#### Want to connect?

<p>
  <samp>
    <a href="https://twitter.com/garimaasharma_" target="_blank">twitter</a> ·
    <a target="_blank" href="https://dev.to/garimasharma">blogs</a> ·
    <a target="_blank" href="https://garimasharma.netlify.app">portfolio</a> ·
    <a target="_blank" href="mailto:sharmagarima814@gmail.com">email</a> ·
    <a target="_blank" href="https://www.linkedin.com/in/garima-sharma08/">linkedin</a>
  </samp>
</p>

<a href="https://www.buymeacoffee.com/garimasharma"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=garimasharma&button_colour=FF5F5F&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00" /></a>