James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.66k stars 530 forks source link

LaTeX Workshop ignores custom latex-tools set in settings.json #4444

Closed Loxymore closed 2 days ago

Loxymore commented 2 days ago

Pre-checks*

Environment*

The Issue*

Reproduction Steps

  1. Install TeX Live and add it to path using .bashrc
  2. Open VSCode, install LaTeX workshop and try to compile to a pdf file.
  3. When the compilation fails, modify latex-tools to add your own $PATH
  4. Compilation still fails

Expected Behavior

Logs

LaTeX Workshop Output*

[12:54:36.190][Logger] New log placeholder %WS1% registered for /home/username/Desktop/Unibas/Autumn 2024/Statistik/Ubungsblatter/LaTeX .
[12:54:36.190][Extension] Initializing LaTeX Workshop.
[12:54:36.378][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[12:54:36.379][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_PATH: "docker"
[12:54:36.432][Server] Creating LaTeX Workshop http and websocket server.
[12:54:36.598][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[12:54:36.663][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":38721} .
[12:54:36.690][Extension] Extension root: /home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4
[12:54:36.691][Extension] $PATH: /app/bin:/app/bin:/app/bin:/usr/bin:/home/username/.var/app/com.visualstudio.code/data/node_modules/bin
[12:54:36.691][Extension] $SHELL: /bin/sh
[12:54:36.691][Extension] $LANG: en_US.UTF-8
[12:54:36.691][Extension] $LC_ALL: undefined
[12:54:36.691][Extension] process.platform: linux
[12:54:36.692][Extension] process.arch: x64
[12:54:36.692][Extension] vscode.env.appName: Visual Studio Code
[12:54:36.692][Extension] vscode.env.remoteName: undefined
[12:54:36.692][Extension] vscode.env.uiKind: 1
[12:54:36.701][Config] latex-workshop.latex.recipes: [{"name":"pdflatex","tools":["pdflatex"]}] .
[12:54:36.703][Config] latex-workshop.latex.tools: [{"name":"pdflatex","command":"/usr/bin/pdflatex","args":["-interaction=nonstopmode","-synctex=1","%DOC%"]}] .
[12:54:36.704][Config] latex-workshop.latex.outDir: "./out" .
[12:54:36.751][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{","}"]
[12:54:36.754][Root] Current workspace folders: ["file://%WS1%"]
[12:54:36.755][Root] Try finding root from magic comment.
[12:54:36.755][Extension] LaTeX Workshop initialized.
[12:54:36.756][Root] Try finding root from active editor.
[12:54:36.757][Root] Found root file from active editor: %WS1%/template.tex
[12:54:36.758][Root] Root file changed: from %WS1%/template.tex to %WS1%/template.tex, langID latex . Refresh dependencies
[12:54:36.759][Event] ROOT_FILE_CHANGED: "%WS1%/template.tex"
[12:54:36.760][Cacher][Watcher] Reset.
[12:54:36.760][Cacher][Watcher] Reset.
[12:54:36.764][Cacher] Adding %WS1%/template.tex .
[12:54:36.767][Cacher][Watcher] Watched file://%WS1%/template.tex with a new .* watcher on %WS1% .
[12:54:36.768][Event] FILE_WATCHED: "file://%WS1%/template.tex"
[12:54:36.769][Cacher] Caching %WS1%/template.tex .
[12:54:36.770][Event] ROOT_FILE_SEARCHED
[12:54:36.778][Server] validOrigin is http://127.0.0.1:38721
[12:54:36.830][Viewer][Panel] Internal PDF viewer at http://127.0.0.1:38721/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRmhvbWUlMkZraGFkemhpbXVyYWQlMkZEZXNrdG9wJTJGVW5pYmFzJTJGQXV0dW1uJTIwMjAyNCUyRlN0YXRpc3RpayUyRlVidW5nc2JsYXR0ZXIlMkZMYVRlWCUyRnRlbXBsYXRlLnBkZg .
[12:54:36.831][Cacher][Watcher] Watched file://%WS1%/template.pdf with a new .pdf watcher on %WS1% .
[12:54:36.831][Event] FILE_WATCHED: "file://%WS1%/template.pdf"
[12:54:36.834][Cacher] Updated inputs of %WS1%/template.tex .
[12:54:36.835][Cacher] Parse LaTeX AST: %WS1%/template.tex .
[12:54:36.937][Cacher] Parsed LaTeX AST in 101.47 ms: %WS1%/template.tex .
[12:54:36.938][File] Calling kpsewhich to resolve article.cls .
[12:54:36.954][File] kpsewhich returned with non-zero code null.
[12:54:36.962][Cacher] Updated elements in 24.53 ms: %WS1%/template.tex .
[12:54:36.965][Event] FILE_PARSED: "%WS1%/template.tex"
[12:54:36.974][Structure] Structure force updated with 0 root sections for %WS1%/template.tex .
[12:54:36.976][Event] STRUCTURE_UPDATED
[12:54:37.285][Cacher] Parsing .fls %WS1%/template.fls .
[12:54:37.361][Cacher] Found .aux %WS1%/template.aux from .fls %WS1%/template.fls , parsing.
[12:54:37.365][Cacher] Parsed .aux %WS1%/template.aux .
[12:54:37.366][Cacher] Parsed .fls %WS1%/template.fls .
[12:54:37.496][Viewer] Handle data type: open
[12:54:37.658][Server] Preview PDF file: file://%WS1%/template.pdf
[12:54:37.773][Viewer] Handle data type: loaded
[12:54:37.774][Event] VIEWER_PAGE_LOADED
[12:54:40.945][Commander] BUILD command invoked.
[12:54:40.945][Build] The document of the active editor: file://%WS1%/template.tex
[12:54:40.945][Build] The languageId of the document: latex
[12:54:40.946][Root] Current workspace folders: ["file://%WS1%"]
[12:54:40.946][Root] Try finding root from magic comment.
[12:54:40.947][Root] Try finding root from active editor.
[12:54:40.947][Root] Found root file from active editor: %WS1%/template.tex
[12:54:40.948][Root] Keep using the same root file: %WS1%/template.tex
[12:54:40.949][Event] ROOT_FILE_SEARCHED
[12:54:40.949][Event] STRUCTURE_UPDATED
[12:54:40.949][Build] Building root file: %WS1%/template.tex
[12:54:40.950][Build][Recipe] Build root file %WS1%/template.tex
[12:54:40.967][Build][Recipe] Preparing to run recipe: pdflatex.
[12:54:40.968][Build][Recipe] Prepared 1 tools.
[12:54:40.970][Build][Recipe] outDir: %WS1%/out .
[12:54:40.980][Build] Recipe step 1 The command is /usr/bin/pdflatex:["-interaction=nonstopmode","-synctex=1","%WS1%/template"].
[12:54:40.981][Build] env: undefined
[12:54:40.981][Build] root: %WS1%/template.tex
[12:54:40.981][Build] cwd: %WS1%
[12:54:40.992][Build] LaTeX build process spawned with PID undefined.
[12:54:40.994][Build] LaTeX fatal error on PID undefined. Error: spawn /usr/bin/pdflatex ENOENT
[12:54:40.994]Error: spawn /usr/bin/pdflatex ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[12:54:40.995][Build] Does the executable exist? $PATH: /app/bin:/app/bin:/app/bin:/usr/bin:/home/username/.var/app/com.visualstudio.code/data/node_modules/bin, $Path: undefined, $SHELL: /bin/sh

Developer Tools Console

 INFO Started local extension host with pid 143.
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/TeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/LaTeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/Bibtex.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…es-yu.latex-workshop-10.5.4/syntax/markdown-latex-combined.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…/james-yu.latex-workshop-10.5.4/syntax/cpp-grammar-bailout.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/TeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/TeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.doctex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/DocTeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/DocTeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/LaTeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/LaTeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/Bibtex.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/Bibtex.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.bst.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/BibTeX-style.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/BibTeX-style.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…/james-yu.latex-workshop-10.5.4/syntax/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…s/mathematic.vscode-latex-1.3.0/syntax/cpp-grammar-bailout.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.jlweave.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/JLweave.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/JLweave.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.rsweave.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/RSweave.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/RSweave.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/TeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/LaTeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/Bibtex.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…es-yu.latex-workshop-10.5.4/syntax/markdown-latex-combined.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///app/extra/vscode/resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…/james-yu.latex-workshop-10.5.4/syntax/cpp-grammar-bailout.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/TeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/TeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.doctex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/DocTeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/DocTeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/LaTeX.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/LaTeX.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/Bibtex.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/Bibtex.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.bst.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/BibTeX-style.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/BibTeX-style.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…/james-yu.latex-workshop-10.5.4/syntax/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extens…s/mathematic.vscode-latex-1.3.0/syntax/cpp-grammar-bailout.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.jlweave.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/JLweave.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/JLweave.tmLanguage.json
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.rsweave.
Old grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/james-yu.latex-workshop-10.5.4/syntax/RSweave.tmLanguage.json.
New grammar file: file:///home/username/.var/app/com.visualstudio.code/data/vscode/extensions/mathematic.vscode-latex-1.3.0/syntax/RSweave.tmLanguage.json
webviewElement.ts:486 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
log.ts:439   ERR Unable to read file '/home/username/.var/app/com.visualstudio.code/config/Code/logs/20241019T131832/window1/exthost/output_logging_20241019T131833/1-LaTeX Workshop.log' (Error: Unable to resolve nonexistent file '/home/username/.var/app/com.visualstudio.code/config/Code/logs/20241019T131832/window1/exthost/output_logging_20241019T131833/1-LaTeX Workshop.log'): Error: Unable to read file '/home/username/.var/app/com.visualstudio.code/config/Code/logs/20241019T131832/window1/exthost/output_logging_20241019T131833/1-LaTeX Workshop.log' (Error: Unable to resolve nonexistent file '/home/username/.var/app/com.visualstudio.code/config/Code/logs/20241019T131832/window1/exthost/output_logging_20241019T131833/1-LaTeX Workshop.log')
    at Git.F (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3072:69639)
    at Git.D (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3072:69464)
    at async Git.C (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:3072:68832)
    at async pve.O (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:2439:9628)
    at async vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:2439:8847
log.ts:419  INFO [perf] Render performance baseline is 23ms
notificationsAlerts.ts:42 chktex could not be found.
log.ts:439   ERR Illegal value for lineNumber: Error: Illegal value for lineNumber
    at Om.getLineMaxColumn (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:254:112)
    at _a.getBottomForLineNumber (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:263:1594)
    at $I.findScrollWidgetState (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:477:55093)
    at $I.cb (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:477:54375)
    at async $I.ab (vscode-file://vscode-app/app/extra/vscode/resources/app/out/vs/workbench/workbench.desktop.main.js:477:53861)
notificationsAlerts.ts:42 Recipe terminated with fatal error: spawn /usr/bin/pdflatex ENOENT.
c   @   notificationsAlerts.ts:42

Anything Else?

James-Yu commented 2 days ago

Setting PATH won’t work. The extension takes PATH from vscode. Search the issue tracker for similar issues and solutions.