Scott Hanselman

Taking your PowerShell prompt to the next level with Windows Terminal and Oh my Posh 3

December 17, 2020 Comment on this post [50] Posted in Musings
Sponsored By

I love my pretty prompt that I use with Windows Terminal and Powershell. I also like using PSReadline to bring even more cool features to the CLI (Command Line Interface).

One of the best and easiest ways to get an awesome looking prompt on Windows is with Oh My Posh, and there's now Oh My Posh 3! Now, to be clear, you get to be pretty extra with these prompts and some people find them to be a turn off if there's too much bling. Remember: It's your prompt and you are in control. It's totally configurable - so configure it!

What do you need to start?

  • Windows Terminal
  • A super charged Cascadia Code font.
  • PowerShell (works on Windows, Linux, and Mac and is open source) and Oh my Posh
    • Now, to be clear, you can use Oh My Posh on zsh, bash, fish, nu and other shells also, but I like PowerShell as my main shell.

Let's upgrade my Oh My Posh installation to Oh My Posh 3 and see what's new and changed, shall we?

Here's my current prompt:

There's an upgrading section in the docs, if you are going from an existing installation of Oh My Posh to v3. Let's check it out.

Looks like I just need to do this:

Update-Module -Name oh-my-posh -AllowPrerelease -Scope CurrentUser

That's...suspiciously...not difficult. Now, just add this text to your $profile (again, there are instructions for other prompts).

NOTE: Be sure to make sure that your paths are correct. The example assumes a c:\tools folder AND it assumes you have a ~\.poshthemes folder. Change those paths however you want, but if it doesn't work, it's likely a pathing issue.

Here's a clever feature, you can call "Get-PoshThemes" and see a PREVIEW of different prompt themes and pick one!

Get-PoshThemes

Hey that "jandedobbeleer" font is as extra as I am. I like it.

Set-PoshPrompt -Theme jandedobbeleer

The fun stuff is where you can add things like your current Azure subscruption, or your current kubectl, or even YouTube music. I like the dotnet option. Let me see how to change that.

There is an OhMyPosh executable you can get that will print your current config that you can then modify. Download the right version of that and put it in your PATH somewhere. I put mine in my sync'ed d:\dropbox\utils which makes it available on any machine, but that's just me.

NOTE: If it's a new release of OhMyPosh, it may not have built up reputation without a code signing cert, but ignore that for now. I submitted it as safe in smartscreen and you can too if you like.

I will get the current config and put it in the clipboard, then paste it into VS Code and modify it.

posh-windows-amd64.exe -print-config 

Unicode! Note that you may not be able to | pipe this to clip.exe or > to a file as there's fancy Unicode in there and your shell may mangle the glyphs. I ended up copying the JSON manually directly by selecting it in Windows Terminal. You can also do this to get the json file

Write-PoshTheme | Out-File -FilePath ~/.go-my-posh.json -Encoding oem

If you want to copy in your own fancy glyph, use charmap.exe to copy the one you want. There's lots of choices in nerdfonts.

Charmap

Pretty fancy! I've got the path, my git, and the current .NET Core SDK version in that path, as well as a heartbeat of the current CLI error code.

My new OhMyPosh prompt

I've uploaded my ohmyposhv3.json as a Gist on GitHub. Next I think I'll look into how to make my own custom segment and make a Nightscout Blood Sugar segment and show my blood sugar in real time as I used to.


Sponsor: Have you tried developing in Rider yet? This fast and feature-rich cross-platform IDE improves your code for .NET, ASP.NET, .NET Core, Xamarin, and Unity applications on Windows, Mac, and Linux.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
December 23, 2020 4:58
I am currently using the same theme as your 'current' prompt... don't see any benefits of 'upgrading' to this new one though..
December 23, 2020 5:08
It’s a few things. Much easier configuration and new things like a node or dotnet version in the prompt.
December 24, 2020 11:50
Thx what exactly do I have to add to my profile(just add this text to your $profile), the link posts to the general install section.

Thx in advance
December 24, 2020 19:04
Thanks for these posts! I just recently went through your other blog post to beautify my Windows Terminal. Will check this out too.

P.S. Seems like you have a lot of spammers/bots on your Comments section.
December 24, 2020 23:53
Jane Harris to prezenterka lokalnej telewizji.
December 25, 2020 0:19
Evidentemente queremos que te quedes mucho tiempo con nosotros,
pero si deseas irte, sólo tienes que avisarnos que
incluye 30 días de antelación.
December 25, 2020 0:40
Call us any time you need assistance. Jak mi się podobało?
December 25, 2020 1:20
Czy nasi bohaterowie przetrwają tą podróż?
December 25, 2020 1:46
Dobra już nie przedłużam, zapraszam do oglądania.
December 25, 2020 2:40
Podsumowując, czy mi się podobało? Czy polecam?
December 25, 2020 3:09
Tego to już musicie dowiedzieć się sami.
December 25, 2020 4:33
Poszukuje gry, może ktoś tutaj mi pomoże.
December 25, 2020 5:14
Grubas, jakiś murzyn, babka i ktoś tam jeszcze.
December 25, 2020 5:57
Thank you, I have recently been searching for info approximately this topic for a
while and yours is the best I have found
out till now. However, what in regards to the conclusion? Are you certain concerning the supply? https://vanzari-parbrize.ro/lunete/lunete-maserati.html
December 25, 2020 6:27
Alexander Bain, Scottish clockmaker, patented the electric
clock in 1840.
December 25, 2020 6:36
Grubas, jakiś murzyn, babka i ktoś tam jeszcze.
December 25, 2020 7:52
Poszukuje gry, może ktoś tutaj mi pomoże.
December 25, 2020 10:31
So, from time to time when a plumber visits your constructing.
December 25, 2020 10:31
Yesterday, while I was at work, my sister stole my apple ipad and tested to see if it can survive a forty foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83 views. I know this is completely off topic but I had to share it with someone!

Would You my webpage; judi Slot
December 25, 2020 10:31
Yesterday, while I was at work, my sister stole my apple ipad and tested to see if it can survive a forty foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83 views. I know this is completely off topic but I had to share it with someone!

Would You my webpage; judi Slot
December 25, 2020 11:54
Which mean that they'll restore any plumbing system.
December 25, 2020 12:17
Wonderful blog! I found it while browsing on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Thank you

Would You My web-site :: Game Slot Online0
December 25, 2020 12:45
Tak, to horror, także nie denerwujcie się.
December 25, 2020 14:49
Teraz czas, żebym powiedział coś samym filmie.
December 25, 2020 16:50
This site was... how ddo I saүy it? Releѵant!!
Fіnally I've found ѕomething which helped me.

Thank you! Pⅼease visit us if you love casino online Winn
Big Bonus Coin365thb CASINO ONLINE BᎪCCARAT DRAGONTIGER SICBO ROULEƬᎢE SLOThttps://fafa191th.com/th/cock-lobby
December 25, 2020 20:31
Hello.This article was really remarkable, especially since I was browsing for thoughts on this subject last Thursday.
December 25, 2020 20:31
Hello.This article was really remarkable, especially since I was browsing for thoughts on this subject last Thursday.
December 26, 2020 1:50
Highly descriptive post, I loved that bit. Will there be a part 2?
December 26, 2020 1:50
Highly descriptive post, I loved that bit. Will there be a part 2?
December 26, 2020 7:40
My partner and I absolutely love your blog and find a lot of your post's to be just what I'm looking for. can you offer guest writers to write content in your case? I wouldn't mind composing a post or elaborating on some of the subjects you write about here. Again, awesome web log!
December 26, 2020 7:40
My partner and I absolutely love your blog and find a lot of your post's to be just what I'm looking for. can you offer guest writers to write content in your case? I wouldn't mind composing a post or elaborating on some of the subjects you write about here. Again, awesome web log!
December 26, 2020 10:01
Hi colleagues, good article and fastidious arguments commented at this place, I am actually enjoying by these.
December 26, 2020 10:01
Hi colleagues, good article and fastidious arguments commented at this place, I am actually enjoying by these.
December 26, 2020 10:17
Thanks a bunch for sharing this with all folks you actually recognize what you are speaking about! Bookmarked. Kindly additionally talk over with my site =). We can have a link exchange agreement among us
December 26, 2020 10:17
Thanks a bunch for sharing this with all folks you actually recognize what you are speaking about! Bookmarked. Kindly additionally talk over with my site =). We can have a link exchange agreement among us
December 26, 2020 10:58
Jane Harris to prezenterka lokalnej telewizji.
December 26, 2020 11:45
Very good blog! Do you have any hints for aspiring writers? I'm planning to start my own website soon but I'm a little lost on everything. Would you advise starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I'm completely overwhelmed .. Any tips? Bless you!
December 26, 2020 11:45
Very good blog! Do you have any hints for aspiring writers? I'm planning to start my own website soon but I'm a little lost on everything. Would you advise starting with a free platform like Wordpress or go for a paid option? There are so many choices out there that I'm completely overwhelmed .. Any tips? Bless you!
December 26, 2020 12:03
I loved as much as you'll receive carried out right here.

The sketch is attractive, your authored material stylish.
nonetheless, you command get bought an nervousness over that you wish be
delivering the following. unwell unquestionably come
further formerly again as exactly the same nearly a
lot often inside case you shield this hike.
December 26, 2020 12:48
I was recommended this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You're wonderful! Thanks!
December 26, 2020 12:48
I was recommended this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You're wonderful! Thanks!
December 26, 2020 12:52
Highly energetic post, I loved that a lot. Will there be a part 2?
December 26, 2020 12:52
Highly energetic post, I loved that a lot. Will there be a part 2?
December 26, 2020 15:08
Poszukuje gry, może ktoś tutaj mi pomoże.
December 26, 2020 15:41
each time i used to read smaller articles that also clear their motive, and that is also happening with this article which I am reading at this time.
December 26, 2020 15:41
each time i used to read smaller articles that also clear their motive, and that is also happening with this article which I am reading at this time.
December 26, 2020 17:10
Superb blog! Do you have any tips and hints for aspiring writers? I'm planning to start my own blog soon but I'm a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I'm totally confused .. Any suggestions? Bless you!
December 26, 2020 17:10
Superb blog! Do you have any tips and hints for aspiring writers? I'm planning to start my own blog soon but I'm a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I'm totally confused .. Any suggestions? Bless you!
December 26, 2020 21:00
Great post.
December 26, 2020 21:00
Great post.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.