-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview not opening in Windows WSL subsystem #5
Comments
Thanks for the report. I don't have easy access to a Windows system unfortunately. Can you say more precisely what isn't working? My impression was that other users managed with WSL. You run the run texpresso command and nothing happens? Did you set the path to texpresso correctly in settings? |
@DominikPeters Thank you for your work! For both paths |
I tried the same and did not manage to get it to work on WSL. Seems like texpresso in WSL cannot be opened from Windows VSCode. My current workaround is installing VSCode inside WSL aswell, so @sambaPython24 might want to check out. Downside is obviously that you don't get to use your existing VSCode setup, but for me installing Latex Workshop and this plugin in a new setup was fine. |
Thanks @wu7zh for suggesting this. It might be possible by doing something like what's suggested in this stackoverflow answer for how to spawn a WSL command from node, and appropriately adjust it in the extension code here: texpresso-vscode/src/extension.ts Line 66 in 61e519f
But it's difficult for me to play with this. Can you tell me with what command it is possible to start |
It should now be working (extension version v1.5.1), with the new |
It would be useful to know if it works now for other people, I hope it does but am not completely sure how robust it is. |
@DominikPeters In my condition, this extention still can't find // texpresso settings
"texpresso.useWSL": true,
"texpresso.command": "/home/<name>/texpresso/build/texpresso", and when click TeXpresso command '/home/<name>/texpresso/build/texpresso' does not exist or is not executable. Please check the 'texpresso.command' setting. but this path is right. When i install console.ts:137 [Extension Host] /bin/sh: line 1: wsl: command not found
TeXpresso command '/home/<name>/texpresso/build/texpresso' does not exist or is not executable. Please check the 'texpresso.command' setting. I have no idea how to deal with it. If additional information needed, i am willing to provide. |
Thanks for reporting. Unfortunately, I usually do not have easy access to a Windows machine to try things out myself. Could you run the following in the command line from outside WSL and tell me what happens?
and
|
@DominikPeters My $ uname -r
6.6.36.3-microsoft-standard-WSL2
$ lsb_release -a
LSB Version: n/a
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a I will use
wsl -e test -x /home/<name>/texpresso/build/texpresso Nothing happens and there is no output and log message.
wsl -e /home/<name>/texpresso/build/texpresso
[info] working directory: /mnt/c/Users/PC/Desktop
[info] executable path: /home/<name>/texpresso/build/texpresso
Usage: texpresso [-I path]* [-json] root_file.tex Additionally, when i run $ /home/<name>/texpresso/build/texpresso
[info] working directory: /home/<name>
[info] executable path: /home/<name>/texpresso/build/texpresso
Usage: texpresso [-I path]* [-json] root_file.tex |
A few colleagues of me are now using it on their Windows machines, and for them everything works fine. I set it up for them on a fresh WSL install using default settings, and the WSL option works using the path "/home//texpresso/build/texpresso". @zongpingding My guess is it has something to do with your WSL config. Can you try on a standard WSL install using the default Ubuntu system? |
@wu7zh I have installed $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
$ /home/<name>/texpresso/build/texpresso
[info] working directory: /home/<name>/texpresso
[info] executable path: /home/<name>/texpresso/build/texpresso
Usage: texpresso [-I path]* [-json] root_file.tex and build Configuration of this extension is: "texpresso.useWSL": true,
"texpresso.command": "/home/<name>/texpresso/build/texpresso", but the problem persist. If this is due to my wsl config, the only problem will be in WSL config file
There is no default
TeXPresso info:
It is weird. |
Even though I set all paths ( User / Remote [WSL:Ubuntu] / Workspace ) to /home/texpresso/build, I get the error that
The WSL version is: (wsl --version)
Would the people for which it is working also share their WSL configuration? |
What the extension does is call the texpresso-vscode/src/extension.ts Lines 53 to 59 in 5aa1a0f
otherwise, it displays the error message you are seeing. In principle, it could be that the test command fails when the actual command would in fact work. If you feel comfortable, you could try building the extension locally so you can change the code (e.g. comment out the test whether the command exists) and see if you can get it to run. (Clone the repo, run |
@sambaPython24 '/home/texpresso/build/texpresso' is likely the wrong path. |
@wu7zh I was trying to recreate your path and running the test @DominikPeters Thank you for that detailed description. When I see the command, I see that you call wsl which appears to mean that you run it from Windows. Do you open open VS-Code in Windows and use your extension by running (Texpresso: Start Document) or do you open VS-Code, connect to WSL within VSCode and then run the command? Given the first option, do you need the execution path relative to WSL (after it has been compiled in WSL) or relative to Windows? |
Yes, the |
@DominikPeters Thank you, that was probably the problem and it is working very well now. Thank you for your work. For anybody, that also has problems: You can also connect to the WSL Server in VSCode (as a command WSL : Connect to WSL or the green field in the very left bottom corner) and run it just like in Linux. You have to set the settings to |
While texpresso is running well in WSL for Windows, the texpresso-vscode extension seems to be not working.
I am using the VSCode WSL extension in which also the standart Latex Workshop is working.
Unfortunately, I am not sure how to debug this a VSCode package to give you a more precise log.
The text was updated successfully, but these errors were encountered: