sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

Inverse-search gives wrong path inside WSL

Open 594212 opened this issue 10 months ago • 3 comments

Inverse-search gives wrong path inside WSL

OS
❯ hostnamectl
Static hostname: sul-IBR1
   Icon name: computer-container
     Chassis: container
  Machine ID: 429ac08b232f467ab44eb35b05b94a3d
     Boot ID: d7d798959a794b879fa2ff57cf51162e
Virtualization: wsl
Operating System: Ubuntu 22.04.4 LTS
      Kernel: Linux 5.15.133.1-microsoft-standard-WSL2
Architecture: x86-64

Command Executed:

sioyek.exe --inverse-search "wsl echo %2 %1 >> /home/sul/textest/test-sync.log" '/home/sul/textest/main.pdf'

Expected Behavior:

15 home/sul/textest/main.tex
7 home/sul/textest/main.tex
7 home/sul/textest/main.tex
3 home/sul/textest/main.tex
3 home/sul/textest/main.tex
3 home/sul/textest/main.tex
15 home/sul/textest/main.tex
15 home/sul/textest/main.tex
9 home/sul/texttest/main.tex
9 home/sul/textest/main.tex
7 home/sul/textest/main.tex

Actual Behavior:

15 homesul	extestmain.tex
7 homesul	extestmain.tex
7 homesul	extestmain.tex
3 homesul	extestmain.tex
3 homesul	extestmain.tex
3 homesul	extestmain.tex
15 homesul	extestmain.tex
15 homesul	extestmain.tex
9 homesul	extestmain.tex
9 homesul	extestmain.tex
7 homesul	extestmain.tex

it's look like /t is perceived like tab and single forwardslash / is ignored

594212 avatar Apr 10 '24 06:04 594212

I don't use WSL so I don't directly debug the issue right now, but we do have a vimtex_wsl_fix config option which I don't exactly remember what it does, but maybe it helps your case?

ahrm avatar Apr 10 '24 07:04 ahrm

we do have a vimtex_wsl_fix config option

Yea, it is exactly for setting up vimtex in wsl, but for some reason it doesn't fix my problem. I tried set vimtex_wsl_fix 1 and remove it, for me it doesn't change output in /home/sul/textest/test-sync.log.

which I don't exactly remember what it does

in repo we can see some comments about what vimtex_wsl_fix is for

#ifdef Q_OS_WIN
// the path returned by synctex is formatted in unix style, for example it is something like this
// in windows: d:/some/path/file.pdf
// this doesn't work with Vimtex for some reason, so here we have to convert the path separators
// to windows style and make sure the driver letter is capitalized
QDir file_path = QDir(file_name);
QString new_path = QDir::toNativeSeparators(file_path.absolutePath());
new_path[0] = new_path[0].toUpper();
if (VIMTEX_WSL_FIX) {
    new_path = file_name;
}
#endif

It's confusing because, as far as I understand people already using sioyek inverse-search with wsl, why is not working.

594212 avatar Apr 11 '24 13:04 594212

Any updates on this?

DaitiDay avatar May 21 '24 13:05 DaitiDay