Automatically dismiss "Failed to reload settings" modals when settings.json is valid #20505

Closed
opened 2026-01-31 07:15:54 +00:00 by claunia · 5 comments
Owner

Originally created by @hi2u on GitHub (Sep 18, 2023).

Current behavior

This happens to me pretty much every time I edit my settings.json file:

  1. I start making a minor edit
  2. My editor's auto-save feature automatically saves (for any number of reasons)... or I accidently hit ctrl-s just out of habit
  3. For this brief moment, my settings.json file is invalid
  4. So all my currently running Terminal windows display the Failed to reload settings modal immediately
  5. A few seconds later I've already completed my minor edit, and saved the valid settings.json file
  6. But I now have to click through like 20 windows, and manually click on all the OK buttons to dismiss all the modals, even though my settings.json file is already back in a valid state

Suggested behavior

At point 5 above, assuming settings.json is now valid again: automatically dismiss all these modals, as they're no longer relevant, and can be disruptive when you've got lots of windows open.

Originally created by @hi2u on GitHub (Sep 18, 2023). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Current behavior This happens to me pretty much every time I edit my `settings.json` file: 1. I start making a minor edit 2. My editor's auto-save feature automatically saves (for any number of reasons)... or I accidently hit ctrl-s just out of habit 3. For this brief moment, my `settings.json` file is invalid 4. So all my currently running Terminal windows display the [`Failed to reload settings`](https://user-images.githubusercontent.com/10755858/71671836-147a6300-2d9a-11ea-9910-8aeb0845e952.png) modal immediately 5. A few seconds later I've already completed my minor edit, and saved the valid `settings.json` file 6. But I now have to click through like 20 windows, and manually click on all the `OK` buttons to dismiss all the modals, even though my `settings.json` file is already back in a valid state # Suggested behavior At point 5 above, assuming `settings.json` is now valid again: automatically dismiss all these modals, as they're no longer relevant, and can be disruptive when you've got lots of windows open.
Author
Owner

@zadjii-msft commented on GitHub (Sep 18, 2023):

this is a great idea why have we never done this

@zadjii-msft commented on GitHub (Sep 18, 2023): this is a great idea why have we never done this
Author
Owner

@DHowett commented on GitHub (Sep 18, 2023):

Oh jeez, how DID we miss that?

@DHowett commented on GitHub (Sep 18, 2023): Oh jeez, how DID we miss that?
Author
Owner

@codecruisedor commented on GitHub (Sep 22, 2023):

Hi @DHowett , @zadjii-msft , this is an interesting one; just a few observations to check my understanding:
--> TerminalWindow::UpdateSettings is used to validate the settings and display error or warning dialogs.
--> There are two condition checks for args.Result() based on which we fire the dialogs, so can I add a third one to check if args.Result() == S_OK and if true, dismiss the dialog via DismissDialog()?
--> Any other way to close the dialog, from what I see DismissDialog() is the only way..

Any comments/suggestions?

@codecruisedor commented on GitHub (Sep 22, 2023): Hi @DHowett , @zadjii-msft , this is an interesting one; just a few observations to check my understanding: --> `TerminalWindow::UpdateSettings` is used to validate the settings and display error or warning dialogs. --> There are two condition checks for `args.Result()` based on which we fire the dialogs, so can I add a third one to check if `args.Result() == S_OK ` and if true, dismiss the dialog via `DismissDialog()`? --> Any other way to close the dialog, from what I see `DismissDialog()` is the only way.. Any comments/suggestions?
Author
Owner

@zadjii-msft commented on GitHub (Oct 5, 2023):

@codecruisedor Sorry I missed this! Yep, I'd concur that TerminalWindow::DismissDialog seems like the right thing to call here. Seems like you've got the right fix in mind ☺️

@zadjii-msft commented on GitHub (Oct 5, 2023): @codecruisedor Sorry I missed this! Yep, I'd concur that `TerminalWindow::DismissDialog` seems like the right thing to call here. Seems like you've got the right fix in mind ☺️
Author
Owner

@mpela81 commented on GitHub (Oct 11, 2023):

One small doubt on this, does TerminalWindow::DismissDialog dismiss any dialog currently open? Let's say I have the About dialog open and then I refresh the settings.json file, would it close?

@mpela81 commented on GitHub (Oct 11, 2023): One small doubt on this, does `TerminalWindow::DismissDialog` dismiss _any_ dialog currently open? Let's say I have the About dialog open and then I refresh the settings.json file, would it close?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20505