Created
June 6, 2022 09:58
-
-
Save hellwolf/af459cc214415e9c3efc92b9eb78ad72 to your computer and use it in GitHub Desktop.
emacs browse-url for wsl
This file contains hidden or 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
(setq | |
browse-url-generic-program "/bin/sh" | |
browse-url-generic-args '("-c" "wslviewpath $@" "--") | |
browse-url-browser-function #'browse-url-generic) |
This file contains hidden or 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
#!/bin/sh | |
if [ -z "${1#file://*}" ];then | |
#echo "file _$@_" > ~/tmp/test.txt | |
wslview "$(wslpath -w "$(echo $1 | sed -E 's|^file://||')")" | |
else | |
#echo "other _$@_" > ~/tmp/test.txt | |
wslview "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment