若是WSL1,添加
export DISPLAY="127.0.0.1:0"
若是WSL2,使用脚本自动获取IP
export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"