-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Hosts File Editor: Adds no whitespace option #36386
Comments
The double space is intentional so enabled and disabled all are aligned when you view the file. I have extra white space in files all the time, feels a bit odd that they can't handle extra white space. most people would just delete the # in a comment. Shifting this to a feature request as that file can have white space there. |
This behaviour makes sense from an aesthetic point of view then. So this is more likely a problem from squid's side, if the file is allowed to have white spaces. I guess their handling of the whitespace as a delimiter at the beginning might be a bit weird. |
@blakestack I think this should be a compatibility setting defaulting to off. |
@BlackStack |
@htcfreek Hey, I was working on the issue previously, but got stuck on how to implement the actual solution. I think I found where the host file editor is creating each entry with a I think that line 158 or line 162 in the directory -> PowerToys/src/modules/Hosts/HostsUILib/Helpers/HostsService.cs I could not implement how to turn it into a compatability setting. What is the best way to proceed? |
@davidegiacometti |
Hi @blakestack The lines you identified are the ones responsible for adding the space.
|
Hey, @davidegiacometti thank you for the explanation and guidance. I will try to move forward with the implementation. |
Microsoft PowerToys version
0.87.0
Installation method
WinGet
Running as admin
Yes
Area(s) with issue?
Hosts File Editor
Steps to reproduce
Create or modify any hosts file entry or simply enabling/disabling them.
✔️ Expected Behavior
creates or modifies any entry without adding leading spaces for every entry.
❌ Actual Behavior
creates or modifies entries with two leading spaces for every entry. Those leading spaces cause issues with some software, e.g. squid.
Other Software
Squid proxy (4.14)
The text was updated successfully, but these errors were encountered: