-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix issues with opening links and files using WSL #3850
base: master
Are you sure you want to change the base?
Conversation
As an alternative, we could default to using xdg-open for all Linux systems, and refer WSL users to wsl-open. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not well versed in WSL but I trust your reasoning.
The OS command to open file in explorer in WSL doesn't currently work as expected; it always opens the file explorer at the default opening location. This is because the {{filename}} variable returns the path in WSL format, and not in the format expected by Windows. We use wslpath, a utility shipped with WSL, to make the path conversion.
Opening links containing ampersands inside lazygit (a pull-request creation page in BitBucket Server, for instance) returns the following Powershell error: > The ampersand (&) character is not allowed. The & operator is reserved > for future use; wrap an ampersand in double quotation marks ("&") to > pass it as part of a string. We fix it by enclosing the URL in single quotes.
514aa6f
to
7236bc6
Compare
@jesseduffield Is something wrong with the checks? They don't seem to run. |
This PR will fix #3843 |
First time contributors have to have their changes approved manually before the CI runs them. |
Do I still need to do something to merge this PR? |
This PR fixes to issues with the current implementation of the OSConfig for WSL:
File explorer
When using the file explorer from WSL, for instance by pressing "o" in the "Files" menu, the explorer always opens on the default landing page. This is caused by the filepath being expressed in WSL format instead of the expected Windows format. For instance:
There's a utility to do that in WSL,
wslpath
. We use it in the Open to format the filename before passing it to the Powershell commandLink URLs
Opening links containing ampersands inside lazygit (a pull-request creation page in BitBucket Server, for instance) returns the following Powershell error:
We fix it by enclosing the URL in single quotes.
Notes on this PR
This is my first PR on this repo, please tell me if something is needed. I read the contributing guide.
The OS-specific logic doesn't appear to be tested in integration and unit tests, so I didn't add tests.
go generate ./...
)