{"id":6232,"date":"2020-10-15T13:38:32","date_gmt":"2020-10-15T20:38:32","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/commandline\/?p=6232"},"modified":"2020-10-15T13:38:32","modified_gmt":"2020-10-15T20:38:32","slug":"windows-terminal-tips-and-tricks","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/commandline\/windows-terminal-tips-and-tricks\/","title":{"rendered":"Windows Terminal Tips and Tricks"},"content":{"rendered":"<p>Windows Terminal comes with a lot of features that allow you to customize it and interact with it in a way that feels most comfortable to you. Let&#8217;s run through some tips and tricks that could help you set up your terminal in a way that&#8217;s perfect for you. At the time of this blog post, <a href=\"https:\/\/aka.ms\/terminal\" rel=\"noopener noreferrer\" target=\"_blank\">Windows Terminal<\/a> is on version 1.3 and <a href=\"https:\/\/aka.ms\/terminal-preview\" rel=\"noopener noreferrer\" target=\"_blank\">Windows Terminal Preview<\/a> is on version 1.4.<\/p>\n<h2>On first launch<\/h2>\n<p>When you first install Windows Terminal, you will be greeted with a Windows PowerShell prompt. Windows Terminal ships with Windows PowerShell, Command Prompt, and Azure Cloud Shell profiles by default.<\/p>\n<p>In addition to these profiles, if you have any Windows Subsystem for Linux (WSL) distributions installed, the terminal will automatically create profiles for those distros as well. If you would like to install additional WSL distros on your machine, you can do so after installing terminal and on your next terminal launch, the profiles for those distros should automatically appear. These profiles will have Tux as their icon, however you can change the icon of the distro in your settings to match whichever distro you have. You can find more information about WSL on the <a href=\"https:\/\/aka.ms\/wsldocs\" rel=\"noopener noreferrer\" target=\"_blank\">WSL docs site<\/a>.<\/p>\n<p>\ud83d\udc49 <strong>Note:<\/strong> You will have to download the distro icons as they do not come shipped inside the terminal.<\/p>\n<h2>Customization<\/h2>\n<p>Windows Terminal comes with a large set of default settings, including color schemes and keyboard shortcuts. If you&#8217;d like to view the default settings file, you can hold <kbd>Alt<\/kbd> and click on the Settings button inside the dropdown menu.<\/p>\n<h3>Global profile settings<\/h3>\n<p>Windows Terminal provides you the option of applying a setting to every profile without having to duplicate the setting for each profile entry. This can be done by adding a setting inside the <code>\"defaults\"<\/code> array inside the <code>\"profiles\"<\/code> object. A list of all possible profile settings can be found on the <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/customize-settings\/profile-settings\" rel=\"noopener noreferrer\" target=\"_blank\">Profile settings page<\/a> on our docs site.<\/p>\n<pre><code>\"profiles\":\n    {\n        \"defaults\":\n        {\n            \/\/ Put settings here that you want to apply to all profiles.\n            \"fontFace\": \"Cascadia Code\"\n        },\n        \"list\":\n        []\n    }\n<\/code><\/pre>\n<h3>Custom color schemes<\/h3>\n<p>Windows Terminal comes with an assortment of <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/customize-settings\/color-schemes\" rel=\"noopener noreferrer\" target=\"_blank\">color schemes<\/a> by default. However, there are unlimited possibilities when it comes to color schemes. A great place to find additional terminal schemes is <a href=\"https:\/\/terminalsplash.com\/\" rel=\"noopener noreferrer\" target=\"_blank\">terminalsplash.com<\/a>.<\/p>\n<p>If you&#8217;d like to create your own color scheme, <a href=\"https:\/\/terminal.sexy\/\" rel=\"noopener noreferrer\" target=\"_blank\">terminal.sexy<\/a> is a great tool for creating and visualizing your own color schemes.<\/p>\n<p>\ud83d\udca1 <strong>Tip:<\/strong> You can match your custom color scheme to a background image by using the <a href=\"https:\/\/github.com\/microsoft\/PowerToys\/wiki\/ColorPicker-Overview\" rel=\"noopener noreferrer\" target=\"_blank\">PowerToys color picker<\/a> to grab hex codes for colors to use inside your scheme. PowerToys can be installed using <a href=\"https:\/\/github.com\/microsoft\/winget-cli\" rel=\"noopener noreferrer\" target=\"_blank\">winget<\/a> with <code>winget install powertoys<\/code>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/pt-color-picker.gif\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/pt-color-picker.gif\" alt=\"Image pt color picker\" width=\"2272\" height=\"1544\" class=\"alignnone size-full wp-image-6233\" \/><\/a><\/p>\n<h3>Custom command line<\/h3>\n<p>You can give your command line some style with Oh my Posh and Terminal-Icons. These tools allow you to customize what your prompt looks like with colors, glyphs, and emojis. To get Oh my Posh with Posh-Git and PSReadline up and running, you can follow <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/tutorials\/powerline-setup\" rel=\"noopener noreferrer\" target=\"_blank\">this tutorial<\/a>.<\/p>\n<p>Oh my Posh recently came out with <a href=\"https:\/\/ohmyposh.dev\/\" rel=\"noopener noreferrer\" target=\"_blank\">Oh my Posh 3<\/a>, which has a lot more customization options and is not only exclusive to PowerShell. After going through the tutorial linked above, you can upgrade to V3 with the following command:<\/p>\n<pre><code>Update-Module -Name oh-my-posh -AllowPrerelease -Scope CurrentUser\n<\/code><\/pre>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/powerline-powershell.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/powerline-powershell.png\" alt=\"Image powerline powershell\" width=\"1672\" height=\"935\" class=\"alignnone size-full wp-image-6234\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/powerline-powershell.png 1672w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/powerline-powershell-300x168.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/powerline-powershell-1024x573.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/powerline-powershell-768x429.png 768w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/powerline-powershell-1536x859.png 1536w\" sizes=\"(max-width: 1672px) 100vw, 1672px\" \/><\/a><\/p>\n<p>You can add a bit more flair to your shell by adding custom icons with <a href=\"https:\/\/github.com\/devblackops\/Terminal-Icons\" rel=\"noopener noreferrer\" target=\"_blank\">Terminal-Icons<\/a>. The image below is also using a custom Posh theme to add emojis to the prompt line.<\/p>\n<p>\ud83d\udc49 <strong>Note:<\/strong> You will need to set your font to a <a href=\"https:\/\/www.nerdfonts.com\/\" rel=\"noopener noreferrer\" target=\"_blank\">Nerd Font<\/a> in order to get the Terminal Icons to appear.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-icons.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-icons.png\" alt=\"Image terminal icons\" width=\"1150\" height=\"651\" class=\"alignnone size-full wp-image-6235\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-icons.png 1150w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-icons-300x170.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-icons-1024x580.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-icons-768x435.png 768w\" sizes=\"(max-width: 1150px) 100vw, 1150px\" \/><\/a><\/p>\n<h2>Old school fonts<\/h2>\n<p>For those of you who are fans of the <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/customize-settings\/profile-settings#retro-terminal-effects\" rel=\"noopener noreferrer\" target=\"_blank\">retro terminal effect<\/a>, a great place to find old school fonts is at <a href=\"https:\/\/int10h.org\/oldschool-pc-fonts\/\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/int10h.org\/oldschool-pc-fonts\/<\/a>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-retro-font.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-retro-font.png\" alt=\"Image terminal retro font\" width=\"1732\" height=\"980\" class=\"alignnone size-full wp-image-6236\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-retro-font.png 1732w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-retro-font-300x170.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-retro-font-1024x579.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-retro-font-768x435.png 768w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-retro-font-1536x869.png 1536w\" sizes=\"(max-width: 1732px) 100vw, 1732px\" \/><\/a><\/p>\n<h3>Places for background images<\/h3>\n<p>Desktop wallpapers often look great inside Windows Terminal as background images. Some great places to find background images are <a href=\"https:\/\/www.microsoft.com\/store\/collections\/windowsthemes\" rel=\"noopener noreferrer\" target=\"_blank\">Windows Themes<\/a> as well as <a href=\"https:\/\/wallpaperhub.app\/\" rel=\"noopener noreferrer\" target=\"_blank\">WallpaperHub<\/a>. Windows Terminal supports both images and gifs for background images.<\/p>\n<p>Another popular option is placing the logo of the shell you are using as the background image, to help identify which shell you are in. You can set where the background image is placed with <code>\"backgroundImageAlignment\"<\/code> in your settings. More information on <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/customize-settings\/profile-settings#background-image-settings\" rel=\"noopener noreferrer\" target=\"_blank\">background image settings<\/a> can be found on our docs site.<\/p>\n<h2>Functionality<\/h2>\n<h3>wt.exe command line arguments<\/h3>\n<p>You can launch your terminal in a specific configuration by using the wt.exe command. Some options you can set are tab and pane arrangements as well as their starting directories and profiles. You can save a custom command as a shortcut and pin it to your taskbar to open your desired configuration.<\/p>\n<p>If you use the wt.exe command inside the command palette, it will take effect in your <em>current terminal window<\/em>, rather than spinning up a new terminal instance.<\/p>\n<p>This example will open the PowerShell profile in the current working directory in a new tab with a vertical pane running your default profile.<\/p>\n<p><code>wt -p \"PowerShell\" -d . ; split-pane -V<\/code><\/p>\n<p>Full documentation about <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/command-line-arguments?tabs=windows\" rel=\"noopener noreferrer\" target=\"_blank\">wt command line arguments<\/a> can be found on our docs site.<\/p>\n<h3>Panes<\/h3>\n<p>Windows Terminal has pane support for profiles. You can open a new pane of a profile by either holding <kbd>Alt<\/kbd> and clicking on the profile in the dropdown, or by using the following keyboard shortcuts:<\/p>\n<p><strong>Automatic pane split of current profile<\/strong><\/p>\n<p><kbd>Alt<\/kbd>+<kbd>Shift<\/kbd>+<kbd>D<\/kbd><\/p>\n<p><strong>Horizontal pane split of default profile<\/strong><\/p>\n<p><kbd>Alt<\/kbd>+<kbd>Shift<\/kbd>+<kbd>Minus<\/kbd><\/p>\n<p><strong>Vertical pane split of default profile<\/strong><\/p>\n<p><kbd>Alt<\/kbd>+<kbd>Shift<\/kbd>+<kbd>Plus<\/kbd><\/p>\n<p>You can also move focus around your panes by holding <kbd>Alt<\/kbd> and using the arrow keys. Lastly, you can resize your panes by holding <kbd>Alt<\/kbd>+<kbd>Shift<\/kbd> and using the arrow keys. You can find more information about <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/panes\" rel=\"noopener noreferrer\" target=\"_blank\">panes<\/a> on our docs site.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-panes.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-panes.png\" alt=\"Image terminal panes\" width=\"1000\" height=\"566\" class=\"alignnone size-full wp-image-6237\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-panes.png 1000w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-panes-300x170.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/10\/terminal-panes-768x435.png 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<h3>Copy and paste<\/h3>\n<p>In Windows Terminal, the default keyboard shortcuts for copy and paste are <kbd>Ctrl<\/kbd>+<kbd>C<\/kbd> and <kbd>Ctrl<\/kbd>+<kbd>V<\/kbd>, respectively. If you do not have a selection, <kbd>Ctrl<\/kbd>+<kbd>C<\/kbd> will act as normal as the break command.<\/p>\n<p>You can customize which keys you&#8217;d like to copy and paste with by editing the <code>\"copy\"<\/code> and <code>\"paste\"<\/code> key bindings. If you delete these key bindings from your settings.json, the terminal will default to <kbd>Ctrl<\/kbd>+<kbd>Shift<\/kbd>+<kbd>C<\/kbd> and <kbd>Ctrl<\/kbd>+<kbd>Shift<\/kbd>+<kbd>V<\/kbd>. This can be especially helpful for WSL users who need <kbd>Ctrl<\/kbd>+<kbd>C<\/kbd> and <kbd>Ctrl<\/kbd>+<kbd>V<\/kbd> free to use for their shells.<\/p>\n<p>You can also choose which formatting is copied to your clipboard along with newline characters with the <code>\"copyFormatting\"<\/code> and <code>\"singleLine\"<\/code> actions associated with the copy command. Full documentation on <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/customize-settings\/actions#clipboard-integration-commands\" rel=\"noopener noreferrer\" target=\"_blank\">clipboard integration commands<\/a> can be found on our docs site.<\/p>\n<h3>Defining key bindings and actions<\/h3>\n<p>A large portion of the customizable properties inside Windows Terminal come from key bindings and actions. Commands inside the <code>\"actions\"<\/code> array will automatically be added to your command palette. If you&#8217;d like to also use them with key bindings, you can add <code>\"keys\"<\/code> to them to invoke them with the keyboard. A full list of every possible command can be found on the <a href=\"https:\/\/docs.microsoft.com\/windows\/terminal\/customize-settings\/actions\" rel=\"noopener noreferrer\" target=\"_blank\">Actions page<\/a> of our docs site.<\/p>\n<h3>Send input commands<\/h3>\n<p>Windows Terminal gives you the ability to send input to your shell with a key binding. This can be done with the following structure inside your <code>\"actions\"<\/code> array.<\/p>\n<pre><code>{ \"command\": {\"action\": \"sendInput\", \"input\": \"\"}, \"keys\": \"\" }\n<\/code><\/pre>\n<p>Sending input to the shell with a keyboard shortcut can be useful for commands you run often. One example would be clearing your screen:<\/p>\n<pre><code>{ \"command\": {\"action\": \"sendInput\", \"input\": \"clear\\r\"}, \"keys\": \"alt+k\" }\n<\/code><\/pre>\n<p>Navigating to the parent directory with a key binding may also be helpful.<\/p>\n<pre><code>{ \"command\": {\"action\": \"sendInput\", \"input\": \"cd ..\\r\"}, \"keys\": \"ctrl+up\" }\n<\/code><\/pre>\n<p>You can also use this functionality to run builds or test scripts.<\/p>\n<h3>WSL starting directory<\/h3>\n<p>As of now, Windows Terminal defaults to setting WSL profiles&#8217; starting directory as the Windows user profile folder. To set your WSL profile to start in the ~ folder, you can add the following line to your profile settings, replacing DISTRONAME and USERNAME with the appropriate fields.<\/p>\n<pre><code>\"startingDirectory\": \"\/\/wsl$\/DISTRONAME\/home\/USERNAME\"\n<\/code><\/pre>\n<h2>Cheers<\/h2>\n<p>We hope you learned a few tips and tricks about Windows Terminal throughout this blog post. We are currently planning another release for the month of November, so keep your eyes peeled for that one! If you have any questions or feedback, feel free to reach out to Kayla (<a href=\"https:\/\/twitter.com\/cinnamon_msft\" rel=\"noopener noreferrer\" target=\"_blank\">@cinnamon_msft<\/a>) on Twitter. For more information about Windows Terminal, you can check out our <a href=\"https:\/\/aka.ms\/terminal-docs\" rel=\"noopener noreferrer\" target=\"_blank\">docs site<\/a>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/08-2020-signatures.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/08-2020-signatures.png\" alt=\"Image 08 2020 signatures\" width=\"2006\" height=\"259\" class=\"alignnone size-full wp-image-6075\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/08-2020-signatures.png 2006w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/08-2020-signatures-300x39.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/08-2020-signatures-1024x132.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/08-2020-signatures-768x99.png 768w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/08-2020-signatures-1536x198.png 1536w\" sizes=\"(max-width: 2006px) 100vw, 2006px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows Terminal comes with a lot of features that allow you to customize it and interact with it in a way that feels most comfortable to you. Let&#8217;s run through some tips and tricks that could help you set up your terminal in a way that&#8217;s perfect for you. At the time of this blog [&hellip;]<\/p>\n","protected":false},"author":3539,"featured_media":6237,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10,1,2,11,3,4,1535,5,6,1577,8,9,782],"tags":[22,27,28,29,31,42,43,45,48,59,69,70,1576,1579,1578,72],"class_list":["post-6232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cmd","category-commandline","category-command-line","category-distros","category-linux-tools","category-ms-dos","category-open-source","category-windows-10","category-windows-console","category-windows-package-manager","category-windows-store","category-bash-on-ubuntu-on-windows","category-windows-terminal","tag-bash","tag-cmd","tag-color","tag-command-line","tag-console","tag-linux","tag-linuxtools","tag-ms-dos","tag-powershell","tag-terminal","tag-windows","tag-windows-10","tag-windows-package-manager","tag-winget","tag-winget-exe","tag-wsl"],"acf":[],"blog_post_summary":"<p>Windows Terminal comes with a lot of features that allow you to customize it and interact with it in a way that feels most comfortable to you. Let&#8217;s run through some tips and tricks that could help you set up your terminal in a way that&#8217;s perfect for you. At the time of this blog [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/6232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/users\/3539"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/comments?post=6232"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/6232\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media\/6237"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media?parent=6232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/categories?post=6232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/tags?post=6232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}