fsharp / zarchive-vim-fsharp

F# bindings for vim
MIT License
143 stars 34 forks source link

Use Windows FSharp within Windows Subsystem for Linux #97

Open Tombert opened 7 years ago

Tombert commented 7 years ago

I was recently trying to run the vim-fsharp plugin inside WSL, and pointed my MSBuild executable and Fsharp interactive executable to the windows ones (since WSL now allows you to call windows applications), and while it would start fsautocomplete, it didn't appear to do anything else.

Would it be feasible to modify the plugin to work within WSL?

kjnilsson commented 7 years ago

Forgive my ignorance, what is WSL?

Tombert commented 7 years ago

@kjnilsson WSL = Windows Subsystem for Linux. It is Microsoft's ability to run a mostly-full linux in Windows userspace; substantially nicer than Cygwin, since it will actually run Linux binaries without a recompilation.

kjnilsson commented 7 years ago

I don't have any such system to test on so support for WSL would have to come from a contribution. PR's welcome.

enricosada commented 7 years ago

@Tombert i use WSL. i'd like to test vim plugin there. I'll followup when i try (soon). Are you sure you have mono installed? that's a requirement. the name is fsautocomplete.exe, but is a .net exe so need to run with mono

Tombert commented 7 years ago

@enricosada I do not have Mono installed; WSL can actually run native Windows apps now, so theoretically it should be able to run my native windows install instead of the simulated Mono version, right?

enricosada commented 7 years ago

yes, you can run ./fsautocomplete.exe --help and that will run as .NET process on windows.

v-- fsautocomplete.exe invoked from WLS

image

problem is, FSAC doesnt check the OS atm for some behaviour it need to do differently. just check if is run from mono or not. so is not going to work like that, because need some really specific detection (app run in windows, but started in WSL... so should use unix behaviour). dunno how to detect that

as a workaround, try isntall mono on WSL. so vim run mono fsautocmplete.exe and things should work

image

Tombert commented 7 years ago

@enricosada how hard would it be to add a check for the host OS to see if it's WSL? I'd be happy to do a PR if you point me in the right direction.

enricosada commented 7 years ago

@Tombert but when in WSL, running FSAC in windows, is a nice use case. we can use all the windows .net tooling, and unix tools + unix vim.

WSL: linux tooling and vim, but windows .NET. a good combo. but dunno how msbuild is gonna work. well, depends if the path is mapped on windows too.. let's see later

can you open an issue in https://github.com/fsharp/FsAutoComplete/issues/ ? but we need a way to detect we are started from WLS..

enricosada commented 7 years ago

check for the host OS to see if it's WSL

exactly. dunno :D. fsac will be a windows process, running on windows (probably), but started from WSL linux.. so dunno

kjnilsson commented 7 years ago

Mostly this should be a matter of detecting how to run fsac somewhere near here and do so. Atm it first tries with mono then without.