You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Emacs on Windows to work on files in a WSL virtual machine. Windows maps the WSL's directory structure into a virtual network drive at //wsl$/Ubuntu-20.04/home/.... However, running ag on such a path has two issues:
CMD.exe prints an error message that it can't be invoked in a UNC path (such as //wsl$)
ag reports paths as starting with /wsl$/ instead of //wsl$/, which dumb-jump interprets as a path relative to PWD instead of an absolute path.
At the moment, I'm using the following workaround:
(defunfix-WSL-errors (orig-funresp&restargs)
(let* (;; CMD.exe likes to inject a useless error message, so filter it out:
(filtered (replace-regexp-in-string"'[^']+'\nCMD.EXE was started with the above path as the current directory.\nUNC paths are not supported. Defaulting to Windows directory.\n""" resp))
;; for some reason, ag returns paths as /wsl$/... instead of //wsl$/..., which;; dumb-jump interprets as a relative path instead of an absolute one,;; so fix that:
(fixed (replace-regexp-in-string"^\\\\wsl\\$""\\\\\\\\wsl$" filtered)))
(apply orig-fun fixed args)))
(advice-add'dumb-jump-parse-ag-response:around#'fix-WSL-errors)
I don't know if that's something dumb-jump can fix, or if this needs to be forwarded to ag or indeed Microsoft.
The text was updated successfully, but these errors were encountered:
bastibe
changed the title
Dumb-jump does not work if Emacs opens a WSL file
Dumb-jump in Windows Emacs with WSL files does not jump correctly
Jan 11, 2023
I'm using Emacs on Windows to work on files in a WSL virtual machine. Windows maps the WSL's directory structure into a virtual network drive at
//wsl$/Ubuntu-20.04/home/...
. However, runningag
on such a path has two issues://wsl$
)/wsl$/
instead of//wsl$/
, which dumb-jump interprets as a path relative to PWD instead of an absolute path.At the moment, I'm using the following workaround:
I don't know if that's something dumb-jump can fix, or if this needs to be forwarded to
ag
or indeed Microsoft.The text was updated successfully, but these errors were encountered: