VSCode GUI tour: Explore The Elements of This Powerful IDE

It might look overwhelming when you fire up VSCode for the first time. Let me walk you through the GUI so you get the most from this powerful IDE.

Main sections of the VSCode workspace

The VSCode window is divided into a handful of areas. From top to bottom and left to right, these are:

  1. The title bar with the menu and the Command Center
  2. The activity bar, the narrow strip of icons on the far left
  3. The primary side bar, which shows the Explorer, Search, and other views
  4. The editor, where you write your code
  5. The panel at the bottom, with the terminal, Problems, Output, and Debug Console
  6. The status bar at the very bottom
  7. The secondary side bar on the right, which holds the Chat view if you use GitHub Copilot
The VSCode window with its areas numbered: title bar, activity bar, side bar, editor, panel and status bar
The VSCode window: 1 title bar, 2 activity bar, 3 primary side bar, 4 editor, 5 panel, 6 status bar. The secondary side bar is hidden here.

You can show and hide most of these areas with the layout buttons in the top-right corner of the window. Let’s look at each of them in more detail.

The menu bar

The VSCode menu bar on a Mac with the View menu open
Menus from VSCode’s menu bar

On Windows and Linux, the menu sits in the title bar at the top of the VSCode window. On a Mac, it’s in the macOS menu bar at the top of your screen, like in any other app. The menu is a no-frills part of the UI but vital to your projects:

  • Under “File”, you can create, open, and save files, open a folder, and open settings. You can also add more folders to your workspace.
  • The “Edit” menu contains undo and redo, the standard copy and paste options, and find and replace (also across all files).
  • Under “Selection”, there are options that help you select and move code, like selecting a whole line or adding a cursor to several lines at once.
  • The “View” menu lets you open every view and panel, change the look of VSCode, and open the Command Palette.
  • I don’t use “Go” as much, but it helps you jump through your code, for example to the definition of a function.
  • The “Run” menu lets you start your code with or without the debugger, and manage breakpoints.
  • The “Terminal” menu lets you open a new terminal and run tasks.
  • The last one is “Help”, which leads you to documentation, keyboard shortcut references, and release notes.

In the middle of the title bar, you’ll find a search box called the Command Center. Click it to quickly open any file in your project by typing part of its name. It’s also a shortcut to the Command Palette, which I’ll cover next.

The Command Palette

If you remember one thing from this page, make it this one. Press Ctrl+Shift+P (Cmd+Shift+P on a Mac) to open the Command Palette. It’s a search box that gives you access to every command in VSCode and in your installed extensions.

Start typing what you want to do, and VSCode shows the matching commands. For example:

  • Type Python: Select Interpreter to pick which Python installation or virtual environment VSCode uses.
  • Type Python: Create Environment to create a virtual environment for your project.
  • Type theme to change the color theme.
  • Type format document to format the file you’re working on.

You don’t have to remember where a feature hides in the menus. The Command Palette also shows the keyboard shortcut next to each command, so it’s a good way to learn them.

The Sidebar

The narrow strip of icons on the far left is officially called the activity bar. Each icon opens a view in the side bar next to it. Click an icon again to hide the side bar and give your code more room. These are the views you’ll use most:

The VSCode activity bar: Explorer, Search, Source Control, Run and Debug, Extensions and Testing
VSCode activity bar icons
  • Explorer shows the files and folders in your project. I’ll go into more detail below.
  • Search searches for text in all the files in your workspace, and can replace it too.
  • Source Control is VSCode’s interface to Git. You can see what you changed, commit your changes, and push them to a remote repository. That can be GitHub, but also GitLab, Bitbucket, or your own server. You don’t need it while you’re learning, but it’s worth getting to know later.
  • Run and Debug lets you start your program in the debugger and see variables, the call stack, and breakpoints while it runs.
  • Extensions shows your installed extensions and lets you find new ones. If you haven’t done so already, make sure you have the essential VSCode extensions for Python installed.
  • Testing appears once you have the Python extension. It finds and runs your tests, for example ones written with pytest.
  • Python Environments also comes with the Python extension. It shows your Python installations and virtual environments and the packages installed in them.

Other extensions can add their own icons here, so your activity bar may look a little different from mine.

Explorer

The VSCode Explorer with a Python project folder, its .venv and several .py files
The explorer panel

The explorer lets you create, rename, move, and delete files and folders. The buttons at the top let you create a new file, create a new folder, refresh the view, and collapse all folders at once. That last one helps when your project grows and you have a lot of folders open.

Below the file tree, you’ll find the Outline, which lists the functions and classes in the current file, and the Timeline, which shows the history of a file. You can click an item in the outline to jump straight to it.

The New File button at the top of the VSCode Explorer, with its tooltip

When you create a file, give it the right extension. Files ending in .py contain Python code, .csv files contain comma-separated data, and .html files are webpages. VSCode recognizes the type from the extension and shows a matching icon in the explorer, which gives you visual cues to quickly find what you’re looking for. It also uses the extension to decide how to highlight your code.

Debug Console and Terminal Window

The window at the bottom is called the panel. It has several tabs: Problems, Output, Debug Console, Terminal, and Ports. Open or close it with Ctrl+J (Cmd+J on a Mac).

You’ll use the Terminal tab the most. Having a terminal inside your editor saves time and clicking. If you want to navigate to other directories, install packages, or run a script, that’s typically done through the terminal. If you selected a virtual environment for your project, VSCode activates it in new terminals for you.

The VSCode terminal panel after running python3 shapes.py

Running a script from the terminal is simple. Let’s say you have a script called hello.py in your project folder. To run it, type this in the terminal:

python3 hello.pyCode language: Python (python)

On Windows, use python hello.py or py hello.py instead. If you’re not sure which command works on your system, read how to open Python.

You can also run a file in a different folder by typing the path to the file. If the path has spaces in it, put the whole path in quotes. Without quotes, the terminal splits the path at the space, and Python tries to open a file that doesn’t exist:

$ python3 My Projects/hello.py
... can't open file '.../My': [Errno 2] No such file or directory
$ python3 "My Projects/hello.py"
Hello from a Python file!Code language: Python (python)
A Python error in the VSCode terminal: the path with a space fails, the quoted path works

The terminal is also where you’ll see errors from your code, as shown above. The traceback shows you what went wrong and on which line.

The Problems tab listing a missing parenthesis, found by Pylance and Ruff

My favorite tab in this panel is simply called “Problems.” It lists the errors and warnings in your open files, found by Pylance and by linters like Ruff, before you even run your code. Here, it shows a syntax error caused by a missing parenthesis. Click a problem to jump to the line where it is.

The Document Editor

Python code with syntax highlighting in the VSCode editor

Look at all those pretty colors! VSCode highlights different parts of your code in different colors. Keywords like import, for, and if get one color, strings another, and so on. Once you’re used to it, this helps you read code faster and spot mistakes like a string you forgot to close. The exact colors depend on the theme you use.

On the right side of the editor, you’ll see a miniature version of your file, called the minimap. You can click or drag it to scroll through long files. Lines with errors and warnings are marked in it, so you can spot them without scrolling through hundreds of lines.

Two Python files open side by side in a split VSCode editor

You can open as many files as you like, each in its own tab. To see two files next to each other, click the split editor button in the top right of the editor, or drag a tab to the side. Each side scrolls on its own.

Next to the split button, you’ll find a play button when a Python file is open. It runs the current file. You can read more about it in the next article on running and debugging your code in VSCode.

The status bar and your Python interpreter

The bar at the very bottom of the window is the status bar. It shows things like the current line and column, the file’s encoding, and the language mode. On the left, it shows the Git branch you’re on and the number of errors and warnings.

When you have a Python file open, the status bar also shows which Python VSCode is using, for example 3.15.2 (.venv). This matters: VSCode runs your code, and looks up installed packages, with this interpreter. Click it to choose another Python installation or a virtual environment. If your project has a .venv folder, VSCode usually picks it up automatically. If you see import errors for a package you’re sure you installed, check this first.

Finding and squashing bugs

To run your script in the debugger, open the Run and Debug view in the activity bar and click Run and Debug, or press F5. You’ll see a small toolbar at the top with buttons to pause, continue, step through your code, and stop. The status bar changes color to show that a debug session is running.

VSCode paused at a breakpoint in debug mode, with the debug toolbar, variables and call stack
Debugging software with VSCode

Running in the debugger doesn’t make your code check itself for errors. What it does is give you control. You can set breakpoints by clicking in the margin to the left of a line number. When the program reaches that line, it pauses. If your program raises an exception that isn’t handled, the debugger also pauses right on the line where it happened and shows you the error, as you can see below.

The VSCode debugger stopped on the line that raised a ZeroDivisionError
VSCode highlighting an error in your code

Once paused, you can step through your code line by line. This gives you the opportunity to inspect the current state of variables and objects as your code is running. It’s a powerful way to squash those hard-to-find bugs and get a better understanding of what’s happening.

For a more thorough dive into running and debugging Python code in VSCode, just continue reading the next article.

Special thanks to Zach Goreczny for contributing to this article. Do you want to contribute to Python Land too? Please contact us.

Related articles

3 thoughts on “VSCode GUI tour: Explore The Elements of This Powerful IDE”

    • No, I meant the extensions listed on the linked page. But the Python extension pack is certainly a good choice and includes those that I mention in the article (like Python Linter) and some that you might not need if you don’t do web development, like Django and Jinja.

Leave a Comment