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

[BUG] relative paths with --new-window argument #1065

Open
life00 opened this issue Apr 20, 2024 · 0 comments
Open

[BUG] relative paths with --new-window argument #1065

life00 opened this issue Apr 20, 2024 · 0 comments

Comments

@life00
Copy link

life00 commented Apr 20, 2024

I recently noticed a weird inconsistency when trying to open PDF files as new window with --new-window argument and also supplying the relative path to Sioyek. The problem was that it failed to recognize that relative path correctly.

I identified the reason and I am not completely sure if its a bug or it is on purpose. Here is how you can reproduce it

  1. Lets imagine a scenario where I open a.pdf in directory /files/ as the initial file with the command sioyek --new-window a.pdf (while I am inside /files/) that launches Sioyek.
  2. Then I also want to open b.pdf as another window but it is in directory /files/dir/ to which I previously navigate, so I run sioyek --new-window b.pdf (while being in /files/dir/)

The initial instance of sioyek will be supplied with this new path to file, however it will fail to open it because it is appending the relative path (being ./b.pdf) to the current working directory of the initial instance (being /files/), not the new temporary instance CWD, so it tries to open /files/b.pdf and fails.

The fact that I am still able to open PDF files inside of CWD of initial instance as new window confirms this theory (e.g. I can open c.pdf inside /files/ because it does not trigger the bug).

There is no issue when Sioyek is supplied with the full path to b.pdf, so it is not that critical, however I believe relative paths should still be handled correctly and that's why I report this issue.

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

1 participant