Skip to content

Conversation

mpolitze
Copy link
Contributor

@mpolitze mpolitze commented Aug 4, 2023

Thanks for this awesome project! This really saved my day!

I was looking for a simple way to share ssh-agents on WSL2 for a while now. Works perfectly for the ssh-agent shipped with Windows.

Some minor issues occurred when using the application with KeeAgent (https://github.com/dlech/KeeAgent, for getting ssh keys from KeePass) and/or the gpg-agent (for getting ssh keys from hardware tokens e.g. Nitrokey3). Both ssh-agent implementations seem not to like that the named pipe is kept open and will not allow connections from other ssh-clients (e.g. ssh on Windows) while wsl2-ssh-agent is running in WSL.

I had two different ideas of solving this:

  • spawn the PowerShell process only when an ssh-client sends a request or
  • make the PowerShell script close the named pipe after reading

My proposal is doing the latter to save the overhead of spawning the PowerShell process on every request. It is a bit of a hack in waiting for a 0 byte read to open the named pipe. I hope you still find this change acceptable.

@mpolitze mpolitze force-pushed the non-blocking-named-pipe branch from f6bd530 to 1298187 Compare August 4, 2023 16:51
@mame
Copy link
Owner

mame commented Aug 9, 2023

I think the changes are fine. Just nitpicking:

  • Please match the coding style, for example, put a space between the Try{.
  • Please don't mix CR+LF and LF.

Thanks!

@mpolitze
Copy link
Contributor Author

mpolitze commented Aug 9, 2023

Thanks for the feedback. Absolutely understandable. The spaces slipped me through.

Line endings are leaving me baffled... I see them all CRLF in this file both on main and on my branch. I would need a little help what line to look at.

@mpolitze
Copy link
Contributor Author

@mame just being curious if you could help with further feedback or merge this? Thank you!

@mame mame merged commit ddb37ea into mame:main Oct 20, 2023
@mame
Copy link
Owner

mame commented Oct 20, 2023

Sorry I am late, thank you!

@mame
Copy link
Owner

mame commented Oct 20, 2023

And I have released v0.9.2

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

Successfully merging this pull request may close these issues.

2 participants