Wizard
Wizard

Reputation: 22113

wsl2-GUI-emacs open file with explorer.exe instead of xdg-open

I am working on wsl2+emacs GUI version with VcxSrv window manager server.

Within the GUI version, emacs does not open files with windows-app as it does in wsl2-terminal-emacs.

Take an example:

on dired window, I strike key & invoking dired-do-async-shell-command to open file "demestic.01.pdf";

it prompt to run with "xdg-open" rather than "explorer.exe".

Is it possible to replace "xdg-open" with "explorer.exe"?

enter image description here

Upvotes: 0

Views: 831

Answers (1)

VPraharsha
VPraharsha

Reputation: 384

EDIT: You can take a look at wslview which is a part of wslu (it ships with latest versions of Ubuntu distro) and is a better alternative. wslview will try to detect the protocol used(file:, http:, https:), check whether it is a Linux path or Windows path, translate it to the proper form and open the file/folder/link.

And if you want everything to be opened in Windows, just create a link:

sudo ln -s ../../bin/wslview /usr/local/bin/xdg-open

So, whenever xdg-open is invoked, everything would open up in Windows

Upvotes: 2

Related Questions