• If you use a Shell
  • If you like to push
  • If you like to play around

preface

In the actual use process, the author does not use shell heavily, just knock on the general command line, as a veteran Windows user has long been used to GUI side (mud). But no matter how occasionally I use the command line, I want it to be a refined experience every time. Yes, it is the appearance level of Windows Terminal that attracts me.

To prepare

  • Windows TerminalMicrosoft StoreDownload and install
  • PowerShell 7 Here to downloadThe latest versionmsiInstalled directly
  • Fira Code Nerd Font

beautify

oh-my-posh

Oh-my-posh is a shell theme engine that comes with multiple good-looking themes built in

Install in Powershell,

Install-Module oh-my-posh -Scope CurrentUser
Copy the code

View all built-in themes,

Get-PoshThemes
Copy the code

Choose a theme,

Set-PoshPrompt -Theme ys
Copy the code

But this is only a one-time setup. To use the selected theme every time you open PowerShell, you need to open profile.

notepad $Profile
Copy the code

Add the following command to the profile and save

#Introduction of oh - my - posh
Import-Module oh-my-posh

#Set the PowerShell theme
Set-PoshPrompt -Theme ys
Copy the code

PSReadline

PSReadline is an enhanced tool for Powershell that makes it easier to operate the command line

Install in Powershell,

Install-Module PSReadline -Scope CurrentUser
Copy the code

Open profile for configuration

notepad $Profile
Copy the code

Add the following command and save

#The introduction of ps - read - line
Import-Module PSReadLine

#Set the prediction text source to history
Set-PSReadLineOption -PredictionSource History

#Each time you retrace the input history, the cursor is positioned at the end of the input
Set-PSReadLineOption -HistorySearchCursorMovesToEnd

#Set Tab to menu completion and Intellisense
Set-PSReadLineKeyHandler -Key "Tab" -Function MenuComplete
Copy the code

Windows Terminal set

Go to Windows Terminal – Settings – open the JSON file, find Schemes and add a new color theme Gruvbox Dark and more themes

"schemes"{: [..."background": "#1E1E1E"."black": "#1E1E1E"."blue": "# 377375"."brightBlack": "#7F7061"."brightBlue": "# 719586"."brightCyan": "#7DB669"."brightGreen": "#AAB01E"."brightPurple": "#C77089"."brightRed": "#F73028"."brightWhite": "#E6D4A3"."brightYellow": "#F7B125"."cursorColor": "#E6D4A3"."cyan": "#578E57"."foreground": "#E6D4A3"."green": "# 868715"."name": "Gruvbox Dark"."purple": "#A04B73"."red": "#BE0F17"."selectionBackground": "#E6D4A3"."white": "# 978771"."yellow": "#CC881A"}]Copy the code

Set up powerShell color themes, fonts, background images, frosted glass effects, etc. Find PowerShell under the Profiles node

"profiles": {
    "defaults": {},
    "list"{: [..."acrylicOpacity": 0.5."backgroundImage": "C:\\Users\\SeanS\\Pictures\\Background\\win10_purple.png"."backgroundImageOpacity": 0.3."backgroundImageStretchMode": "uniformToFill"."colorScheme": "Gruvbox Dark"."cursorColor": "#FFFFFF"."cursorShape": "underscore"."fontFace": "FiraCode Nerd Font"."fontSize": 12."fontWeight": "normal"."guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}"."hidden": false."name": "PowerShell"."source": "Windows.Terminal.PowershellCore"}... ] }Copy the code

The end result,

conclusion

Simple beautification, get rid of the original Powershell blue and white boring, hope to use shell more