安装Windows Terminal
在Mircosoft Store可以安装 只有6M。
PowerShell 必备条件
使用 PowerShell,安装 Posh-Git 和 Oh-My-Posh:
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
提示
如果尚未安装 NuGet,可能需要安装它。 如果是这种情况,PowerShell 命令行会询问是否要安装 NuGet。 选择 [Y]“是”。 你可能还需要批准从不受信任的存储库 PSGallery 中安装模块。 选择 [Y]“是”。
Posh-Git 将 Git 状态信息添加到提示,并为 Git 命令、参数、远程和分支名称添加 tab 自动补全。 Oh-My-Posh 为 PowerShell 提示符提供主题功能。
之后使用 notepad $PROFILE
或所选的文本编辑器打开 PowerShell 配置文件, 它可能会提示你要新建一个文件 点 是
就行 在新建的文件里输入
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox
这样,在每次PoweShell打开的时候都能启用Paradox主题
配置setting.json
由于WT是开源的 所以我们可以对其进行配置。只需修改一些json~
下面的json是我的配置方案
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"confirmCloseAllTabs": false, // 隐藏关闭所有选项卡弹出窗口
"launchMode": "default", // 这将定义终端在启动时将采用最大化、全屏还是窗口形式 "default"、"maximized"、"fullscreen"
"initialPosition": "250,40", // 窗口打开的默认位置
"initialCols": 100, // 初始化窗口默认列数
"initialRows": 28, // 初始化窗口默认行数
"profiles":
{
"defaults":
{
// Put settings here that you want to apply to all profiles.
"fontFace": "Fira Code", // oh-my-posh 主题原因,使用其他的字体可能会出现乱码
"backgroundImage": "C:\\Users\\94393\\Pictures\\Saved Pictures\\20200715115029.jpg", // 背景图片地址
"backgroundImageOpacity": 0.5, // 透明度
"colorScheme" : "Slate", // 颜色方案
"acrylicOpacity": 0.7,
"useAcrylic":true
},
"list":
[
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "我爱你啊",
"commandline": "cmd.exe",
"icon": "C:\\Users\\94393\\Pictures\\Saved Pictures\\zzj.png",
"colorTheme": "Slate",
"startingDirectory": null, // 在文件夹地址栏输入wt即刻打开
"hidden": false
},
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}
]
}
"schemes": [
{
"name": "Slate",
"black": "#222222",
"red": "#e2a8bf",
"green": "#81d778",
"yellow": "#c4c9c0",
"blue": "#264b49",
"purple": "#a481d3",
"cyan": "#15ab9c",
"white": "#02c5e0",
"brightBlack": "#ffffff",
"brightRed": "#ffcdd9",
"brightGreen": "#beffa8",
"brightYellow": "#d0ccca",
"brightBlue": "#7ab0d2",
"brightPurple": "#c5a7d9",
"brightCyan": "#8cdfe0",
"brightWhite": "#e0e0e0",
"background": "#222222",
"foreground": "#35b1d2"
}
]
参数解读
fontFace
: 字体 可以去下载fairCode
下载地址 下载之后解压并安装 不会的 百度一下defaultProfile
:默认打开的profile 如果你要默认打开cmd ,需要找到list
->cmd
->guid
复制到defaultProfile的值里backgroundImage
: 窗口的背景图片,要使用绝对路径,并且下划线要转义colorScheme
: 颜色方案 选取地址 进去之后选择一个喜欢的主题 然后点击get theme
来到setting.json
文件 找到schemes数组,复制就ok!
总结
基础配置就这些啦,如果你还想配置的更好,你可以去看官方文档