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

feat: make hyperlinks usable inside a WSL environment (support all paths) #925

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

opalmay
Copy link

@opalmay opalmay commented Apr 9, 2024

Following the discussion in #913 ,
This solution supports both types of paths, Linux and Windows mounted.

When a path is under /mnt/{drive_letter}, it constructs the equivalent Windows path. Otherwise, the path is simply prefixed to indicate WSL.

@opalmay opalmay requested a review from PThorpe92 as a code owner April 9, 2024 15:58
)));
let distro_name = std::env::var("WSL_DISTRO_NAME").ok();
let path = if let Some(distro_name) = distro_name {
if !abs_path.starts_with("/mnt/") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @opalmay! Could you have a look at the clippy warning on the failing CI check and fix it up? Ideally also run clippy locally to check there aren't any other warnings before amending and force-pushing the branch to get the CI to try again?

In case it's not clear, clippy is complaining that the code says "if not X then Y else Z" when it would be clearer as "if X then Z else Y".

@opalmay opalmay force-pushed the feat_wsl_hyperlinks branch 2 times, most recently from f50af7a to 7c46306 Compare April 10, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

None yet

2 participants