An introduction to the VS Code editor

Week 2 – Lecture C

Presented on

September 2, 2026

Page last modified

September 4, 2026



1 What is VS Code?

As a brief intermezzo, let’s take a look at VS Code, the fancy text editor you’ll use throughout the course to write code and documentation. Its full name is Visual Studio Code, while the version you can use in your browser at OSC is called “Code Server”.

To emphasize the additional functionality relative to basic text editors like Notepad and TextEdit, editors like VS Code are also referred to as IDEs: Integrated Development Environments. The RStudio program is another good example of an IDE. Just like RStudio is an IDE for R, VS Code will be our IDE for the Unix shell and Markdown1.

2 Starting VS Code at OSC

  1. Log in to OSC’s OnDemand portal at https://ondemand.osc.edu. Already done during the OSC intro.

  2. In the blue top bar, select Interactive Apps and near the bottom of the dropdown menu, click Code Server. Already done during the OSC intro.

  3. Fill out the form to start a VS Code session. This is needed because Interactive Apps like VS Code run on compute nodes rather than login nodes, and compute nodes always need to be “reserved”.

    • The Cluster we want to use: pitzer
    • The Account, the OSC Project to be billed for the compute node usage: PAS3493
    • The Number of hours we want to make a reservation for: 2
    • The Working Directory (starting location — replace <user> with your OSC username): /fs/ess/PAS3493/people/<user>
    • The App Code Server version: 4.8.3 (this should be the only available option) Edit 2026-09-04: A newer version, 4.129.0, is now available: select this version instead.

    When selecting the Working Directory, ignore the “Select Path” button in this case. This is an alternative to typing the path in the text box, not a way to confirm the path you already typed.

A screenshot of the OSC OnDemand form to start a Code Server job.

Here’s what the filled-out form should look like, except that you want to point it to your personal folder.
  1. Click Launch and you’ll be sent to the My Interactive Sessions page with a card for your job at the top.

  2. Your job may initially be Queued for some seconds (i.e., waiting for computing resources to be assigned to it), but it should soon switch to Starting and then be ready to use (Running) in another couple of seconds:

A screenshot of the OSC OnDemand page shown when the Code Server job has started running.

  1. Once the blue Connect to VS Code button appears, click it to open VS Code in a new browser tab.

  2. When VS Code opens, you may get a pop-up similar to this — check the box and click “Yes”:

    A screenshot of a popup you may get when first opening a folder in VS Code.

TipCongratulations: you have started your first compute job at OSC!   🥳

3 The VS Code user interface

3.1 The Primary Side Bar (wide)

The Primary Side Bar (wide side bar) shows a file explorer by default, where you can see files, create new folders and files, and so on.

If you’re in the correct location, you should see just two entries in the file explorer: the week02 and week03 folders you created in the previous session. If that’s not what you see, the box below will tell you how you can switch to your personal folder.

(Your OSC username should be printed above that, not because it knows who you are, but because that’s the name of the folder you are in.)

3.2 The Activity Bar (narrow)

The Activity Bar (narrow side bar) on the far left has, from top to bottom:

  • A (“hamburger menu”), with menu items like File — the kind you often find in a program’s top bar.

  • Icons such as to switch what the wide Side Bar shows: we’ll talk about those in a later session.

  • A circled user icon that we’ll also ignore for now.

  • A (cog wheel icon) at the bottom, with access to:

    • Settings, where you can configure VS Code.
    • “Command Palette”, a search bar to find and run all VS Code functionality.

Your Turn

The screenshots on the right show the VS Code interface with the “Light (Visual Studio)” color theme, but the default is a dark theme. Themes are a matter of personal preference, so feel free to pick one you like.

In the cog wheel menu, click Themes > Color Theme to explore the options and optionally change your theme.

A screenshot of the VS Code file explorer, showing a personal folder with the week02 and week03 subfolders.

The narrow black bar is the Activity Bar, and the rest of the screenshot shows the Primary Side Bar.

A screenshot of the VS Code cog wheel menu, showing the Settings and Command Palette options.

The menu that pops up when you click the cog wheel in the bottom of the Activity Bar.

TipA folder as a starting point

VS Code takes a specific folder as a starting point in all parts of the program, including its file explorer and the Unix shell in its terminal. You selected this folder when you started your VS Code session at OSC.

Generally speaking, if you’re not in the folder you want to work in, you should switch to the correct folder before continuing. For information on how to switch to a different folder, see the box below.

If there was a problem with the Working Directory you selected when starting your VS Code session, you may have ended up in your Home dir instead (recall that this is /users/<project>/<user>). You can confirm this by looking at your browser’s address bar, which has the folder path at the end:

A screenshot of the browser address bar, showing the current folder path at the end of the URL.

If you instead see a path that starts with /users/, then you can switch to your personal folder from within VS Code:

  1. Click > File > Open Folder.
  2. Enter the correct path /fs/ess/PAS3493/people/<user>, replacing <user> with your OSC username.
  3. This will cause the program to reload.

3.3 Terminal (with a Unix shell)

Open a terminal by clicking > Terminal > New Terminal. A whole new panel will appear at the bottom of the window, with a Terminal tab. We’ll start using this in the next lecture.

A screenshot of the VS Code interface with a terminal open at the bottom.

The VS Code window with a terminal open at the bottom. The editor pane above shows the Get Started document.

TipResizing panes

You can resize panes by hovering your cursor over the borders between them and then dragging. Try doing this with the border between the Primary Side Bar and the editor pane, and that between the panel with the terminal and the editor pane.

3.4 Editor pane and “Get Started” document

The main part of VS Code is the editor pane. Here, you can open scripts and other types of text files, images, and so on. Like in a web browser and other modern editors, you can have multiple tabs open.

Whenever you open VS Code, an editor tab with a “Get Started” document is automatically opened. This provides some help and shortcuts to recently opened files and folders.

Let’s create a new file and save it as a Markdown file, for the next lecture:

  1. Open a new file by clicking > File > New Text File2.

  2. The file will be called “Untitled-1” and will contain some “ghost text” you can ignore:

A screenshot of an empty VS Code file.

  1. Before typing anything, save the file: press Ctrl/⌘+S (i.e., the common “Save” shortcut you are likely familiar with) and save it within your week02 dir as 2d_markdown.md.

A screenshot of a new Markdown file in VS Code.

  1. Because you saved it with the .md extension, VS Code will recognize it as a Markdown file, hence the Markdown icon (downward arrow) in the tab.


Back to top

Footnotes

  1. Some advantages of VS Code: it works with all operating systems; it is free and open source; it has an integrated terminal with a Unix shell; it is available at OSC OnDemand; and it is very popular and heavily developed.↩︎

  2. Or you can click the “New File” icon in the Get Started tab, then select Text File.↩︎