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

elcord: attempting reconnect on WSL2 #95

Open
overanalytcl opened this issue Jul 22, 2024 · 5 comments
Open

elcord: attempting reconnect on WSL2 #95

overanalytcl opened this issue Jul 22, 2024 · 5 comments

Comments

@overanalytcl
Copy link

I am on Windows 11, WSL 2 on Ubuntu 24.04 and Emacs 29.4. I installed elcord on Spacemacs, and yet when I activate elcord-mode, it hangs on elcord: attempting reconnect... This is distinct from both #48 and #70, since I am on WSL (it works perfectly fine on the native build), and as such I don't think the Powershell thing applies to me. Do you have any idea where I can start debugging this?

@Mstrodl
Copy link
Owner

Mstrodl commented Jul 22, 2024

If you're running emacs in WSL, you'll need to be running Discord in WSL as well. I don't think there's any real way around that.

@Mstrodl
Copy link
Owner

Mstrodl commented Jul 22, 2024

(On windows, discord uses named pipes, which afaik aren't exported to WSL at all)

@overanalytcl
Copy link
Author

(On windows, discord uses named pipes, which afaik aren't exported to WSL at all)

Well, that sucks to hear. I thought RPC would flow from WSL to Discord because it shouldn't be blocked by anything (iirc, there's no firewall). Maybe an intermediate script that could function like stdpipes.ps1 that gets run on the host (so it could have access to WSL2) could work?

@Mstrodl
Copy link
Owner

Mstrodl commented Aug 2, 2024

Maybe! There might be some clever driver or something that lets you do named pipes directly from WSL? Happy to accept a PR to add support for it!

@RangHo
Copy link
Contributor

RangHo commented Aug 20, 2024

I used to experiment with npiperelay back in the days I used WSL1. It was for NeoVim, though...

With this solution, you use npiperelay with socat to create a "Discord IPC UNIX socket" yourself. Basically how it works is:

  • You create /tmp/discord-ipc-0 or whatever as a UNIX socket to trick Elcord, and...
  • ...create npiperelay instance with Discord IPC named pipe on Windows side, and...
  • ...let socat bridge these two so that Elcord's request are tunneled to the Windows named pipe.

Here is a one-liner, adapted from some sample commands (untested, since I ditched Windows years ago):

socat UNIX-LISTEN:/tmp/discord-ipc-0,fork EXEC:"npiperelay.exe -ep -s //./pipe/discord-ipc-0",nofork

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

No branches or pull requests

3 participants