Windows Terminal with Tabs, on Steroids

PowerShell Cmdline Emojis Windows 10 Tabbed Terminal

At Microsoft Build last week, one of the many announcements was a new Windows Terminal.

If you spend anytime as an IT Support Person/ DevOps type role and you checkout that second link above you’ll be mightily keen for this new Terminal.

Tabs in a Terminal Window YES (heck I remember paying for a product to provide that to me in a browser) 15+ years ago; a Terminal Window that is a standard command prompt (with Unicode Support) YES; a Terminal Window for cross platform, CMD, PowerShell, PowerShell Core, Windows Subsystem for Linux DAMN YES. And of course you don’t want to have to wait for this, you want it now.

So did I, so I built the Preview Alpha Release. This post details how I did it.

Windows 10 Tabbed Terminal with icons
Windows 10 Tabbed Terminal with icons

Prerequisites

There are a few hoops you need to jump through to get on this right now, as it isn’t available as a download. It will be coming to Windows 10 in a few months, but let’s get it now.

  • Become a Windows Insider by registering for a Windows Insider Account here
  • Have a Windows 10 v 1903 build (via registering for Windows Insiders above)
    • the process to do this I show below
  • Inside your Windows 10 machine you will then need;
    • Windows 10 SDK v 1903
    • Visual Studio 2017 (I use 2019)
      • Choose the following Workloads
        • Desktop Development with C++
        • Universal Windows Platform Development
        • For Visual Studio 2019, you’ll also need to install the “v141 Toolset” and “Visual C++ ATL for x86 and x64”
    • Git for Windows command-line

Windows 10 Test Machine Version 1903

I built a Windows 10 1709 Virtual Machine in Azure from the Azure MarketPlace. Having connected to it, I needed to enable the Windows Insider Program on it. To do that select;

Windows => Settings => Update & Security => Windows Insider Program => Get Started

Enable Windows Insider.PNG

Select Link an account and provide the account you used to sign up for Windows Insiders.

Link an Account.PNG

If, when you attempt to link an account you get a blank login window/page when being prompted for your Windows Insider Account you may need to make a couple of changes to the Windows 10 Local Security Policy Security Options. Below is the configuration of my test Windows Insider Windows 10 Virtual Machine. I’ve highlighted a few options I needed to update.

Local Security Policy.PNG

Select the Skip Ahead to the next Windows release to update Windows 10.

Skip ahead to the next Windows Release.PNG

If you are doing this like I am on a Windows 10 Virtual Machine in Azure, you’ll first go from build 1709 to 1803.

Windows 1709 to 1803.PNG

After Windows 10 has updated to 1803 log back in, go back to Windows Insider Program and chose Skip ahead to the next Windows release.

Skip ahead to the next Windows Release - 1903.PNG

Under Settings => Update & Security => Windows Update and select Check for Updates and you will see Windows 10 version 1903 become available.

1803 to 1903.PNG

Under Windows => Settings => Update & Security => Enable Developer Mode

Enable Developer Mode.PNG

Terminal Application

With the other dependencies detailed in the prerequisites above (Windows 10 1903 SDK, Visual Studio etc) downloaded and installed on your Windows 10 machine we can get on to the fun bit of building the new Terminal. Create a folder where you want to put the source to build the terminal and from a command prompt change directory into it and run the following commands;

Git clone https://github.com/microsoft/Terminal.git
cd Terminal
git submodule update --init --recursive

Git Clone.PNG

Then in Visual Studio select Open a project or solution and open the Terminal Visual Studio Solution. Select SDK Version 10.0.18362.0 and No Upgrade for the Platform Toolset

Open the Solution in VS -1.PNG

Select Release and x64 and then from the Build menu Build Solution.

Build Release x64.PNG Finally, right click on CascadiaPackage and select Deploy

Deploy.PNG

Terminal (Dev) will then be available through the Start Menu.

Windows Terminal Dev.PNG

Opening the Windows Terminal will give you a single Terminal Window. Press Cntrl + T to open an additional tab. 

Use the drop down menu to select Settings and you will be presented with the JSON configuration document. See (below under Icons for mine that enables CMD, PWSH, PowerShell, WSL – Ubuntu and WSL – Suse.

Icons

To have icons for your terminal tabs obtain some 32×32 pixel icons for your different terminals and drop them into the RoamingState directory under the Windows Terminal App. For me that is

C:\Users\darrenjrobinson\AppData\Local\Packages\WindowsTerminalDev_8wekyb3d8bbwe\RoamingState

Then update your profiles.json configuration file located in the same directory and add the name of the appropriate icon for each terminal.

Summary

As much as we use nice UI’s for a lot of what we do as Devs/IT Pro’s, there are still numerous tasks we perform using terminal shells. A tabbed experience for these complete with customisation brings them into the 21st century. Now the wait for another month or two to have it delivered as part of the next Windows 10 Build.

CIRCUITPY Volume not visible for an Adafruit Circuit Playground Express on Windows 10 1803

I’ve just returned from the US and whilst there I picked myself up an Adafruit Circuit Playground Express. I plugged it into my computer and by all reports it should just appear as a removable drive on Windows 10. Alas that didn’t happen for me. I could get it into BOOT mode by pressing the Reset switch, but no matter what I did I couldn’t get the expected CIRCUITPY volume to be visible in File Explorer. Here’s how I got it working along with configuring VSCode as the editor.

Prerequisites

  • Visual Studio Code
    • Python Extension (from Microsoft) for VSCode. Install through VSCode Extensions

Environment Configuration

    1. Install the Arduino IDE from the Microsoft Store
    2. Open VSCode and install the Arduino Extension (from Microsoft)
      • go to the Command Palette and open Preferences: Open User Settings
      • under Arduino: Pathadd the path to Arduino. It should be something like C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt depending on the version you have
      • under Arduino: Additional Urlsselect edit in settings.json and add the following line and save the file
        • “https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
      • Open the Command Palette and select Arduino Board Config. Select Adafruit Circuit Playground
    3. Verify that the Adafruit Circuit Playground board is showing in the VSCode system tray along with the COM port is using on your computer.
    4. Update the Bootloader
      • Currently the latest bootloader is available from here https://github.com/adafruit/uf2-samdx1/releases/latest
        • for Circuit Playground Express you are looking for the update-bootloader-circuitplay_m0-v2.0.0-adafruit.VERSION.uf2 file
      • Click the reset button (in the middle of the board) and you should see the CPLAYBOOT drive volume in your computer File Explorer
      • Drop the bootloader uf2 file onto the drive
    5. Update to the latest Circuit Python Release
      • That is available from here https://circuitpython.org/board/circuitplayground_express/
        • Currently that is v3.1.2
      • Drop the updated Circuit Python .u2f file onto the CPLAYBOOT volume
    6. Restore the Demo Python Script
      • The demo is available from here https://github.com/adafruit/Adafruit_Learning_System_Guides/raw/master/Introducing_CircuitPlaygroundExpress/CPXDemoContent.zip
      • Unzip the download and drop the demo script (main.py and *.wav files)  onto the CIRCUITPY volume
      • It will restart and go through the neopixel demo (with startup sound)
    7. Using VSCode open the main.py file from the CIRCUITPY volume
      • update the following line from False to True and save the file
        • TOUCH_PIANO =True

         

With that all done I was up and running.

Hopefully that helps someone else get quickly starting and avoid all the troubleshooting I went through to get up and running.