Customize Windows Terminal with ZSH + Oh My ZSH on WSL 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what is going on guys today i'm going to show you guys how to set up zsh as well as oh my zsh on a windows subsystem for linux if you've ever used zsh before on uh linux or even mac os then you'll know exactly what i'm talking about but this is more of a guide focused on how to get this working for windows so um let's say for example if you're tired of using the plain old command prompt and you want something that feels a little bit more nicer feels a little bit more different then you definitely want to look into oh my zsh it's obviously not going to really change much in terms of like you know writing the commands but there are some plugins um as well as customizations that you can do for the command prompt and person for me you know you're going to spend all your time working with the command prompt it feels nice to have a command prompt or some kind of shell that is very interactive has nice colors nice themes not required but it does feel like it feels nice okay anyway so for example if you want to have a theme for your terminal it looks similar to this okay this is how it looks like on mac but it will look very similar in the shell when we actually install it and there's tons of themes that exist that people have created you can even create your own theme if you really want to okay i urge you guys to browse through all of these different um all these different themes i'm just going to show you guys how to get that started so the first thing that we'll need to do is we'll obviously need to one have windows subsystem for linux installed now i'm not going to show you guys how to do that because i'm already assuming that you guys already did so that's obviously the first step one make sure you have wsl2 installed um if you don't have installed there are plenty of guides out there you just need to make sure you have virtualization enabled and you need to make sure that windows substitutes for linux is a feature that is turned on in your windows settings okay just like i said it's really easy to do that once you have a windows subsystem for linux you need to make sure you have your distribution of choice your linux distribution of choice now for this tutorial i am going to use uh ubuntu but you can honestly use any distribution you should be able to use any distribution i've never used anything either than ubuntu before so i don't know if a zsh works for uh others but uh i'm not gonna say if they do because i've never used before but i'm just gonna use ubuntu okay but it should work though it shouldn't it shouldn't be a big it shouldn't be a big problem it should it should just work fine so i'm going to go ahead and install ubuntu 20.04 and uh it's going to be really easy like so you can install whatever you want so i'm just going to go ahead and install okay so this should take about a couple of seconds for me okay so we just installed ubuntu so if i go over to start i should be able to type ubuntu and it should pop up as an app and when i open it up i should see this interactive shell or this command prompt like program and it's just going to ask me to enter a username so i'll just type in arizona and then password okay there we go so we have the password set up already and you can see that we are logged into our uh linux virtual machine and now if i go over to my windows terminal and this is another application that you can install uh in the microsoft store so just go to the microsoft store type in terminal all right so now if i uh go over to this uh carat symbol or a chevron and if i click on ubuntu 20.04 you can see that i should be able to go into my uh ubuntu vm and i can literally use bash commands okay i can type sudo update okay and i can do whatever i want like an actual uh ubuntu uh environment so now we need to do is we need to go ahead and install csh because if we type in csh it's going to say not found so let's go ahead and install that so let's see sudo apt install csh zsh okay and then just type yes okay and once we install that i can type csh and then what i can do is i'm going to type 2 so we can populate our z shrc file with the recommended configuration so let's just type two and there you go so we can see that some things definitely change we have this highlight already we have this tilde sign i think this squiggly um let me go ahead and create a directory you can see that there's definitely uh some changes but nothing to uh nothing too crazy okay and if i type lsao you can see that we have this bash or c without that this zshrc file okay now right now by default if i were to close the linux shell the ubuntu shell and if i were to open it up again you can see by default it does not set it to zsh but don't worry you can manually set it to zsh yourself or we can just install omycsh and that'll do it for us so all my zsh allows you to add a bunch of different configurations more advanced configurations for your zsh shell and it has a bunch of plugins as well and themes all right so the next thing that we do is install oh my zsh and this is pretty much uh you can think of it like a package that you can use to configure and manage your zsh configurations um so so it's more like a framework is what they say it is um but yeah pretty much you can add a bunch of different plugins you can add a bunch of different functionalities for your zsh shell and it's honestly really nice i like it a lot uh so to install this and i'll leave links in the description so you guys can actually uh reference them don't worry i'll leave all the links that you'll need in order to uh you know visit these visit these websites we're going to go to this website uh oh my z dot sh okay you're going to scroll down to the install my zsh now instructions over here and you can either use curl or wget doesn't really matter too much or just use curl and i'll just go ahead and copy this it's really just going to download the installer sh script and execute it so we're going to go ahead and paste this script inside our ubuntu shell so i'm going to go back all the way to the ubuntu directory and we'll just do that so all it's going to do is just download the script and run it so and there you go you can see that it says cloning into oh my zsh and it's going to tell you do you want to change your default shell to csh so just type yes you don't have to if you still want to uh start start up your environment with bash you can have it by default to bash but i'll leave it to default with zshrc and then uh type in the password the password for your linux account and there you go it was really that easy okay so now you can see that we have a much cleaner and much cleaner shell already and if i go into if i create an i'll create a directory so let's do get project okay and then if i dvn2 there if i do get init we should see the branch name that we're currently on i do get checkout iphone b feature payment processing you can see that it'll tell me what uh what branch i am currently on now there's a bunch of themes that you can install okay so if you're if you're not using windows and let's say using linux or mac you will need to install the power line fonts in order for these uh these themes to render properly especially for the icons if you're on windows i don't think you need to install it for the linux environment using to install it on your windows system and it should work but we'll double check that so let's say for example let me go back to the root directory and you can see that i have uh this zshrc file and so you can actually put your environment variables in here so i want you guys to pay attention to this zsh theme this robbie russell one so right now by default it's robbie russell but let's say if we change it to uh let's do eggnoster and the money just kind of again you can see that the show uh shows the colors uh but you can see that the icons are a little bit broken and doesn't it doesn't really render properly and that's because we don't have the fonts set up now the fonts are really easy to install uh so like i said if you're on linux obviously you're not going to be using the windows powershell uh you need to install the fonts so you just go to powerline slash fonts i'll i guess i'll leave a link in the description for this geared repository you're going to go to the powerline repository fonts and you can just do sudo apt-get install fonts powerline but i should be able to just actually just install this on uh i should be able to install this on windows and it's just work fine so all you really need to do is clone this repository and run this install up ps1 script and that's just a powershell script that will install all of the uh it'll install all of the necessary fonts from the folder okay so uh you don't have to worry so much about that so we can just go ahead and just do that open up a new terminal so when you run that install script that'll install ps1 script that'll literally just install the fonts for you using a powershell script uh i already have installed already so it's just going to ask me if i want to replace the font so i'm not going to run that it should take about one or two minutes for you to install the necessary fonts okay now once you have the fonts installed you want to make sure you configure your windows terminal so uh let's go ahead and go to settings you're gonna click on the distribution so ubuntu 20.04 and you can click on appearance and you're going to change the font to a powerline font so for example you can select anonymous pro dejavu basically any one of these fonts that were in repository can find should just work just fine so if i select deja vu sans mono font i'll save that you can see that now it actually renders the icons nice so i go to get project you can see that i have the icons over here if i were to whoops changes back to a different font you can see that it does not show up so you need one of those powerline patch fonts and you can play around with the fonts until you find one that you honestly really like it doesn't really matter it's really just personal preference um on you know what what you like obviously uh so yeah that's pretty much it and one last thing that i'll do is also add a color scheme uh so what i'll do is i have one already so i'm just going to go ahead and just open the json file actually i should be able to just add a color scheme over here well actually wait never mind this will actually require me i want to paste the json file you can actually go to a website called windowsterminalthemes.dev right over here and you can browse for a bunch of different uh themes that you might like or you can create your own custom theme but you can always customize the themes that you get from this website okay so what i'm going to do is over here in schemes i'm going to go ahead and paste in that batman color scheme and for the ubuntu shell only i'm going to set the color scheme to batman okay um and that should be it i'll set the font size to [Music] actually i should be able to just size right over here let's do 14. so now when i open up what's going over here should be fine okay so now if i open up a ubuntu shell i should get everything the way that i want it so you can see that we have our color scheme applied and it's going to be completely different than a regular windows powershell and we can configure different profiles and if i don't like the text for this i can easily change that i'm not sure which color the text is okay but uh yeah that's pretty much that's pretty much it so hopefully you guys like this video if you guys did definitely leave a like down below and you know leave a comment and subscribe if you want to and i'll see you guys in my next video peace out
Info
Channel: Anson the Developer
Views: 1,303
Rating: undefined out of 5
Keywords: zsh, oh my zsh, windows terminal, customize zsh, bash, linux, wsl, terminal, iterm2, shell, ubuntu shell, ubuntu terminal, how to customize windows terminal, customize terminal
Id: xlgyZ1_OlsY
Channel Id: undefined
Length: 14min 17sec (857 seconds)
Published: Thu Oct 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.