The Windows Command-Line: Windows Terminal & WSL 2 (SK135)

Kayla Cinnamon and Craig Loewen

  1. Windows Terminal
    1. Version 1.0 has shipped!
    2. Links
      1. Windows Store:
        1. Stable channel with monthly releases.
        2. First update after v1.0 scheduled for July 2020.
      2. Windows Terminal Preview in the Store:
        1. First update scheduled for June 2020.
      3. GitHub Repo:
      4. Blog:
      5. Docs:
    3. Demo
      1. You can tell that the application for PowerShell and cmd.exe are the same by examining their property pages.
      2. People wanted tabs, panes, background colors, background images, more fonts, etc.
      3. Will render Unicode and UTF-8 which allows for foreign languages, emoji, etc.
      4. Backward compatibility prevented this for the old application hosting cmd.exe and PowerShell.
      5. Windows Terminal dynamically detects your WSL distros and adds entries for them to your profile list.
      6. Add any settings that you want to apply to all of your profiles to the "defaults" section of settings.json.
      7. She showed her “Build” color scheme.
    4. Keyboard Shortcuts (Default)
      1. Ctrl+Shift+T: Open a new tab with your default profile.
      2. Ctrl+Shift+n: Open a new tab with profile # n.
      3. Ctrl+Shift+F: Find text in the window.
      4. Ctrl+,: Open settings.json in your default JSON editor.
      5. Alt+Settings: Show global settings (defaults.json).
      6. Alt+Shift+D: Open a new pane (i.e. Duplicate).
      7. Ctrl+Shift+W: Close the current pane or the entire Terminal if only one pane is present.
    5. Command-Line Parameters
      1. wt -h or wt --help: Display command-line parameters.
      2. wt -d . : Opens a new Windows Terminal in the current directory
      3. cmd.exe: wt -d . ; split-pane -p "Windows PowerShell" -H
      4. PowerShell: wt -d . `; split-pane -p "Windows PowerShell" -H
    6. Experimental Features
      1. Add the following line to your settings.json file.
      2. "experimental.retroTerminalEffect": true
      3. I had to open a new cmd.exe tab in order to see this take effect.
      4. Kayla used the PxPlus IBM VGA8 font with the retro effect.
    7. Customize Your Color Schemes
      2. More sample themes:
      3. Also see the Terminal team’s ColorTool to apply color schemes.
    8. What’s Next
      1. Color Picker for your tabs.
      2. Rename tabs.
      3. Settings UI (not coming in June).
  2. WSL (Windows Subsystem for Linux) 2
    1. Access all of your Windows files directly from the Linux environment.
    2. Run Windows executables from a bash (or other) shell.
    3. You can also go the other way:
      1. Access Linux files from Windows.
      2. Invoke Linux binaries from Windows.
    4. Includes a real Linux kernel built by Microsoft.
    5. Running in a lightweight VM.
    6. WSL 2 is typically 3-6x faster than WSL 1.
    7. Docker Desktop client for Windows can now use WSL 2.
    8. VS Code Remote will build Linux apps from a Windows UI.
    9. WSL 2 provides File Explorer integration to your Linux file system.
      1. Each distro looks like another folder.
    10. wsl --installenables all required optional components.
      1. Requires a reboot.
      2. Then it will install your specified distro.
    11. GPU compute is the # 1 requested feature and will be coming to WSL in the future.
      1. Enables parallel computing.
      2. Much faster on a GPU than a CPU.
      3. Machine Learning and AI development both benefit.
      4. Image filtering is just matrix math.
      5. For example, AI determines that the user drew the number 2.
      6. nVidia Drive Net demo.
        1. Analyze images to find where people and cars are.
      7. Training Data -> ML Algorithm -> Trained Model
      8. The ML Algorithm depends on an ML Framework.
      9. Framework could be TensorFlow or pyTorch.
      10. Those depend on hardware acceleration APIs like CUDA or DirectML.
        1. For DirectML, it can leverage any DirectX 12 GPU.
        2. This is great for students who may not have nVidia CUDA graphics cards.
      11. Those APIs call into the GPU on your machine.
      12. The WSL team has changed the Hardware Acceleration API layer.
      13. They have partnered with hardware vendors like nVidia, AMD, and Intel. 
      14. They have provided drivers that are aware of WSL.
      15. The team has also made changes internally to WSL and to the Microsoft Linux kernel to make this possible.
      16. Make sure you have WSL installed:
      17. Install the right driver for your GPU.
        1. Instructions will be available when these changes are released to Windows Insiders.
      18. Run your Linux ML workflows inside of WSL!
        1. Open your WSL distro, git clone your project, and get started.
    12. GPU Demo
      1. He has a folder with SqueezeNet.
      2. It’s a popular image recognition neural network.
      3. He can run Python to train it.
      4. You can see the GPU being used (actually spiking) in Task Manager, Performance tab.
      5. You can run these workflows across different GPU vendors!
    13. What’s Next for WSL?
      1. wsl.exe --install to allow one command installations will be available in the next few months.
      2. GPU Compute in WSL will be available in the next few months.
      3. GUI application support in WSL will be available, but not in the next few months.
    14. Demo of GUI Application Support
      1. In one command window, he’s got the Wayland Compositor running.
        1. Running a Wayland server inside of Linux and connecting this to an RDP client on the Windows host machine.
        2. wlwsld --debug --wl-debug
      2. In the other, SpaceInvadersDeepQLearning.
        1. He switched into the media folder.
        2. Ran eog, eye of gnome.
        3. Then he restarted the Wayland server, moved up a directory, and ran gedit.
        4. Then he restarted the Wayland server again and ran mpv file.mp4 to really put it through its paces, i.e. playing a video file.
    15. Links
      1. Twitter: @craigaloewen
      2. WSL Github:
      3. WSL Docs: