texdoc icon indicating copy to clipboard operation
texdoc copied to clipboard

Windows absolute paths not supported

Open superle3 opened this issue 3 months ago • 1 comments

Description

using absolute paths on windows doesn't work

To reproduce

Set the PDFVIEWER environment variable to an absolute path like C:\Program Files\SumatraPDF\SumatraPDF.exe and run the following in powershell

echo $env:PDFVIEWER
texdoc latex

get output

C:\Program Files\SumatraPDF\SumatraPDF.exe
'C' is not recognized as an internal or external command,
operable program or batch file.
texdoc error: Failed to execute: C "c:\texlive\2024\texmf-dist\doc\latex\latex-doc-ptr\latex-doc-ptr.pdf"

Additional info

See the code below https://github.com/TeX-Live/texdoc/blob/b62d3af85a2dfb12641375c76362aaa69b6a5d4f/script/texdoclib-config.tlu#L228-L240

value = value and string.gmatch(value, '([^:]+)')() only works for unix and not windows. If on windows (not wsl) value = value and string.gmatch(value, '([^;]+)')() / ; should be used instead.

Workaround

set PDFVIEWER=sumatrapdf and add C:\Program Files\SumatraPDF to PATH environment variable.

superle3 avatar Nov 05 '25 22:11 superle3

Thanks for reporting this — it seems you’re right. I’ll check it out when I have time.

wtsnjp avatar Nov 06 '25 15:11 wtsnjp