Skip to content

Instantly share code, notes, and snippets.

@mojabyte
Last active September 23, 2023 17:41
Show Gist options
  • Save mojabyte/7cdebfd426319bb1dee4467ca703ce84 to your computer and use it in GitHub Desktop.
Save mojabyte/7cdebfd426319bb1dee4467ca703ce84 to your computer and use it in GitHub Desktop.
Open files, directories, and URL from WSL
# Add this function to ~/.bashrc
function open() {
cmd.exe /C start `wslpath -w "$1"`
}
alias openurl='cmd.exe /C start'
@mojabyte
Copy link
Author

mojabyte commented Sep 23, 2023

Usage examples:

$ open .
$ open ../../image.png
$ open ~/dir/other-dir
$ openurl https://example.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment