wsl optimization (Windows Subsystem for Linux) Linux subsystem optimization
1. Modify wsl terminal font
a. Temporary
After opening wsl, click the icon in the upper left corner, select "Properties", and select the font in the pop-up window to modify.
b. Permanent
win+r
Enter regedit to open the registry and find计算机\HKEY_CURRENT_USER\Console
- Find ***_ubuntu.exe from it
- Modify or create
CodePage
andFaceName
two key-value pairs,CodePage
set to 437, FaceName set toConsolas
(font name)
After the change, open wsl and find that the font has been permanently changed
2. Modify the color of the Linux terminal
Open a Linux terminal (or wsl terminal) and entervim ~/.bashrc
add in itPS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\][\u@\h]\[\033[00m\]:\[\033[01;35m\]\w\[\033[00m\]\$"
:wq save and enter source ~/.bashrc
to refresh the configuration
The effect is as shown in the figure:
3. Add WSL to the context menu
First
win+r
enter regedit to open the registry and find计算机\HKEY_CLASSES_ROOT\Directory\Background\shell
Right-click on the shell folder to create a new item with the name
Bash Here
(Bash Here here will be displayed in the right-click menu in the future)Click Bash Here, right-click to create a new one in the right window
字符串值
, the name isIcon
, double-click to change the value to the location of the icon you want, which can be *.ico or *.exe
Create a new item under Bash Here, name it , and change the default value
command
of this item to the address of the Ubuntu.exe or bash.exe file.
At this point, right-click on the desktop to see Bash Here.