工欲善其事,必先利其器

  • 升级Windows10到1903并下载Windows Terminal
    分享下我的配置 profiles.json

  • 设置WSL为版本2

  • 添加右键打开,注册表写入更改下面的名字哦

    Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Bash]@="Bash here"[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\Bash\command]@="C:\\Users\\[your-name]\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\wt.exe"[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Bash]@="Bash here"[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Bash\command]@="C:\\Users\\[your-name]\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\wt.exe"

  • 在添加~/.bashrc中添加

    export windows_host=`ipconfig.exe | grep -n4 WSL  | tail -n 1 | awk -F":" '{ print $2 }'  | sed 's/^[ \r\n\t]*//;s/[ \r\n\t]*$//'`export ALL_PROXY=socks5://$windows_host:1080export HTTP_PROXY=$ALL_PROXYexport http_proxy=$ALL_PROXYexport HTTPS_PROXY=$ALL_PROXYexport https_proxy=$ALL_PROXYif [ "`git config --global --get proxy.https`" != "socks5://$windows_host:1080" ]; then    git config --global proxy.https socks5://$windows_host:1080fi#重写cd# cd C:\\ 自动切换到 /mnt/cfunction cd() {    command cd `wslpath "$1"`}                         
  • 这样,最好的Linux发行版Windows 10就配置好了 ????