How to make the ultimate Terminal Prompt on Windows 11 - This video is LONG and WORDY and DETAILED

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i'm going to go ahead and show you something interesting so this is a microsoft surface laptop studio i've unboxed it and i've got it in front of me this is not a laptop studio review in fact what we're going to do is we're going to show you how to customize your terminal so let's switch over to that machine so what i'm doing is some remote trickery here so you'll see me facing this direction because i'm using this laptop studio and we're streaming the screen this is a brand new machine and i've just set it up i've only put on visual studio code signed into a couple of websites and i've got windows terminal right here all right in our last video you all were really excited about my prompt you'll notice here in youtube we've got this prompt and i've got a lot of stuff going on here i showed powershell and i showed history and i showed um fonts and ligatures and wsal and linux and all that kind of stuff so i figured why don't we try without any editing to go and set that up on a brand new machine now i want to point out this is a brand new machine other than visual studio and visual studio code which i installed earlier because that's what i do every time i start a new machine so this might be a sloppy video you might say hey scott just give me a script and i'll go and run that script and it'll make my prompt look cool i'm going to do this video explicitly slowly because i want you to learn what could go wrong if i make a mistake then you'll be able to fix it if you make a mistake yes i could write a script yes i could write a powershell for you and do it all but that's no fun we're going to try this a little bit differently maybe it'll work maybe it won't it's going to be slow if you don't like that i don't know fast forward to the end you can also take a look at my blog i'll have details there as well okay so out of the box on windows 11 here i've got the windows terminal and now right now i immediately want to zoom in on stuff so i do this in a lot of my videos i use zoom in so i'm going to go and search for zoom it i'm going to just download this real quick this is a great tool that lets me annotate on the screen so i'm going to go and just grab that open my zip files in explorer and then i'm just going to grab the 64-bit version of zoom in and drop it onto my desktop which i'm going to then show desktop icons double click on zoom it and now i can zoom in and draw on the screen which is cool zoom it just sits down in there in the tray okay so that's the first thing now i'm going to turn off my icons because they're stressing me out cool so we've installed zoom it and it's running down in the tray go and open up windows terminal and i'm going to pull down that first menu and i'm going to notice right here that windows terminal has detected that i have windows powershell the original dos or command prompt and then it puts azure cloud shell in by default i can if i want to click on the chevron and pull that down hit settings and then i can you know change my default profile to something else or i can open up a json file down here in the corner if i want and see that json file which is the settings behind this so if i click open json file it's going to say hey what do you want to handle your json files and i'm going to say always use visual studio code and that that'll open up that json file visual studio code may warn me about restricted mode i'm going to say yeah i trust this location so don't don't bug me so much and now i've got my json file and we'll be changing that and putting in some settings that are specific and you can see that i can go and hide some of these if i want to so we'll make some settings both here and we'll make settings in the json file as well i can also point out here that if i want i could make the windows terminal the default shell a lot of us type windows r and we pop up the run dialog and then we type cmd and that brings up this old shell right here we may not want that so what i'm going to do also is i'm going to say windows terminal will be my default terminal application so that when i go and save that and go away and i hit windows r and i type in cmd and press enter that's going to bring up cmd inside of the new windows terminal rather than the old console host so that's cool change to make right off the bat all right now we're using windows powershell powershell classic and i'm you know a fan but i want to use the new hotness there's lots of ways to get it i'll go into the store and grab it but you can go and download it from github if it makes you happy and i'll just say powershell and then we'll go and grab powershell right here this really showcases the difference by the way between a shell which gives you that little command prompt and the prompt itself which we're going to customize and then the terminal or that console that does the painting of the the strings so we'll go and grab powershell that's installing powershell now it's done okay i'm going to close terminal and reopen it here and then we'll look at that drop down and we'll note that powershell the new latest.net core powershell seven or eight i think it is much much newer than the the windows powershell but notice that windows powershell is boldface we're gonna make that that's the default because it's bold we're going to make powershell the default so we'll go into settings and we will say default profile is now powershell not windows powershell i'll hit save and then again if i want to open up that json file notice that it is in fact detecting these prompts i'm going to actually hide windows powershell i'm going to use the cross platform one instead i'm going to hit close okay and then we'll come back here and we'll do that drop down and we'll see that powershell is now the bold default and windows powershell is there but it's hidden i can still run it but i don't want to think about it again because it's you know it's emotionally stressing me out now again if i want i can hit settings i can hit open json file and i could even move powershell up by just editing this json file and make it the first thing in the list that's cool i can make a save and actually go back over here and windows terminal will pick it up right away so now it's the first item in the list there a lot of choices if you have a python shell if you like fish or dsa whatever shells make you happy you can put it in there it's totally configurable so that's thing number one so now when we open up a new tab we're going to get powershell 714 which is the latest one okay now right now it does the basic stuff dir is actually not dir it's an alias to uh to something else so if i type in alias dir i can see that it's really an alias to get child item and alias ls which is linuxism is an alias to get child item also so ls dir and git child item are all the same thing i don't have any coloring i don't have any fancy fonts i don't have anything interesting here really going on at all what we're going to do is start out by first putting on wsl okay the best way to install wsl is w cell dash dash install okay now this shows me that i've already got it enabled and if you type wsl-install like this it looks like it came enabled already that's going to want to set up like the virtual machine and hyper-v and all the different things that you need this does work on windows home you don't need windows pro to do this but if i go and type wsl by itself it says there's nothing here i don't have any installed distributions i don't have linux on this machine there's two ways to get it i could go and say visit the store but i think i can also go install ubuntu ah that's actually coming soon that's a good point so in the future you'll be able to go wcell install ubuntu and that will update so let's go to the store and grab a linux so i'll just go to the windows store and i'm actually typing linux in the windows store which is kind of a hotness let's go ahead and grab ubuntu this will be the latest one i'll hit install now when we're doing this it's important to note that this is not microsoft this is canonical the folks that make ubuntu it is a zulu word it's not pronounced ubuntu so please stop doing that it's ubuntu and we're going to go grab that you see it's about 500 megs what is it downloading and where is it downloading it from this is actually coming down from canonical and it's a tar file that canonical submitted themselves into the uh the store and if i type in linux you can see that there's other choices as well including kali or susa different linux is out there that you can pick you can also pick um ubuntu 1804 20 that's april of 2018 or you can pick um 2004 as well okay let's see if that's finished i'll know when it's done if an icon appears down here she says ubuntu recently added now when i run that for the first time it says installing this may take a few minutes it's just untarring it's unzipping that tar file on my system it's a one-time thing won't take very long at all and then there you go it says unix username i'll go and put in my username and password this is not the same as my microsoft one and then i'm going to close the terminal and run it again because again that detection code runs when you start up your system pull that chevron down and now you can see ubuntu with a little tux has just appeared right there so now i've got the windows terminal detecting that you may notice that it's warning me about powershell here that'll be appear in the store soon so sometimes you'll get a little warning about powershell being released and if you've installed it from the store like i have you'll get it in a day or two so don't stress too much about that and you can hide that prompt if it makes you happy now i'm going to go here and say run ubuntu so i just did it dropped me here in mount c users scott i can control where that is if i want to by going into visual studio code and looking at that settings file again and we can go here and settings for ubuntu here's ubuntu now that profile has a starting directory and i always forget if it's supposed to be like this or what so i usually end up googling for what the best way to have that start in the current in the current directory is sometimes yeah it's not that i think that it is doo doo doo let's go and google for it because this is live right let me sell starting directory actually hang on i think i have this on my gists so i have gists on my github and i keep all of my settings and you should too and if i recall i put this up there a while back in my settings.json and you can go and explore these if you want to as well and let's see ubuntu yeah this is one way to change your starting directory this is an interesting one what i'm doing here is i'm saying that my starting directory is the wsl dollar sign network share and then ubuntu 18.04 we can actually prove that by going here into linux and seeing what it's called that's actually called ubuntu not 1804 so i'm going to change that to that and then i'll double click on it and you'll notice here it says wsl dot local host that's that network share for my local ubuntu here so let's try wsl local host okay and then we'll come back out into our terminal and we'll open up a ubuntu and we'll see if that drops us in okay that dropped us into the root let's see where our choices are if i go here to home that's slash home slash scott wsl localhost slash home slash scott is listed right there run terminal run ubuntu that feels like it's dropping me into the the root folder there and not where i want to be which is down a little bit lower as i recall i think i did this differently on another machine so let's take a moment and figure that out this is one of those little quality of life things it really depends on where you want to start out oh i remember okay so what i'm going to do is i'm going to say instead of starting directory i can actually control the command line so what command line do i want to use here to start up my wsl and you can pass in the directory name so i'll just say wsl tilde and then we'll open up ubuntu and there you go so now i'm dropped into that location so let's think about what just happened there because i was moving pretty fast so the point here is that you have control over everything nothing is hidden from you you have control in your windows terminal settings you have control on the command line the starting directories but in that example i needed to figure out what language this thing spoke so that i could drop into the right folder and i wanted to drop into that home folder other people might want to drop into mount c users scott and now i'm over on the windows desktop but i'm doing it from linux okay all right let's go back to our prompts here this font by default is called cascadia code it's a new font i think it's under appearance did appearance or color schemes appearance cascadio mono there's cascadia code and cascadia mono mono for mono spaced but i want to get special glyphs i want to get special glyphs so what i'm going to go and do is i'm going to go to nerdfonts.com and go to downloads and they made a modification of cascadia code and they called it cascadia cove spelled it differently and inside that they added a bunch of cool glyphs visual studio icons github icons calendars all kinds of fun stuff so let's go and grab that and we'll go and save that on our desktop i'm going to drop that on the desktop and now i'm going to hit windows d to drop out to my desktop really fast i'm going to right click and say show desktop icons now i'm going to right drag i'm using my right mouse button and i'm right dragging and hitting extract and then i hit extract and now i have those in a folder here then i'm going to hit windows r and i'm going to type c windows fonts yes i could also right click on the fonts and i could say install you'll notice that there's some parts of windows 11 that are not dark mode yet i'm sure that they're going to work on that let's go and install these nerd fonts these are again modifications of that cascadia code with the nerd font glyphs that i want those are the icons that i want now i'm going to not make any changes yet in my settings because i want to see you i want you to see it broken first and then i'm going to fix it okay so that'll be cool let's do this all right so we have the default font going on here let's go and look at our new prompt it's called oh my posh oh my posh is actually a prompt engine that started out for powershell but it's actually for any shell and this is a great way to get started and this is the one that i use so if we say get this we can go into powershell and we can learn about ways to potentially go and do this right here it says you could use this for powershell or you could use it for any potential uh shell now windows 11 includes a thing called win get and win get is like apt-get for windows so i can actually go and use that and install oh my posh at the command line just say win get install and it'll go and get that and now it's going to bring that down there's the installer that's cool checking that that's verified it's going to start the installer real quick now it's installed all right cool now if i recall that thing is actually called ohmyposh.exe so let's go back to our terminal you can see when i run it it outputs a default prompt there's a couple of things that are going on here that are really interesting first we're missing glyphs here you see all these squares it's outputting unicode code points but it's in fact um outputting the ones that we don't have a font for we don't have a glyph in our default font that's why we made a nerdfont then we have this no config warning as well let's fix the fonts first and then we'll do the rest so i'm going to go to settings and then i'll say powershell and i'll go to appearance i could change this change this for everyone but just for the purposes of showing you this i'm going to go and pick it directly i can say nerd font nerd font mono or the nf variant we'll go ahead and hit that we'll come back over here and you'll notice immediately we've got the rounded edge we've got the cool arrows we've got the folders we've got the powershell it's telling me my current prompt we got the human heart which is not creepy at all and that is appearing every time we hit oh my posh but this is the actual prompt here oh my posh is just an executable that outputs the prompt so what we want to do is teach powershell how to use ohmyposh.exe in to print out the prompt rather than the default so we're going to change that prompt again this will work on anything that can output an executable or run an executable every time you push you can push enter now powershell has a profile so i could run notepad dollar sign profile and it'll pop up and it'll say well path not specified you don't have a profile file what is that i think we can say echo profile and it'll tell us where it should be so now i'm going to select this path with my mouse i'm going to right click now i'm going to hit windows r and paste it in so i'm going to go directly down there look i don't even have a powershell folder under document scandalous so now what i need to do is make this thing here there's a couple ways to do it i could um echo something directly to this path i could touch it i could make the folder manually it's totally up to uh up to you put a word in like this can never remember the right way to do this yeah so it's mad right now that the folder doesn't exist so we'll make a folder here called powershell first and then i should be able to just put a word into it so make that file in any way that you possibly can and then what i'm going to do is i'm going to start dragging it i'm going to start dragging it and then i'm going to alt tab with my other hand and i'm going to drop that directly into um directly into visual studio code and then visual studio code is also going to recommend that i install the powershell plug-in for vs code that's totally optional doesn't have to do with anything but it's kind of cool that it noticed that i'm just going to start to do some powershell okay all right now your powershell profile has to have stuff in it we can go back over to the installation here and we can say okay we've installed it what do we do what do we do well it says replace your current prompt right so we want to go and edit our profile here we're going to add this line now what's going to happen here is oh my posh we're going to copy paste this command is going to edit our file and what i'm going to do to show this to you is i'm going to put visual studio code off to the right i'm going to push powershell off to the left okay so i'm going to paste this in it's going to warn me what we're going to do is we're going to run on my posh we're going to tell it we're on powershell and we're going to invoke the expression okay and then you'll notice over here that has been updated okay so what's our powershell profile look like now okay now i would have expected that to make a change to my powershell profile it looks like it did not so let's go and confirm that i know what i'm talking about because i might not so here's powershell there's my profile did it not update it because it was open by me that would be weird try to do a fun demo and then it doesn't work out does it let's find out friends okay i'm going to close this because now i don't know if it really happened or not okay so that did not actually update so that's interesting i don't know if that's an error or a mistake on my part but here it's going to it's supposed to output this so let's find out what it was going to do rather than invoke expression ah look at that so what it wants to do is print out the initial information for our oh my posh and then spit it out and join it and it was going to go and put that into a config file oh i see what it did look at this it put it into a local config so i betcha that we have a local config now oops look at that so here's a great example i made a mistake i thought i thought that running that would add it to the thing and i did an rtfm so that's my bad my friends look at me being silly so what i'm going to do is i'm going to take that new profile page and i'm going to copy this in and i'm going to drop that right into our profile okay so what i'm going to do is i'm going to take this line of code i'm going to copy it into the clipboard i'm going to come back over to our profile i'm going to drop it in right there okay so this is now in our profile that's going to run automatically every time so now i come back to my powershell i open a new one look now we've got that lovely prompt every time i push enter that prompt updates but it's not customized and it's still telling me stuff i don't need like the name of the computer my battery life that there's no config i want it to look a little bit more interesting additionally i might have a github folder and let's go and actually grab some some github code here i'm just going to go and grab some code from my own personal github so go and sign in two factor off time kids remember i said it was going to be low and slow i told you that this was not going to be exciting it was going to be educational and sometimes those two things are this are different aren't they two factor auth live okay github all right repositories let's go and take my podcast website now i'm going to take my code i like to use the github cli but i may not actually have that installed which means i'll come back over here and i'll say win get install gh which is the github cli there we go actually there's two now so someone else got in there git hub.cli let's go grab that real quick go grab the github cli i want to point out that i ended up having to say i wanted to get it from wingate because when the github cli is not in the store okay so we now have that github cli is great let's say github auth login hey how do you want to log in with github.com are you already logged in i am oh cool how did i do that that's sweet all right let's try pasting in our clone cool actually i didn't want to put that there at all i wanted to put that in my github folder all right so i've just cloned my code in there and you'll notice that the default here that we were given by oh my posh has my current folder and my current github but again i want to configure this it doesn't quite look the way that i want so where is this exactly coming from remember let's go back over to our powershell profile and you can see here it says config yonder dabbler yonder dobler is the person that manages oh my posh i'm a big fan of his work so he's given us a default um config here and it says that it's coming out of that tilde path so i'm wondering if that is sitting around here somewhere or it's deeper down i may need to go and look for that because i'm not exactly 100 sure where that file is so i'm just going to go and search for that real quick on my hard drive so we'll find out together where that's located this is a pretty fast machine the surface studio laptop here so i think it won't be too big of a deal but he's probably buried it somewhere okay so it's down here in c users app data all my posh themes i could have found that by reading the manual probably here's a fun thing i could be here at the command line and i could go and say start and then type in that path and then hit enter and it's going to go and automatically launch the uh the windows explorer folder here inside of the explorer folder i just said start in the name of that folder i've got a whole list of these uh files now i have modified one of these as i mentioned before on my gists and the one that i have is called oh my posh v2 here i'm going to go and grab that and i will show it to you we'll go and stick it in that folder okay so i'm just going to grab that zip file open it up and this file here we're just going to drop into themes pick that up drop it into themes sort by date modified pick that up alt tab and i'm just going to drop us back over here into visual studio code so we can all look at this together each of those little cool graphical things in the theme are segments and those segments here like this one represents the path and this one represents git and this represents dot net if you do node or rust or go you might find a segment for that there's lots of great information on those themes and the segments within them like what's the current aws or azure environment that i'm locked into you can go and add these things yourself i've just modified mine so let's go and put that in here and it's called oh my posh v3 v2 not my finest hour friends i should not have probably named that such a silly name but i did so that's what it is let's go and grab that put that into our clipboard go back over here and instead of picking the default i'm going to now switch it to mine so now when my prompt starts up we're going to initialize with new settings we'll come back out here we'll hit plus okay interesting says no config so what did we do wrong let's find out pretty sure that that's correct oh my posh v3 pretty sure that it's in the right folder in themes although it does make me wonder if the file exists in two places so we're going to want to learn about that i could probably give it a long path if i want to do that that might be a little aggressive though because then i'll never really know okay so that updated with mine but i think that that means that this original file the one that he gave us is actually in two places right now so that's funny i'm gonna drop back out and search for that okay so we know that ah see it's actually in multiple places so that's interesting he's got links to it from different places so that's one of the reasons that i got a little confused and that's fine i'm just going to use my full path i could also put that in my dropbox or my onedrive or somewhere where it would always be available i could put it in there or actually i could even put it in like you know c github what i really should do is put all of this fun stuff in my my prompt i should make one called like prompt right and then we'll take this guy out of here we'll go over to c github we'll make a new folder here and we'll call it prompt and then we'll hit control v and we'll go like that and drop in that guy okay so now i've got it in c prompt so let's test that again maybe this isn't the video for you if it's going slow maybe i'm showing you too much detail but you know teach a person to fish eh okay all right now let's go to github now we're cooking check it out that's the one that i showed you in the video before got my path got my get stuff got my current version of.net which is version six and the heart there what's that human heart about that's an interesting one if i go and type something wrong it'll actually turn red to show me that the last item the last command had an error level of one that's why that's there again you don't have to use any of this what's fun about oh my posh and customizing things is you can modify these things now look at this see how those are wrong lulu that's interesting look at that what if i opened up a terminal down here right what if i opened up a terminal look at this it's all confused and weird it says it can't find all my posh because it's in the not in the path the fonts are looking weird well i need to change my fonts in multiple places i sent it before in the settings right of my terminal but i never set it in the settings of the visual studio code as well i can do that a couple different ways i can do it in the json part of things or i can do it in the settings ui part which is right here settings ui and then i can type in font and we can change the font because right now it's consoles we're going to reject consoles and we're going to go with the hotness which is cascadia cove and then i'm going to switch back over here to my prompt and let's open that again and see if we get that font because maybe that will work so that's still not working so let's find out what's going on font family is it the right font family do i care about these other fonts i'm going to split this off to the right and i'm going to watch make changes oh look at that so that didn't get that right should be in quotes notice that i make the changes here on settings and things update on the side there so it's not finding cascadia cove nerve font otherwise those fonts on the side would change what we can do is go to windows fonts and i can take a look at the cascadia fonts that i put in there i can double click on them and see if oh interesting they have different names that says nerd font and it says book you kind of need to check these things so making sure that these things are recognized by visual studio code is important and i'll take a second and i'm going to move my head out of the way so that you can see me not there maybe i won't maybe i will there we go all right let's go back here and figure this out together shall we cascadia co nerve font complete do you need the whole thing how much information do you need visual studio code do you just need the family i'm scandalized what's going on cascadey cascadia code is a family okay that got us back here but you see that these are still wrong right there we're close cascadia cove you'll notice immediately is wrong nf nerd font how did i do this before let's go to my other visual studio on this machine over here and find out writing all this stuff down and also learning how to figure these things out is a really important way of doing things cascading cascadia oh yeah okay yeah people are probably yelling on the in the comments right now saying this was really slow and horrible what are you doing what are you doing hanselman oh cascadia co i'm gonna take a chance and reload this whole thing when all else fails turn off and turn on again look at that so there was something about that font that was preventing visual studio code from catching it on the first try so i was actually right but visual studio code did not agree isn't that frustrating sometimes so put in the name of your font and then you'll notice now when i'm editing my segments you can see stuff like the visual studio segment you can see the starts in the ends there's that human heart we mentioned and here are the you know the folder icons those are all those nerd fonts so already we're in a nice a nice spot here let's go back and look at our powershell profile though because all we've got so far is that basic prompt which still looks pretty good right but i've got a couple things i want to add like i want my directory look prettier i want icons in my directory now i've written a blog post on all of this kind of stuff and there's a thing called terminal icons which are just lovely you can go and learn about this on my blog i'll do a couple of these and then we'll skip ahead and i'll just copy my entire profile over so first i'm going to grab terminal icons from the powershell gallery terminal icons is just a package that was created by a very nice gentleman and i'm going to say is that a trusted thing yes the ps terminal gallery is safe and then i can say import module it says import module you put that line in your profile this is kind of a real standard way of doing things with powershell so we'll go and say import module terminal icons we'll go back and then let's close this we'll come back and we'll open our prompt again go back over to our github code type dir now we've got terminal icons again those glyphs they wouldn't have worked if i didn't have that nerd font there you got the docker and the get and the prompts all very cool so that's already looking uh quite a bit nicer which i think is really great but i don't have that auto um uh that automatic history that i showed you all before so let's go and grab my powershell profile i'm just going to click raw you can go and find again these are all in my gist and i'm going to hit control c control a control c and i'm going to drop them here and i'm going to take over all of this code here and we'll go through it a little bit it's a long profile yours will be different and that's okay okay all right now this oh my posh line i'm going to go right here i'm going to just change it from my dropbox to that new location on this new machine that we've just created here okay and then let's just talk about what's going on here we've got a couple of namespaces we're using a thing called ps readline which allows your prompt to behave more like a bash prompt in the old days i used things like ps colors and posh kit those aren't needed anymore um i have um used different themes in the past those aren't needed anymore sometimes i'll alias commands to different scripts like if i type the word desktop it'll cd direct directly to my desktop i don't really need that right now and you don't need that either that's the thing about these these profiles you can just comment out the things you don't need what we do have is some interesting stuff like what are called argument completers argument completers are little powershell chunks of code that will automatically complete the arguments when you type tab so i'm going to go ahead and hit save that will make that my prompt and then we'll go and load that profile again i'm opening up my prompt and loading the profile like this because i want to see the errors i could also just say dot profile let's see a couple of things here that are going on so oh my posh is not being imported that's fine that's because we're doing it differently i'm going to delete that and close it and open it again now it's salty about line 669 predictive view style is not found all right so that one actually was added recently in powershell and if i recall that was an add-on that's not helpful i don't need that let's put that in quotes sometimes when you search for stuff they don't find it uh that's included in ps readline 2.1 a newer version of ps readline so i'm going to go and grab the newer one let's go and say install module ps readline that way i get one that's newer than the one that i have installed already and i'll probably get another prompt about i do trust this place and i do trust that place okay let's go ahead and hit run again still salty let's go and force it for 2.1 maybe that's the issue okay here we go so it's saying that it's already there well that's interesting isn't it oh by default it is disabled interesante maybe that was the issue let's go back and look do i actually turn that on on 6 6 8 i do turn that on and they're salty about prediction view style not working let's try that parameter cannot be found that matches parameter prediction view style so they're upset with me because that's not working that's fine let's figure that out together again i could make all of this a script and fix this up but i like learning about stuff and i like sharing this stuff with you as well it's always nice to see known bugs this one says that they got rid of all the old versions of ps redline they're mad about predictive views style these folders are not um these files these are all old things i want to find ones that are new so i must include that must include prediction view style prediction view style now it says that that's optional i'm going to go ahead and turn that off as i learn about it just to see if i can pass beyond this and then i'll come back and i'll fix that okay so that's cool i just got predictions here so you'll notice that what's happening is as i start typing i'm getting in gray a prediction of what i might want to type and then i can hit tab and get some ideas i could hit right arrow so i just said cd c colon right arrow i got that predicted and the issue here is that i want this list view the list view one instead and for some reason that's not working on this machine because when i set that it says the parameter cannot be found so that makes me wonder if uh p.s redline changed the name of that or i'm just being silly i'm not getting anything on that i can never remember how to do these things here we go prediction source so i'm not saying that let's go back and search for that use list view here's somebody saying that would be nice ah 2.2 beta including the new prediction list view so 2.2 beta 1. there you go so that's the issue so let's go back over here and i need to write that in my notes and not say 2.1 i'm going to say 2.2 and take a look at that okay to required version it's probably like 2.2.1 point something something something i probably need to go and give it more information ah allow pre-release there we go okay let's go ahead and drop that in okay that's getting a 2.2 beta cool i'm going to add that to my notes so i won't make that mistake and now i'm going to put that back on so now that list view prediction style is back i did not remember that that was a thing let's go ahead and close that and open this ah now i've got nice predictions as a list which is pretty cool and then the last thing that i want to install is a thing that's called z and z i wrote about on my blog is a replacement for cd-ing cd is change directory and i really love z so i'm going to go and install z at the command line install module z clobber says it's okay to clobber existing stuff called z but there isn't really anything existing all right i'm gonna go and grab that little tiny package and let me see if i imported it before does z work let's say z github and some minutes z now you see how z shows up here z is really smart and makes it a little bit easier to get around so i could say z users scott desktop and now i could go z hanselman see watch that i'll do that again z space h-a-n tab gets me there faster so it learns that you've been there before and allows you to get those commands quicker everything's clean there so i'm able to go and build my my app here we are running my podcasting website to go and prove that i can go and build it so i've set up github i've setup.net i've set up the prompts i've set up the cool oh my posh i've set up the coloring of the desktop now let's see if this actually works we'll go and build this that worked fine when you are using visual studio for a long time like i do you tend to push control shift b control shift b is build so i made it so my prompt i can press ctrl shift b i'm going to do it right now ctrl shift b it actually puts dot net build on the command line those are the kind of things that you'll find if you go and explore that so for example right here that's a key handler when i press ctrl shift b i insert dot build so there's a hotkey that makes you happy for building the current directory testing the current directory or whatever you could go and insert those kind of things there's a lot of stuff in here that's pretty cool that's been taken from some samples that i found online a lot of things that ps readline does like control r which if you're a bash person you can be familiar with so i just start typing and then it finds that one i'll do that again ctrl r i know i type something with status enter or i can start typing like this and you'll see that i've got suddenly my nice predictor list as well okay so let's review what did we do we have wsl we have done installed uh a linux we set up powershell core powershell seven we changed our prompt we installed oh my posh with winget we installed github the command line the github cli with winget we changed our fonts we got the cascadia cove the cascadia nerd font that's the cascadia node nerd font alternative uh we made our own uh oh my posh config file all right cool so here's an exercise to you the reader my friends go over here to ubuntu which uses bash okay and modify this modify this go back over to the oh my posh instructions and go and install that on linux you see you can use that same prompt you can go and use that same prompts you'll go in sudo get that you'll bring it down you'll take a posh themes then you can copy over that exact same json file that i used before and modify it and get your terminal looking nice depending on whether you're using zsh bash fish or new or whatever makes you happy and then all you have to do is again take that same kind of code that i put in my profile except now it would be in your bash rc or be in your dot profile that is why in my last video i was able to have that good looking stuff uh running everywhere which is really really cool another thing to remind you about um is uh the colorization right now i'm just using the default but i can go into settings and i can pick powershell and i could pick different appearances here i could say campbell powershell which would change the background to blue which you might like more and then i can also hit control shift scroll see how i'm making that clear okay and then another a couple people also asked about making the um the actual title bar itself um acrylic or transparent and i've actually got that one as well that is if i remember i use acrylic in tab row you can spend lots of time exploring your json files and stuff so i'm going to go and say at the bottom of my settings.json file we'll go and we'll put in use acrylic in tab row and i can make a couple of changes down there so we'll say comma use acrylic and i'm not sure if that's uh maybe we might end up finding that that's a insider's feature that's coming soon i could be wrong true and then i could say do i want the theme to be dark or light or system or whatever i like it to be you know whatever the system is so that would be a darker light oops forgot about that and another one would be um show tabs in title bar set that to be true as well all right let's close this down bring it up again so it looks like that transparency that use acrylic in tab row is a preview issue we can go and learn about that if we want to by searching for use look in tab row and discovering that it is going to be here oh there we go in preview okay and you see where it says preview i can click on that if i want and i can go and download the windows terminal preview and i can have those things actually side by side which is pretty cool so um you that would be basically one or two builds ahead so that's probably how i did that before another thing that you can do with windows terminal that's really really cool is you can hit alt enter and go full screen and then again i can modify that so now i'm full screen on a windows machine doing my thing and then i can also open up other stuff i'm going to hold down alt and i'm going to press ubuntu so now i've got powershell on the left here looking at some code with a cool prompt and nice history and over here i've got you know h top or whatever in ubuntu so that is a excessively detailed and a little bit obnoxious because there are a couple of times i made mistakes uh way for you to set up your own prompt sorry if it was boring but also if you hung out as long as i hoped you did that was maybe fun yeah that was cool thanks for hanging out
Info
Channel: Scott Hanselman
Views: 147,145
Rating: 4.9575758 out of 5
Keywords:
Id: VT2L1SXFq9U
Channel Id: undefined
Length: 50min 34sec (3034 seconds)
Published: Thu Oct 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.