Make Windows Terminal look amazing!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] if you watched some of my videos you probably know that i love to use and customize my terminal and since more and more of you guys are always asking me how exactly i'm doing it i wanted to make this quick guide showing you how to customize your terminal experience under windows this is really cool not just if you want to give your terminal your own personal look and feel but also to improve your productivity because customizing your shell allows you to add outputs for several developer or sysadmin tools like git docker kubernetes python and many many more over the past years i've tried out several prompts shells and extensions and my terminal theme has changed a lot over time but i think i've now settled on a new shell prompt and color theme that looks just amazing while still being very minimalistic and the best thing is it's completely shell independent so that means it works on powershell on windows it works on bash or zsh under linux it just looks phenomenal and it's very easy to configure and customize special thanks go out to spyderon or discord who recommended me this new shell prompt and of course to the sponsor of this video teleport but more about their solution in a few minutes to start customizing your terminal you first of all need an application that can render these customizations and allows you to do things like change the font change the colors and support multiple shells and there are some options you have here under windows so in the past i've used applications like putty hyper or the fluent terminal but since microsoft released a new windows terminal in 2019 i've never really used any other third-party application anymore because the windows terminal gives you many great features and options to customize your experience it's constantly improved and under active development by microsoft and you can download it from the official microsoft store but it's also available in some command line package managers like wingate or chocolati you can also find the regular version and a preview version of the windows terminal in the store so i'm mainly using the preview version which will just give me access to newer features and functions however this might not be as stable as a release version but i can tell you from my experience that i never had any problems when using the preview version of course you can also install both of them and then just switch back to the release version if you have any issues so the windows terminal is a multi-tabbed windowed application that you can use to open any shell prompt that is installed on your operating system so for example you can see that this is currently running my windows subsystem for linux instance running with an ubuntu distribution and i've customized the look and feel of my terminal here but i can also open any other shell for example the old-fashioned command line if that's something you want to do this is somewhat limited in the features and functionalities but i could also open a powershell window and you can also see that i've customized it the same way like my ubuntu linux distribution and also run any other wsl2 distributions like my kali linux instance or my arch linux instance and i'm synchronizing the configuration files and settings across all those linux distribution so this is really nice to consolidate all the different shells and work with all of them in one single terminal application but the windows terminal gives you also some advanced features for example you can do something like tiling windows so these are called panes in the windows terminal and you can just open with a new hotkey a new shell prompt inside the same window you can also resize them and this is really useful for doing troubleshooting things like when you want to run an h top here and you want to simultaneously run or work on other shells and do some commands here this is really something that i use in my day-to-day work when i do troubleshooting or work on remote servers um to see what are the different hotkeys and commands you can use you can just click on that drop down menu and open the command palette so this will give you all the different commands that you can use and also the hotkeys you can by the way all customized in the settings so when you go to the settings of the windows terminal you can change the general things like the default profile or things like the windows of theme if you want to use a light or dark mode change the text color and also change any of the system colors we will take a closer look how that really works in a second but one thing that i also wanted to show you is the different profiles so this is really nice because you can set up a different profile for every single shell that is visible here in the drop down menu and you can change the things like the terminal application that it should run but also things like the appearance so here you can set up things like the color scheme that is using so that will define the background and foreground of the text and also change the font and the font size the font weight and also some other cool things like the transparency which is really nice if you have a fancy wallpaper like this one here and you want to make it shine through your terminal application so this is something that i absolutely love so this is how i configure my windows terminal application and it's really strange to say that but the windows terminal is an application that i would really miss on linux i use it mainly for all of the tools that i need to work with in a shell one terminal tool that i wanted to talk about quickly is teleport which is excellent for any developer or sysadmin who needs to authenticate securely to remote resources like ssh linux servers kubernetes databases or web applications because with teleport you can protect your remote resources with two-factor authentication and audit logging in auto-record any ssh sessions teleport is entirely open source and free to use in the community edition and suppose you want to use it in your company environment and secure your development or operations teams in that case teleport also offers an enterprise version with additional 24 7 support and single sign on it's a great application so just download and try it out of course you will find a link to their website in the description down below so this is how you can set up and use windows terminal to manage all the different shells but what exactly is displayed in the shell that now depends on the prompt and how you're setting it up and of course this is entirely different for powershell than it is for bash for example and before we start customizing our shells and prompts we need to first prepare a few things in the windows terminal because you should know that most of themes and extensions use a specific fonts including some icons or some graphics or they can also use emojis and you need to install these fonts in your operating system before you can start using them the emoji fonts are typically included in windows by default and windows 11 also added some new fancy graphics for them but when you work a lot with modern terminal applications under linux or shell prompts they often use a special characters to display icons for file types folders and other graphical elements in your terminal and to display these special characters you need to install the so-called nerd fonts that include a large set of icons and graphics in addition to the usual letters installing the nerd fonts is really easy you just go to the official homepage nerdfonts.com and just click on downloads and then you can pick a nerdfront that just looks the way you want it to look so something that you like for example i'm currently using the jetbrains mononerd font because i think that really looks nice and it also has all the different icons and graphics that you need to render in your windows terminal but you could also in theory just use any other fonts that is displayed here note that not every font will work perfectly with all shells prompts and its extensions but i believe like most of them will work pretty fine i've not really had any uh big issues with that and once you downloaded the nerd font you need to extract the zip archive and then install all those different fonts on your windows operating system so just select them all go to show more options if you're running windows 11 and install for all your users and then they should be visible and selectable in all the applications like word excel or also the windows terminal of course so go to the settings menu and inside your default or your terminal profiles you should select your font face here and select a nerd font that includes all those graphics and icons that the terminal want to display okay so our terminal can now render emojis and icons used by the nerdfights don't worry i will show you how exactly that's working inside the shell in a few minutes but first let's also talk about the colors so the shells and prompts also use a specific color codes to highlight elements in the terminal and these color codes are standardized while the first 16 colors are the so called system colors which color code is used for which element is decided by the shell and the prompt but which color is rendered in the terminal that depends on the color scheme you set up so when the shell wants to display a text with the color code red you can change it in the windows terminal and turn the color red into something else you can also create different color schemes for different profiles depending on how you want it to look like so i do the main configuration mostly in the json file in the windows terminal you could of course also do this in the settings but when you open the json file under the settings menu in the windows terminal you can edit all of these settings and color schemes in a text editor like vs code which makes it easier to copy and paste it so for example suppose you like my color scheme just go to my github page of course you will find a link in the description and then navigate to my dot files repository here you will find a folder for windows and windows terminal where i store my color schemes in a json template and you can then just copy and paste these sections into your configuration file make sure that you're not overwriting any of your profiles because they include unique identifiers from your windows registry which is unique on your pc [Music] [Applause] [Music] so once you have configured your windows terminal you installed a nerd font that you like and maybe add a nice color theme let's now take a look how you can exactly customize your shell prompt and print some additional information and use some fancy graphics and icons and in the past i've used zsh or themes and extensions to do that these themes are based on the zsh shell and work pretty well on the linux but what if you want to use a different shell like bash for example or you might want to use the windows powershell so i decided to replace the zh theme that i was using before with the new shell prompt and this works on all the operating systems and that gives me the flexibility to use whatever shell i want if i want to use zsh under linux or the powershell on windows it doesn't really matter for the prompt and this is of course much easier so now i can have the same look and feel on all of my windows terminal profiles because i'm using the same prompt no matter which shell or operating system is running under the hood just to let you know there are many different prompts you can install under windows or linux which will all work and look different and it's always a personal choice what you think looks great that doesn't necessarily need to be what i'm using but the one that i recently tried out and i want to show you in this video is a starship prompt so this is a cross shell prompt that i use on all of my systems on the linux instances in wsl 2 and also on the powershell on windows and it is really nice it is very minimalistic and very fast and you can easily customize it the way you want it to look like so when you click on get started this will take you to the official documentation page we will take a look at this later but first of all i want to quickly walk you through the installation so that you know exactly how you can use it so first we need to add a nerd font in our terminal we already done that so we can start with the installation of the starship binary and now it depends on where you want to install this so on mac os for example you can use the homebrew package manager and just execute this simple command on windows you could use the scoop to install it but when you go to the official documentation page there's also an advanced installation guide which will show you how to install this with chocolaty so this is the installation procedure that i've used also very simple so just execute this command to install it and on linux you can also execute this shell script this will automatically do everything for you and if you've installed this on all of your instances your terminal profiles and shells then you can add this to the init script of your profile on powershell you will need to put this into your profile script that is automatically run when you open a new powershell you can just open it with any text editor like vs code for example and open the profile variable and this will automatically launch a new window to edit your profile script and you can see that i already added this invoke expression starship init powershell so this is a command you need to put into your profile script this will automatically run starship whenever you open your new powershell and it works very similar under linux so on linux i've already added this into my zshrc file so i think i already open it here so there's a lot of stuff in here you probably don't need to worry about but at the end you can also see here it loads the starship i also want to quickly show you how it works when you don't configure starship so how it looks when you open it the first time so for example let's just move my a configuration file somewhere else so all of the settings how starship looks like are stored in this starship.tamil configuration file in your dot config profile folder so when i remove it you can see this is how starship looks like when you don't configure it at all so it already looks pretty nice but uh you can see i customized it a little bit so let's revert this change you can see i don't even need to restart the terminal it's already refreshing the configuration file that is really useful and let's take a look inside this configuration so i can walk you through some of the stuff that i've done to customize it this way so you probably need some time to get familiar with the configuration of starship but you can find all of this stuff that i've done in the official documentation so just go to starship documentation go to configuration and then there is a long list of all the different modules you can customize and configure in starship so i think you need to play around with it a little bit if you want to customize it or you can just be lazy and just copy my dot files from my github repository because i also stored my starship configuration file so if you want to use this as a template you can use this file note if you are watching this video a few months later it probably will be changed because i always make changes in my terminal configuration files but this is just a basic template you could use as a starting point and you can see the first lines is this will add a new line here so this is also default i think this is pretty useful because it separates those different shell prompts so otherwise if you set this to false for example and refresh the window you can see it doesn't add a new line here anymore so this is something i just like and in the format you can change how the terminal looks like so when we comment out these lines here you can see that um the way how the terminal looks is a changed um you can see that these lines here this is what i added with the nerd fonts so when you want to know what are the different nerdfront characters just open a character map and select a nerdfont and then you can scroll down and see all those icons and graphics you can use in the terminal and you can also use this in the format configuration file or also change any of the icons of the modules later so this is really useful you can just copy some icon that you like for example you want to change something at the beginning of the command line or you want to change some icons of the modules here so what i've done is i've added these gray lines here because i want it to look this way i just like it and you can see that this number here in the brackets is the color code for gray if you want to have this color map by the way again look at my dot files i just added this into my zshrc file i think it's a one-line solution you can just copy this into your rc file you can also use this command it's pretty useful for any terminal customizations so if you're wondering how i produced this ubuntu logo in front of the terminal inside my zshrc file you can see i've written a short script this is just a one-line solution it puts a fancy icon depending on which linux distribution you're running on inside this starship distro environment variable and inside the starship configuration file just print out the value of this environment variable which should contain an icon and in the format i've then defined where exactly this icon should be placed in the shell prompt so this is how you can use it one thing that i also wanted to show you is kubernetes so kubernetes is something that i really use a lot so this will also print out the context and the namespace of the kubernetes cluster that i'm managing so you can see it in this module here this is currently managing the serial creative staging cluster i also added an alias to shorten this name here so you can also do things like that and that is indicating i'm currently working in the default namespace if i want to change that for example um i can print out the configuration file of contexts so you can see these are the clusters that are managing let's switch to the docker desktop instance for example you can see that is now changed and if i change the namespace to traffic for example you can see that this is also now shown behind the kubernetes context so this is really useful if you don't know which coordinates cluster and namespace you're working on um starship prompt can help you with that so i don't want to walk you through all of this stuff because um yeah again you need to play around with that you need to experiment a little bit and i've invested several hours into play around here you might do as well but again if you want to have some templates just go to my dot files repository on my github page there you can find the zshrc file the zsh environment variable and also when you go to the config folder you can find this starship configuration file that you can just use so i hope this inspired you to start customizing your terminal experience as well for me it's just fun to work on a nice looking terminal and it's also helping me in my day-to-day work with some of the developers or automation tools that i'm using but now it's up to you so did you like this guide or do you have any questions or other tools that you want to see in future videos then please let me know in the comments and always thanks to everybody for watching i will catch you in the next year and in the next video take care everyone bye bye
Info
Channel: Christian Lempa
Views: 515,904
Rating: undefined out of 5
Keywords: command line, how to customize windows 11, how to customize windows 11 terminal, new windows terminal, tips and tricks, win 11, windows terminal, windows terminal customization, windows terminal ssh, windows terminal themes, windows terminal tutorial, windows terminal wsl, windows terminal wsl2, windows terminal zsh
Id: AK2JE2YsKto
Channel Id: undefined
Length: 18min 23sec (1103 seconds)
Published: Wed Dec 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.