OmniSharp / omnisharp-emacs

Troll coworkers - use Emacs at work for csharp!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

omnisharp-emacs starts OmniSharp.exe under Wine in Arch Linux due to binfmt entry

Anvoker opened this issue · comments

Description

Arch Linux wine-staging 4.7-1 registers a binfmt entry :DOSWin:M::MZ::/usr/bin/wine: that makes all commands like ./file.exe automatically run under wine when file.exe is identified to be a doswin binary. If wine-staging 4.7-1 is installed, omnisharp-emacs will open OmniSharp.exe under wine, which breaks the whole plugin's functionality.

This feature of the build script is mentioned on the arch wiki as an opt-in thing, by enabling systemd-binfmt.service, but I don't remember ever enabling it.

Workaround

Either:

  • Uninstall wine and install it again with the binfmt registration line deleted from the build script.
  • Delete /usr/lib/binfmt.d/wine.conf.
  • Disable systemd-binfmt.service.
  • Set omnisharp-server-executable-path to a bash script. Make the bash script explicitly call mono: exec mono "[path to omnisharp]/OmniSharp.exe" "$@"

Possible Improvement

Perhaps explicitly call mono when executing omnisharp-server-executable-path to hedge against situations where a binary format entry like this can mess things up?


I mostly wanted to leave this here for anyone else running into this issue. Not much of a bug really, but it did waste me a couple of hours.

@Anvoker Thanks for debugging the issue! Would you be willing to add a section to README.md in a PR?

@razzmatazz Done: PR #479. Hopefully not too verbose.