Loading... 本篇仅为我个人的设置备份,主要是越学习,越是察觉到自己的无知,所以没有太多时间来详细的介绍设置选项,基本上我已经在主要设置上添加了备注,各位根据喜好自行修改。背景图是拿Pixiv的图自己扣的,需要的在下方自取。 Windows自带的**CMD**以及**Powershell**界面着实是太*丑*了,对比上Linux上的终端界面简直就是上世纪的产物。不过微软提供了**Windows Terminal**,支持CMD、Powershell、Wsl,本人许多操作都需要在终端中完成,原本那蓝色界面辣眼睛,学习时心情也很重要,好看的UI能提高效率,所以为此折腾也是值得的。 ## Windows Terminal 打开应用商店,搜索 `Windows Terminal`并下载安装,接下来搜索`更纱黑体`并下载安装。 微软的应用商店正在逐渐完善,我目前通过Scoop+应用商店,已经覆盖了95%我使用的软件,同时再也不用为更新软件而发愁了,这一点值得点赞。  接下来打开设置,复制粘贴`"profiles":`字段以及`"schemes":`字段 ```json "profiles": { "defaults": { "acrylicOpacity": 0.75, //背景透明度(0-1) "useAcrylic": true, // 启用毛玻璃 "backgroundImage": "终端.png", //请补充路径背景图片 "backgroundImageOpacity": 0.7, //图片透明度(0-1) "antialiasingMode": "cleartype", //消除文字锯齿 "backGroundImageStretchMode": "uniformToFill", //填充模式 "fontFace": "Sarasa Term SC", //字体 "fontSize": 12, //文字大小 "colorScheme": "Solarized Darcula", //主题名字 "cursorColor": "#FFFFFF", //光标颜色 "cursorShape": "bar" //光标形状 }, "list": [ { // Make changes here to the powershell.exe profile. "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false }, { // Make changes here to the cmd.exe profile. "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "命令提示符", "commandline": "cmd.exe", "hidden": false }, { "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", "hidden": false, "name": "Azure Cloud Shell", "source": "Windows.Terminal.Azure" } ] }, // Add custom color schemes to this array. // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes "schemes": [ { "name": "Solarized Darcula", "black": "#25292a", "red": "#f24840", "green": "#629655", "yellow": "#b68800", "blue": "#2075c7", "purple": "#797fd4", "cyan": "#15968d", "white": "#d2d8d9", "brightBlack": "#25292a", "brightRed": "#f24840", "brightGreen": "#629655", "brightYellow": "#b68800", "brightBlue": "#2075c7", "brightPurple": "#797fd4", "brightCyan": "#15968d", "brightWhite": "#d2d8d9", "background": "#3d3f41", "foreground": "#d2d8d9" } ], ``` 最后再根据自己实际需求,填写**背景图片**的地址即可。 附上我使用的背景图片:  到这里,Windows Terminal的设置就告一段落,接下来我们再对Powershell进行进一步的优化。 ## 优化Powershell 首先运行以下三行代码安装Powershell模块,请自行保证网络通畅。 ```shell Install-Module posh-git -Scope CurrentUser Install-Module DirColors -Scope CurrentUser Install-Module oh-my-posh -Scope CurrentUser ``` 接下来输入 `code $profile`,这一步需要已经安装vscode,如果没安装将`code`替换成`notepad`,贴入以下内容。 ```shell Import-Module DirColors Import-Module posh-git Import-Module oh-my-posh Set-PoshPrompt -Theme powerline ``` 我的设置基本上到这里就结束了。 最后晒一张Winfetch:  最后修改:2021 年 03 月 13 日 04 : 02 PM © 允许规范转载 赞赏 如果觉得我的文章对你有用,请随意赞赏 ×Close 赞赏作者 扫一扫支付 支付宝支付 微信支付
2 条评论
好厉害呀!直接通过邮箱获取头像,喜欢千影大佬写的脚本,对我帮助很大呢!
好漂亮呀!千影酱真的好可爱