Skip to content

Instantly share code, notes, and snippets.

@SirJson
Created February 19, 2020 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SirJson/525ac5d9a2845638ab0f7ae94feaf91d to your computer and use it in GitHub Desktop.
Save SirJson/525ac5d9a2845638ab0f7ae94feaf91d to your computer and use it in GitHub Desktop.
A WSL replacement for xdg-open
#!/bin/bash
if [[ ! -f /proc/version ]] && grep -Pq '[Mm]?icrosoft' /proc/version; then
echo "Only works with WSL"
exit 1
fi
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Start-Process -FilePath "$@" -Verb open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment