Created
February 15, 2023 05:15
-
-
Save benburrill/ad574a18dae9f9b92ff7421ebc5f3013 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Works around exes taking 10 seconds to start in the WSL if launched | |
# with a PWD that is in the linux filesystem. | |
old_pwd="$PWD" | |
# The <CommandParameters> seem to get concatenated together if you pass | |
# them to powershell, and I can't easily get proper escaping to work, so | |
# I'm just wrapping things in ' so it will at least you can have spaces. | |
cd /mnt/c && exec 'powershell.exe' '-Command' "Start-Process -WorkingDirectory$(printf " '%s'" "$(wslpath -w "$old_pwd")")$(printf " '%s'" "$@")" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment