前言
突然想起之前很火的windows terminal,可以美化背景并且在windows上实现bash命令,于是查询网上资料简单搞一搞。
下载windows terminal
去直接去微软商店进行下载(不要选Windows terminal preview)
安装WSL(windows Sbsystem for linux)
WSL是windows开发且不需要安装虚拟机就可以实现linux命令行的功能
安装前提
1、CPU的虚拟机功能
2、WSL功能---在windows features(启用或关闭windows功能)中打开
选择后自动安装,并且需要重启电脑
安装ubuntu
同样在微软商店直接搜索ubuntu进行下载
下载完成,打开此时会看到初始化安装,几分钟时间后,会提示你设置linux用户的账户和密码
设置完成
windows terminal美化
点击下箭头按钮可以看到设置
左边下面有打开json文件---setting.json,用vscode(文本编辑器都可以)默认打开
配置参数主要有:
profiles参数---配置每个终端的guid,路径,颜色背景
schemes:颜色背景
keybinds:快捷键设置
我们修改profils参数即可,defaults是对所有终端起作用的设置,list是对不同terminal进行设置
"profiles":
{
"defaults": {
"background": "#3b6677",
"backgroundImage":"C:\\Users\\lin_yi\\Pictures\\Saved Pictures\\haizei.jpg",
"backgroundImageOpacity": 0.1
},
"list":
[
{
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
{
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "\u547d\u4ee4\u63d0\u793a\u7b26"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{51855cb2-8cce-5362-8f54-464b92b32386}",
"hidden": false,
"name": "Ubuntu",
"source": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc"
},
{
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": true,
"name": "Ubuntu",
"source": "Windows.Terminal.Wsl"
}
]
},
这里我们直接应用于全部terminal,以下是我的设置(放到default),分别是背景颜色,背景图片,图片透明度(越小越透明),注意路径要用“\\”分割不同目录。
"background": "#3B6677",
"backgroundImage":"C:\\Users\\lin_yi\\Pictures\\Saved Pictures\\haizei.jpg",
"backgroundImageOpacity": 0.1
帅气的lufi酱就有了