-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
micro cannot edit hidden file on Windows #2660
Comments
2.0.11 tries to be clever, asks for saving with sudo, but then says that saving with sudo is not supported on Windows (fair). However, the hidden file category should also be added, since it doesn't actually make the file read-only. It just hides it. I know that micro is cross platform but hopefully there is a way to check if a file is hidden on Windows with Go. |
I tried reading the code a bit but files are created or truncated then opened using Line 57 in 2d82362
There was this issue when I tried searching about it but I think access is denied when doing that using that function in Windows if the file is hidden: golang/go#25923 |
sudo is available for windows now https://learn.microsoft.com/en-us/windows/sudo/ and for a long time there's been implementations like gsudo https://github.com/gerardog/gsudo so would it be possible to add sudo support on windows too? |
I do not think administrator privileges should be needed when saving a hidden file so adding sudo support on Windows may not be related with the bug in this issue. Please open another issue about sudo support as a feature request if continuing discussion. I have not looked at the code and searched much, but it may not be hard adding sudo support on Windows. dd is run when saving files using sudo but dd is not preinstalled and I do not know how would it be solved, especially when considering users not using all Unix tools or knowing where it can be downloaded. This part in code only will have to be removed when making it at least possible to run sudo: Lines 127 to 129 in 2259fd1
|
Description of the problem or steps to reproduce
Specifications
OS: Windows 10
Terminal: Windows Terminal
The text was updated successfully, but these errors were encountered: