Customize the Windows Terminal with WSL2, Cascadia Code, Powerline, Nerd Fonts, Oh My Posh and more!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey friends I'm Scott Hanselman you may have seen my video on WSL 2 and how to get the Windows terminal and some of the new cool things happening with Linux on Windows in case you haven't please make sure to subscribe to my channel and check those things out because you can be running Linux on Windows as well now one of the things I want to talk about today is the the Windows terminal and how to make your command line prompt more interesting now this is not dependent on daus or PowerShell or a boon to or whatever this is just kind of generalized prompt love that you might want to give you a prompt you can see here in a boon - I've got my prompt with has the name of my computer and my username and then a path in my kind of dos I'm using a alternative shell called yori that you can get it's similar to command out exe except it gives you autocomplete so you can see that I'm typing like notepad and it gives me a dot exe that's called URI you can go check that out I'll put links in the descriptions but one of the things that I wanted to show you is that I'm using a custom font okay I'm using a custom font here called Cascadia code so let's go and take a look at my profiles so let's do this what I've done is I click this drop-down and I hit settings and that's going to open up profiles dot Jason and inside of that so you can see here that I've got the font face set to Cascadia code Cascadia code is a new font that Microsoft just released and you can actually go out and search for that and find Cascadia code and what you're gonna find is a github here that includes this new the source for this new font and you go and download it under release this is an open source font it was just released yesterday under an SI L open font license so the source code for it you can make your own as long as you don't name it Cascadia code and there's some issues and people have said that they like this about it they don't like that so you know it's a living breathing font it's pretty cool it's a mono spaced font it also includes a thing called ligatures that we're going to talk about so I go out to the command line here and I type some stuff here's what the font looks like right so if I do things like 1 and L or zero and oh and little oh you know I can see the difference of and how this is a programmers font it also includes a thing called ligatures so if I go and say - and then two hyphens and then three hyphens and then an arrow it looks like this but two hyphens look at that this got a ligature font so if I go like this and like that but now I put them together that's interesting or if I do this and this now it's one thing or even here's a weird one w-w-w look at that see how that turned into an interesting glyph that's called ligature so this is something that's included in Cass Cody and Cascadia code but one of the things that I want to do is bling out my prompt there's what I'd like to do is be able to go for example in PowerShell core or something like that over to my github folder and then this is get this is the source code for my website I'd like to see like what what branch I'm on and I'd like to see information about that I want my prompt to look cool here's the best way you can do it if you're using something like PowerShell what you can do is you go over and you can go to a place called oh my posh now oh my posh is a PowerShell system that is a theming engine now this is it's running in con emu but honestly any alternative console is great the Windows terminal can do it so even though this is a couple of years old originally and now is occasionally looked at every few months it works amazingly so I want my font to be blinged out and I want my promptly blinged out like this so here's what you gotta do it's very very simple again you can use con emu but I would recommend that you use the Windows terminal that you can go and download from the the store you just go and run install module you get posh kit from Keith Dobby and oh my posh from Yann and then you call these two things if you want to go and see it right away I also recommend PS read line which is a very specific version of PS read line so these three things install posh get installed oh my posh and install PS read line you'll notice that the scope is current user so you don't have to run this as administrator and then I want you to just go back out to your prompt and I'm gonna say notepad dollar sign profile use the text editor that makes you happy and at the bottom of that profile I'm gonna import the posh cute module I'm going to import well my posh then set a theme there's lots of different themes the theme that I'm gonna pick is one called paradox when I close that and then I close powershell core and I open it again I get an interesting prompt okay I look at this I'm gonna go over here to github and I'm gonna say hey look at that I can see that it's trying to do something and again lots of different choices you don't have to do this if you don't want it there's lots of themes and configuration and choices very very creative thing on my posh sits on top of posh get however that doesn't feel right this doesn't look right it's clearly trying to use a number of glyphs that I don't have okay Cascadia code by default today and its first release doesn't include power line glyphs and nerd fonts and different stuff that you might want to be able to make this stuff look cool in fact if you go up there to the Cascadia code github repository and you go and you search for nerd people are gonna go out hey quick already add power line symbols it's been asked for people want to do that well turns out you can go to nerd fonts calm there's lots of different developer fonts you can download not just Cascadia code but this video is about being custom so what we're gonna do is we're gonna patch Cascadia code on my machine make our own glyph we're going to basically add glyphs into Cascadia code so what you can do is download a thing called font forge now I'm running Ubuntu remember under WSL and again I have a video about that you can go and check my blog or you can google for it and what I can do is open up Lubuntu this is real loop going to running on Windows here I'm running boon - 1804 and what I did now there's a lots of ways you can do this if you want to download three or four gigs you can certainly go and get the clone the nerd fonts repository if that makes you happy but instead I just downloaded and installed font Forge with apt-get what you want from nerd fonts is this font patcher okay you can go and grab that font patcher by either installing it from here you can go and follow the instructions you just have to have python on your machine and you download the font patcher and the font patcher will go and take any font any TTFN or any kind of font you have and you can go and say i want to go and add fought awesome or these linux fonts or power line or whatever and when i add those myself okay very very simple it's just the font patcher the name of the font and then the stuff you want to do to it so what I'm going to do I'm going to run out here and I'm gonna run fought for words the font patch of script and notice that I'm in Ubuntu but I can talk to the mount point C Drive where I happen to download Cascadia and again I could say - font awesome but I'm gonna say - C for complete and look it's adding glyphs like this power line extra symbols since we generated that so now if I go and see LS TTF you can see I've got Cascadia nerd font complete okay I'm in a boon - so I'm gonna type explorer.exe dot ubuntu on windows is really cool because it lets you launch explorer so when I hit date modified in there it is Cascadian nerd font complete see how it's bigger it is went from 200 K to almost a megabyte double-click on that hit install all right so I've got Cascadia code nerd fought complete installed now let's go back over here I'm just going to hit windows left and then I'm gonna hit my profiles I'm gonna go in here I'm gonna say Cascadia code nerd font now make sure make sure that you double click now make sure that you double click on the font and you know it's actual name the name is not the file name that's the name I'm gonna change this for PowerShell core just gave you a code nerd font gonna remove the space boom do that again no space save it boom look at that look how nice that is let's go ahead and make that fullscreen now let's try another repository uh-huh that cool so what we've done is we've used our own custom font again you can do this with any monospaced font you go and use the nerd nerd fonts or just to be clear if you don't want to do any of this kind of work you can certainly go up to nerd fonts and they've done a wonderful service for us all and you can go and download your own nerd font so nerd fonts font downloads pick the one that makes you happy currently Cascadia code is not there yet and you can go and try that out so what I've done here is I've added posh kit I've added oh my posh and I've added a nice monospaced ligature font in the form of Cascadia code and then made that available to me in the terminal of course I'm hitting ctrl scroll which is really nice here and because I've got posh get I can also do things like get tab check out I can even see my branches with a tab which is very very nice so check that out and subscribe to this channel please
Info
Channel: Scott Hanselman
Views: 104,823
Rating: undefined out of 5
Keywords: windows10, terminal, open source, font, fontforge, nerdfont, powershell
Id: oHhiMf_6exY
Channel Id: undefined
Length: 10min 29sec (629 seconds)
Published: Fri Sep 20 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.