My Top Tips for using Windows Terminal like a Pro

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey friends i'm scott hanselman i want to run you through a couple of really cool windows terminal tips and tricks that you may not be aware of but before i do that i just want to remind you that there's a lot of videos on the youtube here so be sure to go back and explore them don't just subscribe and think about future videos think about the ones that i've already done including lots of ones on the windows terminal as well as playlists that explore windows 11 and cool things like space cadets c sharp and on and on and on so be sure to check those out all right let's talk about windows terminal so i'm going to go ahead and launch my windows terminal now i've done an episode before talking about how i've modified my prompt you can see i've got my blood sugar in the prompt there and i've got things like my get branch and the current version of.net or node or python or whatever that's all at ohmyposh.dev oh my posh.dev i'll link to it in the show notes i've done videos on that before let's just talk about generalized ways to make your terminal experience a little bit better okay oops let's go back over to home clear my screen out and let's start with settings so i click right here and i click on settings we know that we can get to here which is the graphical windows terminal settings dialog box but just a reminder if you go here and you hold down shift and you click on settings you'll actually open up the json the javascript object notation representation of those settings so these settings here and these settings here are the same thing that's the way to edit it with a ui and that's the way to edit it with text okay you don't have to go into the text world if it makes you uncomfortable but it's nice to know that you just click here and hit shift and that will open up or you can click here where it says open json file all right now here's some behind the scenes you can also click on settings instead of holding shift i'm going to hold down alt and hold down alt and what i'm going to end up is not settings.json but defaults.json so i could potentially make changes to my defaults for everything and set stuff like you know initial rows or my fonts for everything including future future settings as well but you also have the ability to change those defaults and things like that from here so i could say i want my appearance or my starting directory or my font to be the same everywhere so just be aware that pressing shift while clicking on settings and pressing alt or click clicking on settings does potentially different stuff now we know that we can open up things in multiple tabs so i'm going to go ahead and open up ubuntu i'm going to open up command prompt i'll open up windows powershell so i've got all these different things opened up in different places that can get a little bit overwhelming i've got a lot of things running i can actually right click here on the tab i'm right clicking on the tab i can rename the tab or change its color so that's cool so i can rename hit color we'll go and we'll hit that one's purple we'll right click we'll rename it we'll say that's ubuntu or development or test or staging or whatever right you have total control here so we'll say this is production don't delete anything in production hit color do that as well so that's cool right off the bat i can go and make changes to those tabs i can rename them i can color them and make changes now if you want that can also be part of the profile this each one of these is a profile here okay each one of these is a profile so if we go back and we hit settings i'm going to hold down shift so i can open that up in the terminal here if i go down down down and i say here's a here's a profile here's the profile for command.exe right so when i open up command.exe it has this name it has this background image that image is aligned to the bottom right or over here if i'm not mirrored and i can stretch it and i can also set the tab color so i could come here and say tab color and i could say you know red so ff0000 and then that will now be be red actually i'll do it like this then i get a nice color picker this is another nice benefit of being able to do things inside of visual studio code now i can pick my my color like that isn't that cool blue alright so tab color can be set there as well now you can interact with the terminal both using the keyboard and the mouse one of the things oh this is a good reminder take a look at this here you see this here you see how it's saying uh you know there's a setting that you did wrong it won't allow you to mess up this file so if i did something incorrect here it won't allow me to do that which is cool so don't be afraid that you're going to booger up this this page okay all right next reminder is the ability to zoom with the mouse okay zoom with the mouse that means i can hold down control with one of my fingers and i can zoom with the other okay and that zoom is going to persist for as long as that terminal session stays there so when i hit control that's going to stay that way now control and shift two fingers control shift zoom i'm zooming out now i've got transparency so i've made my background of my terminal my acrylic background transparent and now it is completely opaque so that is control control shift and scroll as well okay and then we go back over to our settings this one kind of setting that isn't quite official yet but i believe we've got it in here let's go and search for acrylic use acrylic in tab row you see that right there use acrylic and tab row that makes this tab row here also transparent so as we go and make our our background more and more and more transparent so we can see behind it the tab row is also transparent which is nice okay so that's new now a lot of people don't realize that you also have clickable urls so if we go into let's say one of my one of my websites let's go into my podcast site and we'll go down one and i'll say dot net run that's going to go and start up a log and start up a log file and that log file is going to include a a url okay so when that happens you can see here localhost 5001 when i hover over it you see how it's got an underline there that means that i can click on that so clickable hyperlinks i can click on that and that will go and launch a browser now i did have to control click on that i had a control click which is pretty standard with log files you can see if i hover right there it'll actually say control click to follow the link all right that's pretty cool come back we'll hit ctrl c to stop that and i'm going to hit ctrl l to clear clear out my uh my screen now i've got some folders on my desktop here one of them is called learning git i've got this folder here called learning git now i could potentially go and grab that on my desktop find learning git i'm going to drag and drop that over here and drop it on top of the tab bar and in doing that what i'm going to do is i'm going to end up directly in that folder so you can drag and drop a folder into windows terminal and immediately get a tab that is opened up into that location which is really really cool okay so that's an important windows windows tip now color schemes are something that is somewhat well known but you can note here that there's a ton of color schemes a ton of color schemes that come with a terminal but you can also edit your own so ubuntu legit is a color scheme that i added myself that gives me this nice ubuntu color scheme here those color schemes can be found all over the the net and you can see if i search for ubuntu legit i reference it here i reference it there color scheme ubuntu legit and then we can find it right there and again you can edit that color scheme information either in the ui or in json it's up to you i i like it and uh if you hover over them you can make your changes directly within the color picker that's included with um with the windows uh just assuming with the visual studio code rather cool so another one that's kind of cool this is a little bit obscure i think it's a little silly but it's kind of fun is there's two options for retro effects okay one is called retro terminal effect experimental retroterminal effect let's go ahead and turn that to true and we'll go back over here you'll notice that we've got this kind of retro weird thing going on here with the scan lines trying to simulate a crt that's cute i find it a little bit weird a little bit in my face so not a huge fan of that however there is support for shaders okay and these shaders are what are called hlsl shaders i'm going to bring one of these up here i'm going to say windows terminal shaders okay and this hlsl or a language that is just kind of a c like language used to write pixel shaders okay hlsl h2o okay so what you put in is this experimental pixel shader path that is a setting that does not yet have a ui for it so i'm going to go here we'll use um what are we going to do let's do powershell i'm going to say experimental pixel shader path okay and then i've actually got some pixel shaders that i've already got you can find these all over and there's terminal examples as well my terminal shaders are in my github folder [Music] and they are in shader shader shaders people are like they're right there like dude i can't see them there they are okay right click github windows terminal shaders what was the name of that shader actually crt so copy as path come back down here and i'm going to just change these backslashes into double backslashes make sure that i only have one quote so that's the path to my experimental pixel shader and then i'm going to close this terminal looks good nothing wrong there okay we'll go ahead and open up the terminal again like that so that's not just a retro effect that's a totally different kind of look and feel right there and that's going to do that for all of actually no it's not going to do it for all because i only set it up for powershell now what's cool about this is i could potentially take that hl sl file and we could go and open it in visual studio code do it without the double backslashes and i'll make a change for example we'll say enable tint equals zero okay and then we'll come here and we'll open up a fresh tab so that we get a recompiled shader okay so now we've got a shader here oops looks like i've angered the beast here sometimes when you do experimental things you could potentially crash stuff so don't think of that as being representative of windows terminal having a problem that's more likely that i've done something stupid in my in my shader okay so let's go ahead and toss that real quick and we'll open up terminal again there we go so here we've got that terminal shader a little bit different it's custom and then if i want to i can go back in here and i can enable scan lines or enable noise or change the tint color so i could say tint color here enable tint here close that shader and then open it up again now i've got a black and white shader which is kind of cool right all kinds of choices that you can do again experimental but really really cool this particular one here was hans who made this particular uh windows uh windows terminal shader which is pretty cool and then i started modifying it got myself in trouble there so that's really cool a lot of people don't realize that another one that i want to point out are making some really basic changes to your key bindings to make life easier the two that i really recommend are new tab and close pane and i like to have these align to the same thing that you get in a browser ctrl t for new tab control w to close a pane okay the reason that i do these two control t and ctrl w you can also set them up here if i go to settings go under actions you can actually see control t is bound right there okay and control w is right here by default it's ctrl shift t and ctrl shift w so what's nice about this is that my workflow is i start up my tab and i can hit ctrl t ctrl t ctrl t or i can hit the drop down here and i can hold down alt with my thumb and we'll open up like ubuntu in a tab and then while that's coming up we'll open up the cloud prompt here i'll click in this one and i'll open up another powershell i mean i don't like it over there i'm going to hit ctrl w i'm going to click back over to this side and open up a powershell so now i've got my panes like this all right and then i'll hit ctrl w control w control w now you can use tmux you can use screen there's lots of things you can do to do that but it's nice that you can get that experience it's very very intuitive because you're just using your left hand you're going ctrl t ctrl t open up a new tab ctrl w ctrl w to close panes and then when you are doing that you can go like this now there is a split pane option though so split pane ctrl shift minus as an example so i can come here and take the existing pane and just hit ctrl shift minus or what i also set up was control shift pipe so minus would be horizontal and pipe would be vertical but it just kind of depends i think ctrl shift d was another one you can set these up the way that you want you got to set them in such a way that you don't forget them so i think it's alt shift d actually that opens up another one and then uh you can go control shift minus or control shift plus depending on whether you want to get horizontal or vertical those things are often often forgotten okay so those are just some of the little advanced tips and tricks that you can get with the windows terminal that folks don't really think about go ahead and let me know what your tips and tricks are how you like to use the terminal uh in the in the comments here and i appreciate you all please subscribe and tell your friends thanks
Info
Channel: Scott Hanselman
Views: 98,158
Rating: undefined out of 5
Keywords:
Id: FC-gLkYWXLw
Channel Id: undefined
Length: 16min 10sec (970 seconds)
Published: Tue Jan 11 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.