WSL optimization (Windows Subsystem for Linux) Linux subsystem optimization configuration

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

  1. win+rEnter regedit to open the registry and find计算机\HKEY_CURRENT_USER\Console

  2. Find ***_ubuntu.exe from it
  3. Modify or create CodePageand FaceNametwo key-value pairs, CodePageset to 437, FaceName set to Consolas(font name)
  4. 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 ~/.bashrcto refresh the configuration

The effect is as shown in the figure:

3. Add WSL to the context menu

  1. First win+renter regedit to open the registry and find计算机\HKEY_CLASSES_ROOT\Directory\Background\shell

  2. 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)

  3. Click Bash Here, right-click to create a new one in the right window 字符串值, the name is Icon, double-click to change the value to the location of the icon you want, which can be *.ico or *.exe

  4. Create a new item under Bash Here, name it , and change the default valuecommand of this item to the address of the Ubuntu.exe or bash.exe file.

  5. At this point, right-click on the desktop to see Bash Here.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325281490&siteId=291194637