I have spent two days configuring Terminal. Because I meet some issues. But I have been solved all. This is the final result.
If you like this, I will be sharing my configure methods.
First, you need to open Microsoft Store and search the terminal application program. doing download(Because my Microsoft have some unknown problem that I can't download it. But you could adopt another download method. There, I share a download link for you)
waiting for the install finished. You need to use an administrator authority setting terminal theme. the specific method is to press combination keyboard Ctrl + X and choice the Window PowerShell(Admin) option. then execute two lines of commands:
Install-Moduleposh-git
Install-Moduleoh-my-posh
notice:
If you have an error appear, you may not have configured the git environment. so you need to configure it first.
ok, next step, we need to configure Terminal's local file. Opening Terminal window and input command: $profile. It can print the file's absolute path.
Switching to the above path to find Microsoft.PowerShell_profile.ps1 file and open it with notepad. write three lines of codes and save them.
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme agnoster
If you have completed the above operations,you will see the effect. At the same time, The Terminal window display was garbled.
The reason is that the final version of Terminal didn't support the default font. so we need to download another font and configure it. There, choice font is Nerd Font.
After entering Nerd Font's official website, We could directly choose the corresponding version of the system to download, and we need to unpack the downloaded package. Then go to the folder and select all fonts to install.
when the installation is complete. you can go to the Fonts directory on disk C to see if it was successfully installed.
If you do this we can solve the garbled code problem by configuring the font.
First, we need to switch back to the Terminal window and click the ▽ icon, selected the Settings option. entering the settings desktop, and click the Open JSON file button. in this way, we can go to the settings.json file that belongs to it. then, we need to add a 'fontFace' field to the list and add the name of the font. I chose the font name is 3270Medium Nerd Font Complete.
Amazing!
At this point, we have completely solved the garbled code problem. the following, We will configure the background image to beautify it.
Before you start, you should prepare a image that you like. then, open settings.json again, adding 'backgroundImage' field into the list, and write the image's path. But we'd better enter the image'path manually.If you copy directly from the file properties, you may be get the following error.