windows terminal 个人配置
之前参考一些网站配置了个人感觉比较好看的windows terminal,特地记录下来方便下次配置
一、Microsoft Store下载软件
powershell
非电脑原来自带的,感觉更新点。
windows terminal
二、安装choco
一个管理包的工具,方便更新cmake、gcc、字体等不会自动更新的软件
powershell输入
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
三、设置powershell管理员权限
安装gsudo
choco install gsudo
修改Windows terminal设置
修改命令行如下
-nologo
可以使得在启动时直接显示输入栏,不显示其他信息
四、安装oh-my-posh
可选择powershell主题
输入
Install-Module posh-git
Install-Module oh-my-posh
输入 code $PROFILE
,粘贴
#------------------------------- Import Modules BEGIN -------------------------------
# 设置 PowerShell 主题
Set-PoshPrompt -Theme Paradox
#------------------------------- Import Modules END -------------------------------
# 设置 Tab 键补全
Set-PSReadlineKeyHandler -Key Tab -Function Complete
#requires -Version 2.0 -Modules PowerShellGet
function Remove-OldModules
{
<#
<#
Author: Luke Murray (Luke.Geek.NZ)
Version: 0.1
Purpose: Basic function to remove old PowerShell modules which are installed
#>
#>
$Latest = Get-InstalledModule
foreach ($module in $Latest) {
Write-Verbose -Message "Uninstalling old versions of $($module.Name) [latest is $( $module.Version)]" -Verbose
Get-InstalledModule -Name $module.Name -AllVersions | Where-Object {$_.Version -ne $module.Version} | Uninstall-Module -Verbose
}
}
五、修改Windows terminal设置
默认启动powershell
修改终端配色
修改终端字体
GitHub下载地址
记得保存