1 00:00:00,360 --> 00:00:04,35 The terminal is one of the most commonly used tools for many 2 00:00:04,35 --> 00:00:06,526 software developers, probably second only 3 00:00:06,526 --> 00:00:07,585 to their editors. 4 00:00:07,585 --> 00:00:11,893 Therefore, it makes sense that the Visual Studio Code team decided to 5 00:00:11,893 --> 00:00:14,617 build a terminal right into the application. 6 00:00:14,617 --> 00:00:17,271 This cuts down on application switching, 7 00:00:17,271 --> 00:00:21,278 and the tight integration provides some nice benefits you won't get 8 00:00:21,278 --> 00:00:23,585 when working with an external terminal. 9 00:00:23,585 --> 00:00:26,700 As you might expect, there are quite a few ways to open 10 00:00:26,700 --> 00:00:28,85 the terminal in VS Code. 11 00:00:28,85 --> 00:00:32,979 Probably, the most obvious is to go to the terminal menu and 12 00:00:32,979 --> 00:00:34,667 select "New Terminal." 13 00:00:34,667 --> 00:00:42,579 Another option is to go to the View menu and select "Terminal." 14 00:00:42,579 --> 00:00:46,490 I personally find myself primarily using the keyboard shortcut 15 00:00:46,490 --> 00:00:48,350 associated with this command. 16 00:00:48,350 --> 00:00:51,666 It's Ctrl backtick, which will toggle the terminal 17 00:00:51,666 --> 00:00:52,877 in and out of view. 18 00:00:52,877 --> 00:00:56,582 I'll just click on this menu option now since I already 19 00:00:56,582 --> 00:00:57,886 have the menu open. 20 00:00:57,886 --> 00:01:02,52 By default, the terminal opens in its own panel at the bottom 21 00:01:02,52 --> 00:01:03,24 of the screen. 22 00:01:03,24 --> 00:01:07,299 I'm on a Windows machine, and by default, that runs PowerShell 23 00:01:07,299 --> 00:01:08,820 inside new terminals. 24 00:01:08,820 --> 00:01:12,61 You can see an indication that it's PowerShell in the upper right 25 00:01:12,61 --> 00:01:13,226 corner of the terminal 26 00:01:13,226 --> 00:01:16,780 along with a few other helpful dropdowns and buttons. 27 00:01:16,780 --> 00:01:20,397 I can now do anything I might choose to do in an external 28 00:01:20,397 --> 00:01:21,559 PowerShell window. 29 00:01:21,559 --> 00:01:26,895 I can review some files, run commands, 30 00:01:26,895 --> 00:01:30,525 and do anything else PowerShell is capable of doing. 31 00:01:30,525 --> 00:01:34,605 Notice that by default, the terminal opened in the root 32 00:01:34,605 --> 00:01:36,453 directory of my project. 33 00:01:36,453 --> 00:01:40,731 I keep saying "by default" because just about everything about the 34 00:01:40,731 --> 00:01:42,428 terminal is configurable. 35 00:01:42,428 --> 00:01:45,345 We'll explore some of its many options coming up, 36 00:01:45,345 --> 00:01:49,20 but let's first look at a few more ways you can open and use it. 37 00:01:49,20 --> 00:01:52,972 You can open additional terminals by clicking the plus button 38 00:01:52,972 --> 00:01:54,684 in the upper right corner. 39 00:01:54,684 --> 00:01:58,804 You can open another terminal, but with a different shell by 40 00:01:58,804 --> 00:02:01,388 clicking the little down arrow button. 41 00:02:01,388 --> 00:02:05,56 You can see some of the other shells available on my machine 42 00:02:05,56 --> 00:02:06,984 based on what I have installed. 43 00:02:06,984 --> 00:02:09,239 Your list may be a little different. 44 00:02:09,239 --> 00:02:12,470 I'll open a Git Bash terminal. 45 00:02:12,470 --> 00:02:16,989 Once you have two terminals open, they'll both appear in a tabbed 46 00:02:16,989 --> 00:02:18,260 view on the right. 47 00:02:18,260 --> 00:02:22,90 You can simply click on them to move between them. 48 00:02:22,90 --> 00:02:26,530 You can also make a few quick customizations to the tabbed list 49 00:02:26,530 --> 00:02:29,812 so it's easy to identify the terminal you want for 50 00:02:29,812 --> 00:02:30,884 a specific task. 51 00:02:30,884 --> 00:02:36,58 For instance, if I'm planning to use this Bash terminal for command 52 00:02:36,58 --> 00:02:39,350 line Git operations, I could right-click on 53 00:02:39,350 --> 00:02:40,996 it and choose "Rename" 54 00:02:40,996 --> 00:02:45,875 to give it a more meaningful name. I'll rename it to git. 55 00:02:45,875 --> 00:02:52,696 I'll also right-click and select "Change Icon" and pick a Git 56 00:02:52,696 --> 00:02:55,604 icon from the pop up list. 57 00:02:55,604 --> 00:02:59,523 Just to make it stand out a little more, 58 00:02:59,523 --> 00:03:02,774 I'll also change its color to red. 59 00:03:02,774 --> 00:03:07,584 Selecting a terminal in the list brings up a trash can icon next 60 00:03:07,584 --> 00:03:12,165 to it, you can use to close it, as well as a split button that 61 00:03:12,165 --> 00:03:17,52 will open another terminal next to it in the same terminal group. 62 00:03:17,52 --> 00:03:21,697 I'll click that. 63 00:03:21,697 --> 00:03:26,859 A new PowerShell terminal opens next to my Git Bash terminal. 64 00:03:26,859 --> 00:03:29,520 If you don't like your new terminal appearing in the 65 00:03:29,520 --> 00:03:30,563 panel at the bottom 66 00:03:30,563 --> 00:03:33,612 and you'd rather just have it in the editor area with 67 00:03:33,612 --> 00:03:34,550 your code files, 68 00:03:34,550 --> 00:03:36,516 that's also an option. 69 00:03:36,516 --> 00:03:41,975 I'll right-click on my original PowerShell terminal and then 70 00:03:41,975 --> 00:03:45,399 select "Move Terminal into Editor Area." 71 00:03:45,399 --> 00:03:49,921 Now, it's just another tab in my editor area, 72 00:03:49,921 --> 00:03:53,282 and even if I press "Ctrl backtick" to close the terminal 73 00:03:53,282 --> 00:03:54,527 group at the bottom, 74 00:03:54,527 --> 00:03:59,146 this one stays open among any code files I might also be working on. 75 00:03:59,146 --> 00:04:02,271 I've already shown you several different ways to open 76 00:04:02,271 --> 00:04:05,36 a new terminal, but I want to show you one more 77 00:04:05,36 --> 00:04:06,719 you might also find helpful 78 00:04:06,719 --> 00:04:10,51 before we move on to some useful customizations. 79 00:04:10,51 --> 00:04:13,952 If you need to run a shell command inside a nested directory 80 00:04:13,952 --> 00:04:17,257 in your project, you can quickly open a terminal in 81 00:04:17,257 --> 00:04:19,902 that directory from the project explorer. 82 00:04:19,902 --> 00:04:22,705 For instance, in my project explorer, 83 00:04:22,705 --> 00:04:26,974 I'll first expand the _css directory. 84 00:04:26,974 --> 00:04:30,874 Inside there, is another directory named images. 85 00:04:30,874 --> 00:04:37,182 I can open a new terminal in that directory by right-clicking on it 86 00:04:37,182 --> 00:04:41,100 and choosing "Open in Integrated Terminal." 87 00:04:41,100 --> 00:04:46,649 You can see from my prompt and the output of the PWD command that I'm 88 00:04:46,649 --> 00:04:51,300 in the CSS images directory inside the root of my project. 89 00:04:51,300 --> 00:04:55,196 Okay. You now have lots of options for opening and arranging 90 00:04:55,196 --> 00:04:58,233 terminals and using different shells with them. 91 00:04:58,233 --> 00:05:02,67 Up next, I'll introduce you to just a few of the seemingly 92 00:05:02,67 --> 00:05:05,700 endless number of ways you can customize your terminals 93 00:05:05,700 --> 00:05:07,00 in VS Code.