Windows absolute paths not supported
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.
Thanks for reporting this — it seems you’re right. I’ll check it out when I have time.