-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Settings editor saves settings.json lines with trailing whitespace #10887
Comments
Can you give a specific example? I think I'm having a hard time trying to mentally picture what's wrong here. |
Sure, the specific cases where I see this is happening on my
For all of these cases the space is added after the name and colon, but before the value is added, which happens to be on the next line. Instead, I'd expect either to trim each string, or better to use the context to only add the space separator if the next character to be added is not a newline. I haven't taken a look at the code to see how it's handled, but it's curious that For the case of
What is expected is below, note the lack of trailing space (fake depicted as '␣' to be easier to visualize in the diff).
|
these docs for jsoncpp are relevant. IIRC the flag was |
@zadjii-msft Hello. Does it suggest that it's an upstream issue? This issue still exists in Windows Terminal Version: 1.19.10573.0. Renaming settings.json and let the WT recreate a default json file have trailing whitespaces too. |
I'm not sure! Someone would have to dig into the codebase and make sure we're setting that whenever we're saving the settings. If we are, then yea, I'd bet it's an upstream issue. |
Looks like a known upstream issue at jsoncpp open-source-parsers/jsoncpp#1154 |
Windows Terminal version (or Windows build number)
1.9.1942.0
Other Software
No response
Steps to reproduce
I have my settings.json tracked in a dotfiles git repo. Recently (now that settings UI is available) I've noticed that the settings.json is save with a trailing space after a name. This appears to be the case when the name is an array or object whose contents continue onto the next line (i.e. the space after the name is always added without considering whether a string value or array/object value will follow.
Expected Behavior
Lines are trimmed when saving
Actual Behavior
Extra spaces are left behind for entries which span multiple lines.
The text was updated successfully, but these errors were encountered: