Skip to content

Instantly share code, notes, and snippets.

@zpp0196
Created April 15, 2021 04:14
Show Gist options
  • Save zpp0196/4e2a7452e081159e6698f93b5f9803fa to your computer and use it in GitHub Desktop.
Save zpp0196/4e2a7452e081159e6698f93b5f9803fa to your computer and use it in GitHub Desktop.
ssh 连接 WSL 后添加 Windows 环境变量
function _add_win_paths() {
local _win_paths=(
/mnt/c/Windows/
/mnt/c/Windows/system32/
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/
/mnt/d/Program\ Files/Microsoft\ VS\ Code/bin/
/mnt/d/Users/$USER/AppData/Android/Sdk/platform-tools/
)
for p in $_win_paths; do
export PATH=$PATH:$p
done
}
[[ -n $SSH_TTY ]] && _add_win_paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment