BUG: profiles.json values do not round trip properly #3191

Closed
opened 2026-01-30 23:15:19 +00:00 by claunia · 2 comments
Owner

Originally created by @kfarmer-msft on GitHub (Aug 6, 2019).

Environment

Windows build number:
Microsoft Windows [Version 10.0.18362.267]

Windows Terminal version (if applicable):
Windows Terminal (Preview)
Version: 0.3.2142.0

Any other software?
VS 2019 (though probably not relevant -- merely used this for editing profiles.json)

Steps to reproduce

Start terminal.
Edit profiles.json to give background image an opacity of 0.3 exactly:

            "backgroundImageOpacity" : 0.3,

Save.
Observe opacity change in running terminal.
Close profiles.json.
Close terminal.
Restart terminal.
Launch profiles.json from terminal.
Observe opacity value rewritten as

            "backgroundImageOpacity" : 0.30000001192092896,

Another case:

Set background image path to an interesting name, like:

            "backgroundImage" : "C:\\Users\\kfarm\\OneDrive\\Backgrounds\\Characters (Landscape)\\Þiálfi [Vizsla] - desktop.png",

It comes back as

            "backgroundImage" : "C:\\Users\\kfarm\\OneDrive\\Backgrounds\\Characters (Landscape)\\\u00dei\u00e1lfi [Vizsla] - desktop.png",

Expected behavior

All values round-trip, retaining the actual value from the file, unless the value was explicitly changed as a result of user action.

Actual behavior

Arguably, data corruption. The values still work, technically, but they are not what the user specified. A failure to properly re-encode will lose data. Better to leave the original values untouched.

Related: If I omit a profile GUID, why add one to the file? Pick one on load and use it internally, but unless it's getting referenced elsewhere in the file, why have it at all?

Originally created by @kfarmer-msft on GitHub (Aug 6, 2019). # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18362.267] Windows Terminal version (if applicable): Windows Terminal (Preview) Version: 0.3.2142.0 Any other software? VS 2019 (though probably not relevant -- merely used this for editing profiles.json) ``` # Steps to reproduce Start terminal. Edit profiles.json to give background image an opacity of 0.3 exactly: ```none "backgroundImageOpacity" : 0.3, ``` Save. Observe opacity change in running terminal. Close profiles.json. Close terminal. Restart terminal. Launch profiles.json from terminal. Observe opacity value rewritten as ```none "backgroundImageOpacity" : 0.30000001192092896, ``` Another case: Set background image path to an interesting name, like: ```none "backgroundImage" : "C:\\Users\\kfarm\\OneDrive\\Backgrounds\\Characters (Landscape)\\Þiálfi [Vizsla] - desktop.png", ``` It comes back as ```none "backgroundImage" : "C:\\Users\\kfarm\\OneDrive\\Backgrounds\\Characters (Landscape)\\\u00dei\u00e1lfi [Vizsla] - desktop.png", ``` # Expected behavior All values round-trip, retaining the actual value from the file, unless the value was explicitly changed as a result of user action. # Actual behavior Arguably, data corruption. The values still *work*, technically, but they are not what the user specified. A failure to properly re-encode will lose data. Better to leave the original values untouched. Related: If I omit a profile GUID, why add one to the file? Pick one on load and use it internally, but unless it's getting referenced elsewhere in the file, why have it at all?
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 8, 2019):

This is tracked in #1398 . We may want to make all opacities and percentages integral anyway like we did for cursorHeight.

@DHowett-MSFT commented on GitHub (Aug 8, 2019): This is tracked in #1398 . We may want to make all opacities and percentages integral anyway like we did for `cursorHeight`.
Author
Owner
@surfer776 commented on GitHub (Aug 17, 2019): . mascouten777@gmail.com On Wed, Aug 7, 2019, 7:45 PM Dustin L. Howett (MSFT) < notifications@github.com> wrote: > Closed #2280 <https://github.com/microsoft/terminal/issues/2280>. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/microsoft/terminal/issues/2280?email_source=notifications&email_token=ALW6QYJHWSVM7LRTPGZ4HZLQDNUDRA5CNFSM4IJT2XZKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOS6AD4MA#event-2541764144>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ALW6QYP7IFBDCH4FJTAJKWLQDNUDRANCNFSM4IJT2XZA> > . >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3191