How to make the ultimate Terminal Prompt on Windows 11 - This video is LONG and WORDY and DETAILED
synopsis
Hanselman rebuilds his own terminal setup, the one viewers asked about in an earlier video, on a fresh Surface Laptop Studio. He ends with Windows Terminal running PowerShell 7 and Ubuntu under a customized Oh My Posh prompt, with icons, predictive history and a few hotkeys. He deliberately leaves the mistakes in. His argument is that doing it slowly by hand teaches you how to fix it, which a script would not.
Setup. Only Visual Studio and VS Code are installed. He adds ZoomIt for on-screen annotation, sets Windows Terminal as the default terminal application so cmd opens inside it, and installs PowerShell 7.1.4 from the Store. He makes it the default profile and hides Windows PowerShell. wsl --install showed WSL already enabled, and Ubuntu came from the Store as Canonical's own package. A starting-directory setting failed to drop him in home, so he switched the profile's command line to wsl ~.
Fonts. He installs Cascadia Cove, the Nerd Fonts variant of Cascadia Code that carries icon glyphs. He leaves the prompt broken first to show the empty squares. VS Code's integrated terminal needed its own font setting, and it took an exact family name and a reload.
Oh My Posh. Installed with winget, it is an executable that prints the prompt, so the shell profile has to call it. His first try left the profile unchanged because the command he ran wrote a local config file. He admits he had not read the manual. He swaps in his own theme from his gists and explains its segments: path, git status, .NET version and an error-level heart. Then he moves the file to a stable folder after finding theme files duplicated across locations.
Profile. He adds Terminal-Icons, then pastes his long profile from a gist and comments out what he no longer needs. PSReadLine's list-view predictions failed until he installed the 2.2 beta with prerelease allowed. He adds z for jumping to visited folders, Ctrl+R history search, and a Ctrl+Shift+B handler that types dotnet build. The acrylic tab row turned out to be a Terminal Preview feature.
Left to the viewer. He sets an exercise: install Oh My Posh in Ubuntu's bash, reuse the same theme JSON, and get the same prompt on both sides. He says that is how his earlier video looked the same everywhere.
- Build the prompt by hand, mistakes included, to learn the pieces. Hanselman sets up a brand-new Surface Laptop Studio unedited and refuses to hand out a script, so that viewers see what breaks and how to fix it. He separates three layers: the shell, the prompt it prints, and the terminal that paints the text.
- Make Windows Terminal and PowerShell 7 the defaults first. He sets Windows Terminal as the default terminal application, so Win+R
cmdopens there instead of the old console host. He installs PowerShell 7.1.4 from the Store, makes it the default profile and hides Windows PowerShell. He then adds WSL and Ubuntu (about 500 MB, published by Canonical), and launches the Ubuntu profile withwsl ~after a starting-directory setting failed to land in home. - Prompt glyphs need a Nerd Font everywhere the prompt renders. Before he switches to Cascadia Cove from nerdfonts.com, the prompt shows empty squares. He sets the font in Terminal and separately in VS Code's integrated terminal, where the font name had to match exactly and the editor needed a reload before it took.
- Oh My Posh is just an executable that prints the prompt. He installs it with winget and adds an init line to the PowerShell profile. He admits his first attempt failed because he "didn't RTFM", and the command wrote a local config instead of editing the profile. His theme from his gists has segments for path, git, .NET (version 6 here) and a heart that turns red when the last command fails. He keeps the theme in a stable folder after finding the default themes in more than one place.
- Profile add-ons make PowerShell behave more like bash. He adds Terminal-Icons from the PowerShell Gallery, PSReadLine predictions,
zas a learning replacement forcd, Ctrl+R history search, and Ctrl+Shift+B to insertdotnet build. The list-view prediction style needed PSReadLine 2.2 beta 1 rather than 2.1, which he says goes in his notes. An acrylic tab row was then available only in Windows Terminal Preview.