-
Notifications
You must be signed in to change notification settings - Fork 859
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
Unable to edit .bash_profile or .bashrc with text editor #87
Comments
Scrolling issue is only in nano not vim. Original problem still applies. |
As a general rule you shouldn't edit Linux Subsystem files with a Windows native text editors. If you do, remember to set newline mode to LF, not CRLF. |
If you can't use windows tools to modify files inside the WSL that makes the whole thing kind of useless. As a developer I want to use an native editor, like Atom, to edit my files and run the code using the linux tools. I don't want to use a VM for this and I certainly don't want to use vim. |
@filipeaguiar You can definitely use windows tools to modify the files, as abyx noted though just make sure your newlines etc are right 💯 |
I used Atom with the correct kind ending and the file was inaccessible too. |
I found the same problem. all files inside |
Things here can get awkward quickly. Hopefully I can clear up a little bit here. Unfortunately the story won't be terribly pretty, but it should hopefully make things more deterministic. Before going more, let's get a term down. For this I will reference files in VolFs. VolFs is our filesystem that covers everything not under /mnt/. Our dev lead Deepu has a great blog here which dives a bit more into it. We'll give more details in future blog posts. VolFs is what knows about Linux filesystem support including attributes. The issue comes in when a user edits / modifies a file in Windows that is normally controlled by VolFs. The confusion is further compounded if there is a Bash session up and running and what app you use to edit the file. Long story short:
We are aware that this is an issue. While editing files on DrvFs (everything under /mnt/) works well it does not help for things that naturally appear in your home directory. I am now in the habit of moving items from VolFs to DrvFs to edit and back, but that does lose the file attributes. A chmod is in order after. While this is something we know about, it never hurts to vote on things on our User Voice page. It's a great place to show us that many people are having similar issues. |
After reading up on this I understand why this a problem. I will specifically quote the post written up by Deepu.
I have to say that this goes against the spirit of Bash for Windows in my opinion. The files exist in the folder as NTFS legal files. How the devs get away with Windows file names that are not legal and case sensitivity while saving them to NTFS is beyond me but I believe that if a file shows up in the lxss directory VolFs should take it (and fix the linux attributes or give defaults if none exist). If the directory isn't meant to be edited from Windows you may as well drop the pretense and make a virtual hard disk for the root path instead of needlessly putting so much work into VoIFs. |
Figuring out how to prevent this might be a start. I agree with others though - this capability is one of the reasons I'm drawn to Bash for Windows. For now, I'll look to store most things on C. |
At least doing something with |
Closing this out as a duplicate of #45. The recommendation is to work out of /mnt/* directories if you'll be modifying files from Windows and WSL. |
@benhillis This unfortunately is not a great solution either because of problems with file permissions. |
question: |
Yes, that is supported. The syntax and semantics are the same as with regular Ubuntu Linux (or most other Linux distributions). |
This behavior renders a lot of the subsystem pointless, and (as mentioned earlier) it'd make more sense to create a VHDX or similar and just use that. Exposing the filesystem to the user, knowing full well that if any windows tool actually touches those files that they'll be deleted from the environment is the closest thing you can get to data-destructive behavior you could get short of just deleting the file outright. |
Probably worth noting that this issue is closely related to issue #449 as both pertain to the sensitiveness of this underlying lxss filesystem from outside of the linux environment |
When I try to edit my .bash_profile or .bashrc file in Sublime (or any other text editor), it fails to reload the file when I open up bash and won't show up in an 'ls -la'. Currently I can only edit them in nano or vim, and as reported elsewhere I'm having issues with nano or vim scrolling though a file, where the window will re-size and I cannot view the full file, it will cut off my ability to go below a certain point in the file.
The text was updated successfully, but these errors were encountered: