Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse-search gives wrong path inside WSL #1049

Open
594212 opened this issue Apr 10, 2024 · 3 comments
Open

Inverse-search gives wrong path inside WSL #1049

594212 opened this issue Apr 10, 2024 · 3 comments

Comments

@594212
Copy link

594212 commented Apr 10, 2024

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

@ahrm
Copy link
Owner

ahrm commented Apr 10, 2024

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?

@594212
Copy link
Author

594212 commented Apr 11, 2024

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.

@DaitiDay
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants