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

Detect and scan WSL roots and other remotes #4

Closed
mohitsinghs opened this issue Aug 9, 2022 · 4 comments
Closed

Detect and scan WSL roots and other remotes #4

mohitsinghs opened this issue Aug 9, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mohitsinghs
Copy link
Owner

mohitsinghs commented Aug 9, 2022

See #2
As of now, WSL2 does not provide any reliable way to retrieve home directories and even if we add them manually, traversal is really slow from Windows.

@mohitsinghs mohitsinghs mentioned this issue Aug 9, 2022
2 tasks
@mohitsinghs mohitsinghs changed the title Detect and scan WSL roots. ( binary ) Detect and scan WSL roots and other remotes Aug 9, 2022
@mohitsinghs mohitsinghs added enhancement New feature or request help wanted Extra attention is needed labels Aug 9, 2022
@MrLuje
Copy link

MrLuje commented Aug 10, 2022

I made a few tests on WSL : if the repo binary is not found on host side (I explicitly moved it during the test) and I have a repo in PATH in WSL filesystem, then everything works fine

const bundled = vscode.Uri.joinPath(
context.extensionUri,
'bin',
`${executableName}${process.platform === 'win32' ? '.exe' : ''}`
)
if (await fileExits(bundled)) return bundled.fsPath
if (await isInPath(executableName)) return executableName

It only shows WSL repositories, but that's what I expect as a WSL vscode user :

  • vscode on host shows host repos
  • vscode on remote WSL shows WSL repos

Hope it helps :)

@mohitsinghs
Copy link
Owner Author

That totally makes sense. I think, we should prefer repo in PATH over bundled one. That way, it can be used in both environments. What about —

  • exposing a setting to use binary from PATH and using bundled binary as fallback. That should make it at least compatible with WSL for people having repo in PATH.
  • adding ability to edit repo config within VSCode.

On the other hand, combining these two automatically is still a problem which I think we should not solve because these two are different environments and filesystems with very minimal APIs support. Even if I implement that, it will be slow and buggy. The primary reason I created repo and this extension was speed.

@MrLuje
Copy link

MrLuje commented Aug 10, 2022

Yep, looks good to me !
I'm also in favor to not combine host & WSL repositories; as I said I'm fine with only having the repositories from where (host/wsl) vscode has been launched.

An improvement for later on the WSL flow could be to have a vscode command to download the repo unix binary to a known location so we won't have to download it our-self or set the PATH.

@mohitsinghs
Copy link
Owner Author

I've just published v0.4.0 which includes —

  • repositories.preferBundled config, which will look binary in the PATH first when set to false.
  • repositories.showInStatusBar config, which will allows to you to control visibility of current repo in status bar.
  • Repositories: List Repos command which allow you to search and select repos to jump.
  • Repositories: Edit configuration command as well as a settings icon in repository view, which allows you to edit current config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants