![`xdg-open` 认为我正在运行 WSL,但因为我没有运行而失败了?](https://linux22.com/image/1193093/%60xdg-open%60%20%E8%AE%A4%E4%B8%BA%E6%88%91%E6%AD%A3%E5%9C%A8%E8%BF%90%E8%A1%8C%20WSL%EF%BC%8C%E4%BD%86%E5%9B%A0%E4%B8%BA%E6%88%91%E6%B2%A1%E6%9C%89%E8%BF%90%E8%A1%8C%E8%80%8C%E5%A4%B1%E8%B4%A5%E4%BA%86%EF%BC%9F.png)
当我尝试使用 打开 pdf 文件时xdg-open file.pdf
,出现以下错误消息:
jonas@jonas-thinkpad:~$ xdg-open file.pdf
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
WSL Interopability is disabled. Please enable it before using WSL.
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
[error] WSL Interoperability is disabled. Please enable it before using WSL.
jonas@jonas-thinkpad:~$ /usr/bin/wslview: line 216: /mnt/c/Windows/System32/reg.exe: No such file or directory
/usr/bin/wslview: line 308: [: -ge: unary operator expected
[error] This protocol is not supported before version 1903.
由于某种原因,它试图进行 WSL 恶作剧?由于我不使用 Windows,我真的不明白为什么会发生这种情况。xdg
似乎配置为使用 okular 打开 pdf 文件:
jonas@jonas-thinkpad:~$ xdg-mime query default application/pdf
okularApplication_pdf.desktop
如下所示okularApplication_pdf.desktop
:
[Desktop Entry]
MimeType=application/pdf;application/x-gzpdf;application/x-bzpdf;application/x-wwf;
Terminal=false
Name=Okular
Name[ar]=اوكلار
Name[az]=Okular
--- omitted languages ---
Name[zh_TW]=文件檢視_Okular
GenericName=Document Viewer
GenericName[ar]=عارض المستندات
--- omitted languages ---
GenericName[zh_TW]=文件檢視器
Comment=Universal document viewer
Comment[ar]=عارض المستندات عالمي
--- omitted languages ---
Comment[zh_TW]=通用文件檢視器
Exec=okular %U
Icon=okular
Type=Application
InitialPreference=8
Categories=Qt;KDE;Graphics;Viewer;
X-KDE-Keywords=PDF, Portable Document Format
X-KDE-Keywords[ar]=PDF, Portable Document Format
--- omitted languages ---
X-KDE-Keywords[zh_TW]=PDF, Portable Document Format
NoDisplay=true
在我看来完全没问题。有谁知道这是怎么回事吗?