1

I use WSL (Windows Subsystem for Linux) with Debian, which provides a simple cmd interface. I'd like to open files in Notepad++, which is installed on the Windows side of this PC.

is this possible? if not, suggest an editor more robust and accessible than Nano.

1

@Colin

Quick answer to your initial question:

$ /mnt/c/Program\ Files/Notepad++/Notepad++.exe "useful.txt"

That should do it

However, despite the possibility of invoking win binaries from wsl.exe, your approach appears to be super-complicated.

I, personally, stick to nano/cat when working within WSL CLI.

But there's nothing better than Sublime Text with Terminus Package combo. Running bash/zsh on WSL inside a tab is fantastically convenient:

  1. eases up copy/pasting

  2. composing sh scripts like a boss (just remember to switch the .sh file to Unix Line Endings mode )

enter image description here

  1. super-easy sh debugging: modify the script and run it instantly enter image description here
  2. loads of other useful features and ways to handle WSL/Win interactions etc.
|improve this answer|||||
0

You can edit files on the Windows side (C:\xxx) and access them from Debian (/mnt/c/xxx), that's no problem. You can even start Notepad++ from bash which opens in Windows as usual, but as you can't edit any linux files that doesn't make any sense.

So in order to edit files of your linux filesystem you will have to copy them to a shared windows directory /mnt/c/whatever first, edit them there and copy them back afterwards.

Another possibility would be to install samba on linux and mount your work-directories in Windows. The other way around accessing a Windows share using smbclient is also possible, but no fun using commandline linux, already tried that. You are faster copying your files.

Or you use emacs, vim, ...

|improve this answer|||||
  • "you can't edit any linux files that doesn't make any sense" It would make perfect sense to be able to edit files in either context from the other. But editing WSL files from Windows is forbidden when using WSL so can't be done. (Try Cygwin for an alternative environment where it's completely and naturally possible to share files, even.) – roaima Feb 15 '19 at 9:05
-1

You can use the Snap package and install Notepad++ in Linux without installing Wine. There's also a review of five alternatives not mentioned above.

However, all require a GUI, which WSL does not include. I'd suggest you review your options in this article before selecting a GUI and adding graphical applications.

|improve this answer|||||
  • PS: Since you're new, if this answer was useful and productive, please click on the grey arrowhead at left. If it was also the best answer, please also click on the check mark below it, which lets others know which answer's best. – K7AAY Feb 14 '19 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.