Setting Up Your Development Environment - Start with WSL

Prerequisites to many in- and out-of-class activities, specifically for students running Windows.

There’s a lot to install and setup. In total it may take close to an hour.

Overview

To try to establish a common development environment, we’d like students running Windows on their computer to install the Windows Subsystem for Linux (WSL). Almost certainly these days you’ll actually be using WSL2. Per Microsoft,

WSL 2 uses virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine (VM). Linux distributions run as isolated containers inside of the WSL 2 managed VM.

tl;dr

Dillon & Dutch Epic Handshake
🏆 In our tests this means that you can use the same command line and and other development tools as your Linux and MacOS classmates! 🙌

Install

  1. Follow the steps at https://learn.microsoft.com/en-us/windows/wsl/setup/environment
    • In doing these steps, you will have to create a user for your WSL instance. This user is separate from your windows user. You will need to remember the username and password you create here.

Files

Made this video because I thought I was maybe unclear in this section.
  1. The files you work with in WSL will be in a filesystem that the rest of Windows will find at \\wsl$\Ubuntu\home\<the username you created during the WSL install process>.
  2. Consider making a directory in that location called dev and doing all of your work for this course in subdirectories of that directory. This will make it easier to find your work later.
    • so the dev directory’s full path will be \\wsl$\Ubuntu\home\<your_user>\dev

Terminal

For your command line interface (CLI), it is probably best that you use Windows Terminal (click here to install it if you don’t have it already).

Windows Terminal can launch many different “shells”. Typically for our class work, you’ll want to use the Ubuntu shell. You can launch it from the drop down menu in the Windows Terminal tab bar.

Windows Terminal Window Behavior

  • in many Terminal apps (Windows Terminal included), you can paste text into the terminal by right-clicking. Unlike the usual behavior in Windows, including in its own predecessors to the Windows Terminal, right-clicking does not open the context menu. It just pastes immediately.
  • unlike many linux shells, highlighting text in Windows Terminal does not automatically copy it. You must use Ctrl+c to copy text.
    • so then ctrl+c is overloaded in the Ubuntu shell running in Windows Terminal:
      • if you have text selected, it copies the text
      • if you have no text selected, it behaves like many other (e.g. Linux) shells and sends the ctrl+c signal to the shell, which is the signal to cancel the current process.

VSCode

Install VSCode as directed on the Microsoft WSL VSCode page, except:

When you open certain directories with VS Code, it may ask if you trust all authors of the code in the directory you’re opening. For the simple cases in our class, it’s probably best to say yes, so that … code in your project folder can be executed by VS Code and extensions without your explicit approval.

Random Other Windows Trivia

Software

  1. Open Broadcaster Software (OBS) is great for streaming or screen recording.
  2. Clipboard history
    • omfg, i can’t believe it’s finally built in now y’all. Back in my day we had to trust a third party for this, y’all don’t know how good you have it!

Hotkeys

So in the video I mentioned some hotkeys… here’s the ones I mentioned there or that I remembered later to add to this list after using them in class.

Open Explorer (a file/folder browsing jobber)
Win+E
Put caret in address bar (keeping hands on the keys, focus the address bar of the currently focused app, e.g. the aforementioned Windows Explorer, Firefox, etc.)
Ctrl+L
Show the Desktop
Win+D
Open Task Manager
Ctrl+Shift+Esc
Switch between open windows
Alt+Tab