Open balaji-dutt opened 1 year ago
What happens if you run the commands mentioned in the logs directly eg emacs28 '/path/to/projects/hobbies.org'
Does anything run? Is an xserver or window server running correctly? This is a prerequisite
What happens if you run the commands mentioned in the logs directly eg
emacs28 '/path/to/projects/hobbies.org'
This works correctly if I run the command from a WSL2 terminal - see screenshots below:
Does anything run? Is an xserver or window server running correctly? This is a prerequisite
I have setup Open in WSL to use wslg
. I have tested opening an .org
file with "Open in WSL" while having a WSL2 terminal open but that does not seem to make a difference. GWSL
was throwing some errors so I wasn't able to try that option. I tried to open an .org
file with VcXsrv
and "Open in WSL" set to use "Other X Server" running but that did not work either.
Does any other file type work?
Does any other file type work?
Things seem to be getting worse :-(.
I tried to set "Open in WSL" as the default program for .patch
first and then for a dummy extension .ext
and then set gedit
as the associated program for both extensions in "Open in WSL". I created test.ext
using the following command $ echo "foo" > test.ext
.
For both .patch
and .ext
I'm seeing the following error:
2023-04-08 12:52:44,936 - OpenInWSL 1.7 MSIX - ERROR - Cannot Open extension error
Traceback (most recent call last):
File "main.py", line 2272, in <module>
File "main.py", line 515, in path_converter
IndexError: string index out of range
2023-04-08 12:53:14,075 - OpenInWSL 1.7 MSIX - ERROR - Cannot Open extension error
Traceback (most recent call last):
File "main.py", line 2272, in <module>
File "main.py", line 515, in path_converter
IndexError: string index out of range
2023-04-08 12:55:39,588 - OpenInWSL 1.7 MSIX - ERROR - Cannot Open extension error
Traceback (most recent call last):
File "main.py", line 2272, in <module>
File "main.py", line 515, in path_converter
IndexError: string index out of range
I tried to uninstall & reinstall Open in WSL via MS-Store but that does not seem to help as the settings/logs etc seem to persist between uninstalls.
Running gedit test.ext
or gedit file.patch
in a WSL2 terminal opens the file in gedit correctly.
Ok we are getting somewhere. There is probably an issue with openinwsl parsing the windows path. Could you post the path to the file censoring only the words but not the structure (eg spaces, slashes, drive, punctuation)?
Ok we are getting somewhere. There is probably an issue with openinwsl parsing the windows path. Could you post the path to the file censoring only the words but not the structure (eg spaces, slashes, drive, punctuation)?
Apologies I realized later that the string index out of range
error was due to my error. I was trying to open a file in the path \\wsl.localhost\Ubuntu-22.04\home\balaji\src\test.ext
.
However I do have some good news!
I copied the file test.ext
to the path C:\batch\test.ext
and when I double clicked on the file in this path, it opened correctly in gedit
. I also tested .org
files by copying hobbies.org
to C:\batch\hobbies.org
and that worked perfectly with emacs28
.
2023-04-09 16:24:50,826 - OpenInWSL 1.7 MSIX - INFO - RUN TEST: gedit /mnt/c/batch/test.ext
2023-04-09 16:28:04,428 - OpenInWSL 1.7 MSIX - INFO - RUN TEST: emacs28 /mnt/c/batch/hobbies.org
So indeed it appears that there's an issue with parsing the windows path in openinwsl.
Here is a lightly censored path to the original location of the hobbies.org
file: /mnt/c/balaji/xxxxxxx/notes & projects/projects/hobbies.org
. As before this fails without any real error in the logs, in fact it looks identical to the logs printed when I successfully opened the file from the path C:\batch\hobbies.org
2023-04-09 16:31:05,413 - OpenInWSL 1.7 MSIX - INFO - RUN TEST: emacs28 '/mnt/c/balaji/xxxxxxx/notes & projects/projects/hobbies.org'
Hi @Pololot64 I was wondering if you had any suggestions / updates on this issue?
Not yet. I have been doing exams. Well, I am a little confused about what the problem still is. I see that when the path is in Windows, it works properly. Is it only breaking when you use wsl paths like \wsl.localhost ?
Apologies if I've been unclear before. I will try and re-explain my current status:
I'm trying to open the file c:\balaji\xxxxxxx\notes & projects\projects\hobbies.org
from Windows Explorer by double-clicking on the file.
.org
files are set to open with OpenIn WSL
in Windows.OpenIn WSL
, .org
files are configured to open with emacs
When I double-click the file c:\balaji\xxxxxxx\notes & projects\projects\hobbies.org
, I see the ".org >>>>" pop-up in Windows, but the file does not open.
OpenIn WSL
log file is as follows:
2023-04-09 16:31:05,413 - OpenInWSL 1.7 MSIX - INFO - RUN TEST: emacs28 '/mnt/c/balaji/xxxxxxx/notes & projects/projects/hobbies.org'
If I copy the file c:\balaji\xxxxxxx\notes & projects\projects\hobbies.org
to a different path with no spaces in the path, for example, c:\batch\hobbies.org
, an emacs
window does appear with the file open as expected.
2023-04-09 16:28:04,428 - OpenInWSL 1.7 MSIX - INFO - RUN TEST: emacs28 /mnt/c/batch/hobbies.org
The only time I saw an actual error message was when I tried to open a file from \\wsl.localhost\Ubuntu-22.04\home\balaji\src\test.ext
in Windows Explorer. I'm not sure that this type of UNC path is supported and hence would believe this particular error is not relevant to the problem mentioned above.
I see. In that case my second theory is that it is the "&" symbol in the path. When I convert the path to a Linux path and pass it through windows to Linux, it is parsed so many times that it is impossible to escape all special characters.
I see. In that case my second theory is that it is the "&" symbol in the path
Is that something that can be supported through an enhancement to "OpenIn WSL"?
It would probably be possible to make a fix that fixes this special case but it would probably not scale well..
Ah I see. Well this is pretty disappointing news ☹️
Again however, if this is extremely important feel free to email me and I can try to build you a version that fixes this. Also, theoretically when I am done with school I can make it try to escape everything but that will be hard to predict and plan for.
Again however, if this is extremely important feel free to email me and I can try to build you a version that fixes this. Also, theoretically when I am done with school I can make it try to escape everything but that will be hard to predict and plan for.
Hi @Pololot64 I have emailed you on your opticosstudios
address on this.
I'll get back to you
Hi,
I'm trying to open
.org
mode files using programs installed in WSL2 on Windows 10. I have tried this with bothemacs
and then for debugging withgedit
but this does not seem to work. I have also tried switching the Graphical Backend betweenGWSL
andwslg
but there's no change.Here is what I'm doing:
Set file association for
.org
in OpeninWSL to gedit:Set file association for
.org
file in Windows Explorer to "OpeninWSL"Double click on a file
hobbies.org
in Windows Explorer.What I expect to see
gedit
window will open with the file.What happens instead:
Logs:
Version Info
Ubuntu 22.04 running in WSL2/Windows 10 Open in WSL: 1.7 MSIX GWSL: 1.4.5 (Store)