6
cursee
193d

Question for WSL users.

What's your workflow?
How do you edit the code from your IDE on Windows while the application is running in Linux?

Comments
  • 0
  • 1
    @ComputersAreBad

    Not many WSL users here, I think. I have found this two articles.

    https://daverupert.com/2018/04/...

    https://nickjanetakis.com/blog/...
  • 0
    Isn't the Windows filesystem mounted in WSL?
  • 2
    I don't WSL
    But I do run a VM as a dev server.
    So under same principles,

    SSH + SFTP (or remote-ssh for vsCode with plugins installed per VM)

    This Let's me code under windows, and run everything as if you were on the VM directly.

    Simples.
  • 1
    @sbiewald it is, last time I tried it out it broke file permissions when edited outside of the WSL preventing the WSL to be even able to see the files.
    I stopped using it as a serious contender after that.

    WSL2 hopefully will be better but I still prefer to use a VM that's a 95% prod replica.
  • 2
    How about VSCode Remote WSL ?
  • 1
    @C0D4 WSL2 will be a VM, but with the localhost interface shared and the local file system mounted.
  • 1
    WSL shares the Windows filesystem. Just edit your files like normal then run them using WSL.
  • 0
    @AlgoRythm careful. They were not like this when wsl started. You couldn't edit unix files in windows.

    My workflow lives exclusively in wsl, I use sublime ubuntu in wsl to avoid that problem
  • 1
    @rant1ng So long as you have consistent line endings I don't see why that wouldn't work?
  • 1
    @AlgoRythm logically, they should have done it that way and it should work...realistically, and apparently, you can run into some problems...

    https://blogs.msdn.microsoft.com/ws...
  • 1
    @AlgoRythm @rant1ng
    From personal experience, yes you could edit the file from the windows side, no you couldn't access that file ever again from the WSL.
    You had to delete the file from Windows then create it again in WSL.

    Not the greatest experience.

    As for WSL2 @sbiewald, if MS didn't learn from their mistakes of having a mounted directory only usable by the WSL then it's still a pita if something goes wrong.
  • 1
    @C0D4 The same problem existed with Cygwin - the permissions of "Cygwin" and native Windows ACLs did not really coexist well.

    I had to to manually delete one or two files in recovery mode (I have no idea how that could happen).
  • 0
    @AlgoRythm @rant1ng @C0D4

    I have tried both ways (editing WSL files on windows and edition Windows files in WSL) without prior research. And well, basically fucked up my WSL mainly the files permission. Can no longer edit or delete the files from neither OS.

    I stupidly cloned a git repo inside WSL. Opened it directly in my windows sublime text and sublime merge, edited few lines, tried to change a branch via merge in windows.

    Let's just say I got a situation worse than what C0D4 said.

    😁 that's when I started reading about stuff and drop this question here.
  • 1
    @cursee install sublime in side the wsl bash

    Problem solved

    Not the mess though.. ouch
Add Comment