Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 23, 2019 01:07 pm GMT

How to customize the new Windows Terminal with Visual Studio Code

A few days ago Microsoft released a very early version of the new Windows Terminal.
The Windows Terminal is a new, modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL.
Its main features include multiple tabs, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations.

Obviously, it's an opensource project hosted on GitHub: https://github.com/microsoft/terminal
Feel free to participate.

At the moment it's a little bit unstable and more features will come in the future, but I am using it for a few days and I like the idea.
Until now I using Cmder but Windows Terminal has some new promising features.

How to install

You can install Windows Terminal directly from the Windows Store or if you want to understand how it works, you can download the source, build it and launch the terminal.

The link for the Store version: https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701
The link for GitHub project: https://github.com/microsoft/terminal
The source code and the project are really well documented.

The first launch

If you launch the app from the Start Menu, it looks like in the screenshot below.

The default terminal is PowerShell.

If you click on the "+" symbol the application launch another terminal in a new tab.
If you click on the down arrow symbol , you can choose the new terminal from a list.

There is another interesting button below the list, the settings button.

Settings

If you click on the down arrow and after that click on the button "Settings", at the moment, the settings file (it's a JSON file) will be opened in a new instance of Visual Studio.
If you want, instead, open the file directly, you can open Visual Studio Code and open the file directly from the directory: %USERPROFILE%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState

In this file, you can find all settings for Windows Terminal.
At the moment you can interact with the settings only from this file but in the future, a UI will be added to the application.

Add new Profile

If you want to add a new profile, go the section "profiles" of the JSON settings file and add a new profile section like this below:

    {        "acrylicOpacity" : 0.85,        "background" : "#012456",        "backgroundImage" : "C:/users/barto/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/RoamingState/unicorn.gif",        "backgroundImageOpacity" : 0.7,        "backgroundImageStretchMode" : "uniformToFill",        "closeOnExit" : false,        "colorScheme" : "Solarized Dark",        "commandline" : "powershell.exe",        "cursorColor" : "#00FF00",        "cursorHeight" : 25,        "cursorShape" : "vintage",        "fontFace" : "Fira Code",        "fontSize" : 12,        "guid" : "{79285a8e-036c-446f-8a9c-78994e34bf78}",        "historySize" : 9001,        "icon" : "ms-appdata:///roaming/pwsh-32.png",        "name" : "PowerShell with Unicorn",        "padding" : "0, 0, 0, 0",        "snapOnInput" : true,        "startingDirectory" : "%USERPROFILE%",        "useAcrylic" : false    }

If you want to copy this section from here, pay attention to the guid.
Remember to change it every time you paste in the file.
It is used to set the default terminal, for example, and it must be unique in the file.

As you can see in my profile section, you can add an image as background, change the font size, the cursor shape and much more.
For example, I use Fira Code as font because I like it also in Visual Studio Code.
It adds some awesome experience in the text.
You can download it from here: https://github.com/tonsky/FiraCode

If you want to impress your friend or your attendees at a session, you can add a gif as a background.

You can see it in action on the image below.

Color Schemes

At the end of the profiles.json file, you can find a section called "schemes".
From here you can add or change the default colors of your terminal.
If you want to use it in your new profile, you have to insert the same scheme name in the property "name" and in the "colorScheme" property for the profile section.

Share your profiles

I created a new gist on my profile to share my profiles settings and you can find it here: https://gist.github.com/kasuken/076d68b92e2a67dfda591587c77a40c0#file-profiles-json.
Share your profiles in the comment!
Together we can create something awesome!


Original Link: https://dev.to/expertsinside/how-to-customize-the-new-windows-terminal-with-visual-studio-code-56b1

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To