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

windows: Implement ssh using NamedPipe #20586

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

JunkuiZhang
Copy link
Contributor

@JunkuiZhang JunkuiZhang commented Nov 13, 2024

Closes #ISSUE

Recently, I've been trying to implement the remote ssh feature for Windows. Due to my coursework, progress was slow, but anyway...

Given Zed’s current remote ssh implementation, here are two main issues that arise on Windows:

After testing several approaches, I’ve narrowed it down to two possible solutions. These differ only in how they handle the first issue:

Solution 1 (This PR)

For the inter-process communication issue, this solution uses NamedPipe, which is recommended by Microsoft, to emulate UnixSocket functionality.

  • Pros: No need for additional crates or helper programs.
  • Cons: Requires further code abstraction for maintainability.

Solution 2 (#20587)

In this solution, I utilize the newly introduced UnixSocket on Windows for inter-process communication. However, due to its limited support, an auxiliary program askpass_helper.exe is required to play the askpass.sh script’s role.

  • Pros: The logic is consist with Unix-based systems, making maintenance easier.
  • Cons: Introduces an extra helper program and the windows_net crate.

For the second issue, since Windows doesn’t support connection multiplexing, my approach is to use a password_helper.cmd script to avoid prompting the user repeatedly for their password. The script relies on SharedMemory to retrieve the ssh password.

Currently, I’m not sure which solution to go with, so I’d love to hear Zed team’s thoughts.

Any feedback on these is welcome!

Some demo:

Screen.Recording.2024-11-13.192447.mp4
Screen.Recording.2024-11-13.193933.mp4

Screenshot 2024-11-13 194040

Release Notes:

  • N/A or Added/Fixed/Improved ...

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 13, 2024
@zed-industries-bot
Copy link

Messages
📖

This PR includes links to the following GitHub Issues: #PowerShell/Win32-OpenSSH#405
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against a4e8955

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants