当前位置:网站首页>Win10 terminal + WSL 2 installation and configuration guide, exquisite development experience
Win10 terminal + WSL 2 installation and configuration guide, exquisite development experience
2020-11-08 10:35:00 【Oso eijo4qvb】
since Windows Terminal It hasn't been used since it was officially released Windows The system has its own terminal . Mainly Terminal Simple and flexible , More importantly, it supports special Fonts , Through some simple configuration, it can make the terminal look more comfortable and eye-catching .
since Win 10 With Linux Subsystem (WSL), It's been on the computer for a long time vmware The virtual machine software is unloaded .WSL Good experience , Who knows .
Let's first show you my personal configuration renderings :
install WSL 2
WSL,Windows Subsystem for Linux( Apply to Linux Of Windows Subsystem ) Abbreviation . It has two versions ,WSL 1 and WSL 2. It is recommended to use WSL 2, It has better overall performance .
install WSL 2, For different architectures CUP Different Win10 Version for . For the sake of simplicity , You just need to make sure your Win10 The version number is 2004( Internal version 19041 Or higher ) that will do .PS: Use win + r
Input winver
You can quickly view Windows edition .
If your Win10 Version number is lower than 2004, You can use Windows 10 Easy lift tool manual upgrade . download Windows 10 Easy lift tool :
https://www.microsoft.com/zh-cn/software-download/windows10
Download and double-click to run , Wait for the upgrade to complete ( The upgrade process is quite long ).
install WSL 2 Before , Must enable “ Virtual machine platform ” Optional features . Open as Administrator PowerShell, Execute the following command :
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Next you need to install Linux Distribution version . Open the Microsoft app store , Search for Ubuntu, Select the latest long-term support version from the list 20.04 LTS And install .
Use any terminal , Enter the following command to view WSL edition , Make sure WSL The version is 2.0:
$ wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Stopped 2
If you have installed before WSL, Not at present WSL 2 edition , You can set it with the following command WSL Default version :
wsl --set-version Ubuntu-20.04 2
PS: from WSL 1 Update to WSL 2 It may take a few minutes to complete , Depending on the size of the target distribution .
install Terminal
Open the Microsoft app store , Search for “Terminal”, install , The open interface looks like this :
By default, it is turned on PownerShell terminal , We can set it on by default Ubuntu terminal . Click on the drop-down triangle to the right of the tab , Select Settings :
Will open a JSON The configuration file , stay profiles->list
Find Ubuntu Of guid And copy .
Paste it at the beginning of the file defaultProfile
Value :
install oh-my-zsh
We need to install some extra fonts to support oh-my-zsh Show special symbols . open PowerShell, Execute the following commands in turn Powerline Font set :
git clone https://github.com/powerline/fonts.git
cd fonts
.\install.ps1
Then install zsh:
sudo apt update
sudo apt install git zsh -y
Install again oh-my-zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
If the following error is reported in this step :
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
There are many solutions , Please resolve by yourself .
installed oh-my-zsh after , edit ~/.zshrc
file , Set the theme to agnoster
:
Open again Terminal Of JSON The configuration file , stay schemes
Add a theme to , The subject name is optional , Here for wsl2
:
"schemes": [
{
"name" : "wsl2",
"background" : "#002B36",
"black" : "#002B36",
"blue" : "#268BD2",
"brightBlack" : "#657B83",
"brightBlue" : "#839496",
"brightCyan" : "#D33682",
"brightGreen" : "#B58900",
"brightPurple" : "#EEE8D5",
"brightRed" : "#CB4B16",
"brightWhite" : "#FDF6E3",
"brightYellow" : "#586E75",
"cyan" : "#2AA198",
"foreground" : "#93A1A1",
"green" : "#859900",
"purple" : "#6C71C4",
"red" : "#DC322F",
"white" : "#93A1A1",
"yellow" : "#B58900"
}
],
Then in the JSON File the wsl The theme of the terminal is set to wsl2
The theme , And change the font to one you like Powerline typeface :
The last step , And a little bit of beautification : Remove the machine name from the command line , And adjust the background color of the user name . edit agnoster topic file :
vi ~/.oh-my-zsh/themes/agnoster.zsh-theme
hold 92 Change the line to :
prompt_segment green black "%(!.%{%F{yellow}%}.)%n"
Revised as follows :
close Terminal Open it again , The effect is as follows :
Configuration complete !
Of course , You can go, too Google My favorite theme , For example, brighter Dracula The theme :
If you encounter problems in the installation and configuration process , Please leave a message .
-
Exquisite manor
Give you insight into programming and Architecture
↑ Long press the picture Identify QR code Focus on , Don't miss the fate of meeting on the Internet
版权声明
本文为[Oso eijo4qvb]所创,转载请带上原文链接,感谢
边栏推荐
- 来自不同行业领域的50多个对象检测数据集
- Japan PSE certification
- [data structure Python description] use hash table to manually implement a dictionary class based on Python interpreter
- 洞察——风格注意力网络(SANet)在任意风格迁移中的应用
- 你搞不懂与别人的差距,永远成不了架构师!月薪15K和月薪65K,你差在那了?
- [summary series] technical system of Internet server: high performance database index
- Adobe Lightroom /Lr 2021软件安装包(附安装教程)
- NOIP 2012 提高组 复赛 第一天 第二题 国王游戏 game 数学推导 AC代码(高精度 低精度 乘 除 比较)+60代码(long long)+20分代码(全排列+深搜dfs)
- IQKeyboardManager 源代码看看
- Julia 是如何风靡起来的?
猜你喜欢
ArrayList源码分析
攻防世界之web新手题
Analysis of ArrayList source code
Dogs can also operate drones! You're right, but it's actually an autonomous drone - you know
vivoY73s和vivoY70s的区别 vivoY73s和vivoY70s哪个值得入手
211考研失败后,熬夜了两个月拿下字节offer!【面经分享】
Deeplight Technology Bluetooth protocol SRRC certification services
python_scrapy_房天下
盘点那些你没想到的云计算应用场景(上)
laravel8更新之速率限制改进
随机推荐
How does spotify drive data-driven decision making?
Oops, the system is under attack again
print( 'Hello,NumPy!' )
IQKeyboardManager 源代码看看
sed之查找替换
不多不少,大学里必做的五件事(从我的大一说起)
为 Docsify 自动生成 RSS 订阅
Recommend an economic science video, very valuable!
ASP.NET A complete solution based on exception handling in MVC
数据科学面试应关注的6个要点
5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award
攻防世界之web新手题
[data structure Python description] use hash table to manually implement a dictionary class based on Python interpreter
YGC问题排查,又让我涨姿势了!
Istio流量管理--Ingress Gateway
If you don't understand the gap with others, you will never become an architect! What's the difference between a monthly salary of 15K and a monthly salary of 65K?
笔试面试题目:求缺失的最小正整数
How TCP protocol ensures reliable transmission
来自不同行业领域的50多个对象检测数据集
Personal current technology stack