First of thanks for sharing your dotfiles, it's been a major source of inspiration to setup my WSL2 machine lately.
So, I tried using the normalised open(line #144 of the .functions file) code snippet on a WSL2 Ubuntu distro & it won't work as expected. I suspect grep can't read the /proc/version file due to missing sudo privileges(?). I bet a better solution would be to grep the output of uname -r which doesn't require sudo privileges.
A possible "better" solution could be:
if [ ! $(uname -s) = 'Darwin' ]; then
if [ $(uname -r | grep -i 'microsoft') ]; then
# Ubuntu on Windows using the Linux subsystem
alias open='explorer.exe';
else
alias open='xdg-open';
fi
fi
EDIT: Provided a "better" solution & I don't mind opening a PR with the above changes 😄
First of thanks for sharing your dotfiles, it's been a major source of inspiration to setup my WSL2 machine lately.
So, I tried using the normalised
open
(line #144 of the.functions
file) code snippet on a WSL2 Ubuntu distro & it won't work as expected. I suspectgrep
can't read the/proc/version
file due to missingsudo
privileges(?). I bet a better solution would be togrep
the output ofuname -r
which doesn't requiresudo
privileges.A possible "better" solution could be:
EDIT: Provided a "better" solution & I don't mind opening a PR with the above changes 😄