Latex-workshop: File watchers doesn't work (WSL2)

Created on 26 Jan 2020  ·  4Comments  ·  Source: James-Yu/LaTeX-Workshop

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]

You still see this issue?: Yes

Make sure to visit the wiki FAQ before filling an issue.

You visited the wiki?: Yes

If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.

You can compile a TeX document manually?: Yes

Describe the bug [Required]

The file is not compiled on any file change.

To Reproduce

Steps to reproduce the behavior:

  1. Run latexmk w/ repeat recipe
  2. Write any text
  3. Nothing updates

Expected behavior

I expect that there would be build processing.

Logs [Required]

Please paste the whole log messages here, not parts of ones. It is very important to identify problems.

LaTeX Workshop Output [Required]

To access the log, click the 'TeX' icon on the Activity Bar on the left side, select 'View Log Messages', then select 'View LaTeX Workshop extension log'.

[Paste the log here]

Developer Tools Console [Required]

The file watchers seems to set up:

[13:45:33] Initializing LaTeX Workshop.
[13:45:33] Creating LaTeX Workshop http and websocket server.
[13:45:34] LaTeX Workshop initialized.
[13:45:34] Server created on 127.0.0.1:35055
[13:45:34] Snippet data loaded.
[13:45:34] LaTeX Workshop version: 8.6.0
[13:45:35] Found files that might be root, choose the first one: /mnt/d/git/bachelors-thesis/main.tex
[13:45:35] Root file changed from: undefined to /mnt/d/git/bachelors-thesis/main.tex. Find all dependencies.
[13:45:35] Instantiating a new file watcher for /mnt/d/git/bachelors-thesis/main.tex
[13:45:35] Creating file watcher for .bib files.
[13:45:35] Parsing /mnt/d/git/bachelors-thesis/main.tex
[13:45:35] Parsing /mnt/d/git/bachelors-thesis/parts/introduction.tex
[13:45:35] Parsing /mnt/d/git/bachelors-thesis/chapters/competitive-apps.tex
[13:45:35] Parsing /mnt/d/git/bachelors-thesis/parts/conclusion.tex
[13:45:35] Parsing /mnt/d/git/bachelors-thesis/parts/acronyms.tex
[13:45:35] Parsing /mnt/d/git/bachelors-thesis/parts/attachment.tex
[13:45:35] Found .bib file /mnt/d/git/bachelors-thesis/library.bib
[13:45:35] Adding .bib file /mnt/d/git/bachelors-thesis/library.bib to bib file watcher.
[13:45:35] Parsing .bib entries from /mnt/d/git/bachelors-thesis/library.bib
[13:45:35] Adding /mnt/d/git/bachelors-thesis/main.tex to file watcher.
[13:45:35] Adding /mnt/d/git/bachelors-thesis/parts/introduction.tex to file watcher.
[13:45:35] Adding /mnt/d/git/bachelors-thesis/chapters/competitive-apps.tex to file watcher.
[13:45:35] Adding /mnt/d/git/bachelors-thesis/parts/conclusion.tex to file watcher.
[13:45:35] Adding /mnt/d/git/bachelors-thesis/parts/acronyms.tex to file watcher.
[13:45:35] Adding /mnt/d/git/bachelors-thesis/parts/attachment.tex to file watcher.
[13:45:35] Parsed 4 bib entries from /mnt/d/git/bachelors-thesis/library.bib.

Then I run latexmk 🔁 but only this log appers on any change

[13:48:34] Found root file by magic comment: /mnt/d/git/bachelors-thesis/main.tex
[13:48:34] Looped root file by magic comment found: /mnt/d/git/bachelors-thesis/main.tex, stop here.
[13:48:34] Root file remains unchanged from: /mnt/d/git/bachelors-thesis/main.tex.

Desktop [Required]

  • OS: Windows 10 w/ WSL2
  • VS Code version: 1.41.1
  • Extension version: 8.6.0
  • TeX distribution version: 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)

Additional questions

Are you using LaTeX Workshop with VS Code Remote?

Yes

If the answer is Yes, please write which one you are using. Write the versions of the remote extension.

  • Remote WSL
  • Remote Extension Version: 0.41.7

Additional context

I used to use this extension around 2 months ago and it worked.


Settings

"latex-workshop.view.pdf.viewer": "tab", "latex-workshop.synctex.synctexjs.enabled": true, "latex-workshop.latex.tools": [ { "name": "latexmk", "command": "latexmk", "args": [ "-xelatex", "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-shell-escape", "%DOC%" ] }, { "name": "bibtex", "command": "bibtex", "args": [ "%DOC%" ], "env": {} }, { "name": "arara", "command": "arara", "args": [ "%DOCFILE%" ] } ], "latex-workshop.latex.recipes": [ { "name": "arara", "tools": [ "arara" ] }, { "name": "latexmk 🔃", "tools": [ "latexmk" ] }, { "name": "latexmk (latexmkrc)", "tools": [ "latexmk_rconly" ] }, { "name": "latexmk (lualatex)", "tools": [ "lualatexmk" ] }, { "name": "pdflatex ➞ bibtex ➞ pdflatex × 2", "tools": [ "pdflatex", "bibtex", "pdflatex", "pdflatex" ] } ],

external

Most helpful comment

This is kinda awkward, but it works now??? 🤣

Not sure what was the reason, but I have added

"latex-workshop.latex.watch.usePolling": true,
"latex-workshop.latex.autoBuild.run": "onFileChange",

to the settings. Maybe WSL2 wants that usePolling? I am also using WSL2 now, 2 months back I have been using WSL1, so maybe WSL2 needs this rule?


I have opt out the "latex-workshop.latex.watch.usePolling": true, and it doesn't work without it in WSL2.

It would be great to add this to the wiki next to https://github.com/James-Yu/LaTeX-Workshop/wiki/FAQ#using-latex-workshop-with-wsl! :-)

All 4 comments

This is kinda awkward, but it works now??? 🤣

Not sure what was the reason, but I have added

"latex-workshop.latex.watch.usePolling": true,
"latex-workshop.latex.autoBuild.run": "onFileChange",

to the settings. Maybe WSL2 wants that usePolling? I am also using WSL2 now, 2 months back I have been using WSL1, so maybe WSL2 needs this rule?


I have opt out the "latex-workshop.latex.watch.usePolling": true, and it doesn't work without it in WSL2.

It would be great to add this to the wiki next to https://github.com/James-Yu/LaTeX-Workshop/wiki/FAQ#using-latex-workshop-with-wsl! :-)

It might be related to microsoft/WSL/issues/4739. Another workaround seems to be moving TeX files from d:\git to the Linux filesystem.

@tenhobi could you make a PR to https://github.com/jlelong/LaTeX-Workshop-wiki with the correct configuration for WSL2?

@tamuratak thanks for pointing to that issue. That is for sure related.

@jlelong done. 😸

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlelong picture jlelong  ·  4Comments

drdebmath picture drdebmath  ·  4Comments

tillahoffmann picture tillahoffmann  ·  6Comments

s-ilic picture s-ilic  ·  3Comments

sth4nth picture sth4nth  ·  3Comments