From the course: Using Git with Visual Studio Code

Built-in terminals

- [Instructor] Terminals are still a great way to work with Git and Visual Studio Code. So let's take a look at some of the options for working with them. The terminal commands are in a couple of places in Visual Studio Code. So for example, you can go to the view menu and select terminal right here to show or hide the terminal. It's a good idea to learn this shortcut, so on a Mac this is control and then the tilda key to open and close that. Go ahead and try that in your operating system to show and hide the terminal and get used to it because it'll be much quicker for you to get to it that way. Now there's also a terminal menu right here, and it really has a couple of useful commands right here. So you can select new terminal and this will open up an additional terminal. Then you get this little sort of menu to the side of your current terminal and you can see that you can switch between the two terminals by clicking on these different icons. If you open up a terminal and you want to get rid of it you can hit this delete button and notice that there is an icon right here to split the terminal. This will open a terminal side by side and it's useful if you have maybe like a build command running and you want to do some git commands here on the right hand side. Notice also that the terminals are kind of connected to each other in this particular mode. Let's go ahead delete one of these. That command is also in the terminal menu where you can choose either a new terminal or split terminal. Most of the other commands will be right here on the top right of the screen, you have a bunch of icons that you can choose. So for example if we click right here, you'll see some additional options. There's another place to create a split terminal and you can move the terminal into an editor area, which will make it appear sort of like a normal tab right here. Now I normally have my terminal at the bottom and one nice thing about Visual Studio Code is that you can customize where things go by dragging them wherever you want them to go. So if I want to move this whole thing right here so the terminal tab to like another sidebar then I can just move it wherever I want and it will drop in that section. So now it's kind of side by side, but I still have all of the commands that I normally have. Some people really like to move things around so that's good to know. Now to move it back, I'm going to just reset the location and it'll put it back where it used to be down here. Notice that there's some other options over here like problems, output, the debug console, but you want to be on the terminal tab when you're working with the terminal. Now you can also change the color of the specific terminal or the icon. So we can make it have maybe a green color and we can maybe change the icon to make sure that we're going to be working with Git or maybe GitHub in this particular version of the terminal. And that way if you have multiple terminals open you can identify really quick which one is which. You can also rename what's in here, so you could say this is going to be primarily where I work with GitHub. Make sure that you hit enter in order to accept the name, otherwise it'll just reset. So now we have a terminal that is well identified, and it has a custom color and you can also kill the terminal which is the same as hitting the trash icon. We're not going to do that with a single terminal cuz it really wouldn't make a lot of sense. There's another bunch of icons that you can do stuff with. So for example, here we can add a terminal just like we did before, and let's go ahead and delete that. You can also see that there is a little dropdown here so you can specify the type of terminal that you want to use. So here I can choose the different sort of terminals that are are installed in my operating system which basically for a Mac would be seashell or bash. There's of course another icon here for splitting the terminal and also deleting the terminal. Again, it doesn't make much sense right here so oftentimes these commands will be repeated. Now this button's pretty interesting, it lets you dock the terminal to the top. If you want like a full screen view of your terminal you can show and hide that. And if you drag this sidebar you'll get rid of the file view, which you can break by just clicking and dragging that back out. So for a full screen terminal, you can do this and of course you can even hide the activity bar for a full screen terminal if that's how you like to work.

Contents