How to Customize WSL & CMD in Windows Terminal with Oh My Posh!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so in this video I wanted to show how to quickly change additional shells with omip Posh and make them look amazing and so if you've watched some of my other content you know that I'm a big fan of omip Posh which is a command prompt theme engine that essentially allows you to get really cool things inside of your terminal inside your command line interface and so what I did in previous videos and I'll put those video links in the description um I went through Powershell and I went through the process of how to make your terminal look like this where you can see all this goodness here and I even in one of my videos talk about how to create your own custom segments if you're interested in that this is a custom NBA segment I do that in one of my videos what I wanted to do here is actually go and talk about the additional shells that I personally use and I'll show you how I customize those shells and so the additional shells that I use are the abtu shell and so that's this second tab here that I have in Windows terminal and I also use command prompt a lot so those are the two additional ones so Powershell is the one that I use and the one that I've configured in the past um and WSL as well as command prompt are two additional shells that I use um for those of you who are not familiar in Windows terminal there are actually a bunch of shells that you can use and with the drop down menu you sort of select your shell and the ones again that I'm kind of talking about today are this PO shell one which I've configured in the past I'll be talking about this Ion 2 which is a Linux Distribution on Windows through WSL and I'll also be talking about the command prompt actually so the top three are the ones that I use um pretty much every day so without any further delay I'll jump right into it and we can open up the OM myh docs which I'll also Link in the description and we'll get set up with Linux first so w cell literally is just running a Linux drro on Windows and so I'll copy this first command here I'll go back to the terminal we'll go to WSL and I will now run this command this is the first command in the docs and what we're doing is we are installing om my Posh from this uh endpoint essentially if I click enter we will hit our first bug that is okay essentially it's saying that it cannot write to user Lo bin this directory is a protected directory um I probably could figure out a way to write there but I don't really want to do that so what I have set up on my machine is a separate bin or binaries folder where I put other sorts of programs and that's where we'll install to and I actually think that this is a pretty common uh flow in Linux world so there's actually a separate command here that takes in a directory flag and lets you put in your program as such so if I copy and paste that one I think this should work we install yay installation complete we've got om my Posh and I accidentally turned on caplock that's no good but now that we've installed om my Posh in the Linux world we actually have to configure the shell and so in Linux distributions there's a bunch of different shells BTU ships with bash so that's the one that we're going to go through hear a bunch of different shells if you don't know what shell that you're using you can actually run oh my Posh get shell maybe without the dash my poset shell there you go and that will show you what shell you're using so here you can see I'm using bash now to finish getting some goodness into uh my Linux uh CLI essentially I will take this command here which is essentially saying run oh my Posh initialize it in bash in my shell and you need to add it to your profile and so if you've watched the other videos for Powershell let me go back to my Powershell profile this is essentially you know the bash profile is essentially the same thing more or less as far as I can tell as the P power shell profile and in my Powershell profile I have a way to configure on my Posh on load essentially uh on initialization when I launch Powershell and we're going to do the same thing here and so if I show all of my files um you'll see that there's a bash RC file oops let's get rid of that this is what we want a bash RC file if you already have that great just go ahead and modify that if not you can create the file um I'm going to be using Vim you can use any kind of file editor that you'd like here we are I'll go to the bottom and I will paste the command that I had before which is just this eval oh my Posh in it bash um and then if I do exact bash I think this should work great and so now we have this awesome you know oh my Posh goodness these segments so it already looks a lot better than it did before which I'm very happy about but I actually wanted to explore something new so let's go to the themes and you can do this too there are a bunch of awesome themes here um just find the one that you like the most I actually have one that I really like for my Linux dros so let me find it I think it's called give me a second let's scroll through you can see all the goodness here while I do this it's called quick term so this is the one that I like so if you click on quick term it actually takes you to a GitHub page GitHub gist I think uh no this is actually just a file inside the REO and if you click on Raw then you can see the Json here it's got all this information I'm not going to go into details here I do other you know I have other videos where you can check that out but I will copy this uh URL and I can actually input that as the theme that I want to use and so that's going to look really cool and so if I go back to bash RC and we go here um and we edit this we can do dash dash config and I think we just put it in single quotes I think this should probably work if not we can debug together maybe we should put a space here it would be smart um and then if I EXA bash again ah so cool I really really love this uh theme and so again there's a bunch of different themes and you can go and play around with any of them um and you'll see here now I'm pointing to this theme that's hosted on GitHub and so that is how I'm going to be setting up my WSL bash profile so that's all there is for WSL that's all I'm going to do in this video I also wanted to show you how to set up stuff for command prompt and this is a little bit more involved we have to go install an additional program on top of omip Posh called clink and so I already have all my Posh installed on Windows uh because I've done it in Powershell so if you do not already have it and you're just uh watching this video and you haven't done it elsewhere in Powell you want to do it in command prompt you will need to install it on my Posh I highly recommend using wingit um and here you can see that I have installed wind I'm using wind list but if you want to install uh on my Posh you can just do wigit install and then you can find on my Posh uh the ID that you want I guess I have the store version installed um you can do wi get search oh my POS should wow my typing is not good today but that is okay um this should show some good stuff so you can also get the W get Source or the I'm a store Source whatever get on my POL on your machine and then everything else should be uh pretty much the same that I'm about to do so now what I want to do is on Windows right uh I want to configure my shell I want to configure CMD okay so CMD this is pretty important I thought this was really interesting there's no out of box support for Windows CMD for custom prompts so you have to use this thing called clink which at the same time supercharges your CMD experience so in order to do that we're first going to install a clink and again I'm going to be using wigit so I'll do wigit let's first search clink I have installed this before in other machines so let me search for clink I see that there is this clink here um this is the top one this is the one that we want so all I will do is take this ID copy it and I'll just install that first boom so as that is loading I'll go back to here into the docs and I will check to see what we have to do next uh I'm getting a UAC I'll click yes okay so integrating om my Posh with clink is easy we need to create a new file called om my. Lua in your clink scripts and if we run clink info if we run clink info then we can figure out where those scripts are uh right there clink info and then afterwards we'll have to copy and paste this so the first thing I want to do is make sure that I have in clink that's great and then apparently if I do clink info um I might need to relaunch CMD potentially my environment variables haven't oh well that was cool somehow I already have the profile set I think I've probably done this on this machine before but let me still walk through it so if you're going through the same tutorial you definitely will not have this awesome theme which is another amazing theme and I'll show you which one it is you won't have that already so I'll show you how to actually get it if you go to clink info and you look at scripts then you can find your uh directory that you'll need to open um if you go to file explor and we go home and I paste this directory here in clink um you will see basically that I've already included a new file I must have done this a yeah looks like I did this about two weeks ago um here is my omip pos. Lua file and if I open this up maybe we can open this up in code open this code all right you'll see that in this file all I've done is use the exact same syntax that's in the docs and I also have this additional um endpoint and you can see here the the theme is called kall I'm not sure if I'm pronouncing that correctly but that's the name of the theme that I'm using um and that's where you're seeing all of this coolness already and you can see that another thing we're getting is uh recommended endings right like Auto completion which doesn't exist out of the box withb so I actually really like clink um I have used it before and I've set up a bunch of machines in the past couple months um and it looks like I had this file laying around but all you'll have to do is create that same file you can follow the docs here um and run this again if you just have the default on my Posh in it CMD you'll have the default theme but you can go and find the themes here this one is called uh cusha where is it jjk here we go that's uh this one and I would just go here you'll go to the GitHub again you'll click raw and you can copy and paste and you'll see here that's essentially What I've Done Right This is the um this is the goodness and so you can change themes really quickly this way it'll take a little bit of time to load when you're pointing to a file on the internet but that is totally okay um anyways this is already approaching 10 minutes so really appreciate it and hope you enjoy the video and have an amazing terminal now in all of your shells
Info
Channel: Jordi Adoumie
Views: 1,513
Rating: undefined out of 5
Keywords:
Id: lxNLJsDKyU4
Channel Id: undefined
Length: 10min 24sec (624 seconds)
Published: Sun Mar 31 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.