#1841 not good enough #10238

Closed
opened 2026-01-31 02:16:08 +00:00 by claunia · 5 comments
Owner

Originally created by @amoldeshpande on GitHub (Aug 20, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.450]
Windows Terminal version (if applicable): 1.1.2233.0

Any other software?

Steps to reproduce

I have some sort of phantom association with .json files and a version of Visual Studio (2015) that I no longer actually have. This is a long-standing situation due to some incompetence on my part, but not really relevant.

Anyway, this leads to a situation where I tried to open settings after installing Terminal and it kept beeping with no error message.

According to #1841 it should fire up notepad if ShellExecute() fails, but it does not show me notepad either.

Expected behavior

At least pop-up a message box saying "Couldn't open settings.json, check that you have an editor associated".

Regardless of how I got into this sorry state, lack of user feedback is inexcusable.

Actual behavior

DING ! DING!

Originally created by @amoldeshpande on GitHub (Aug 20, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19041.450] Windows Terminal version (if applicable): 1.1.2233.0 Any other software? ``` # Steps to reproduce I have some sort of phantom association with .json files and a version of Visual Studio (2015) that I no longer actually have. This is a long-standing situation due to some incompetence on my part, but not really relevant. Anyway, this leads to a situation where I tried to open settings after installing Terminal and it kept beeping with no error message. According to #1841 it should fire up notepad if ShellExecute() fails, but it does not show me notepad either. # Expected behavior At least pop-up a message box saying "Couldn't open settings.json, check that you have an editor associated". Regardless of how I got into this sorry state, lack of user feedback is inexcusable. # Actual behavior DING ! DING!
claunia added the Resolution-ExternalNeeds-Tag-Fix labels 2026-01-31 02:16:08 +00:00
Author
Owner

@DHowett commented on GitHub (Aug 20, 2020):

I legitimately wish we could help you get out of this state from the Terminal side, but here's how it plays out.

  1. Terminal says "hey, open this JSON file"
  2. ShellExecute says "gotcha"
  3. (something) launches and emits a ding

We can only switch to notepad if the API in step 2 tells us it failed. Anything that succeeds, or looks like success, must contractually be taken to mean that it succeeded. There's a couple different avenues we could take to determine whether something actually launched in response to our ShellExecute, but they fall apart on closer inspection.

  • Detect a new process in the entire process tree
    • prone to false positives
    • editors like code and perhaps notepad++ like to single-instance themselves, so there would be no durable new process
  • Detect a new window
    • prone to false positives, but less so than with processes because windows are spawned less often
    • editors like code and perhaps notepad++ like to single-instance themselves, so there would be no durable new window
    • slow editors might take a long time to come up.
  • ???

It's not a tractable problem. Terminal has to trust, to some extent, the OS APIs that it uses. If an application is successfully launching when we ask to open a JSON file, and then that application is failing silently (or loudly, as the case may be for you!) after telling the OS that it was a great and complete success . . . that's the brakes.

Would you mind running assoc .json from the command prompt? It might not turn up anything useful, but perhaps we can get to the actual root cause here.

@DHowett commented on GitHub (Aug 20, 2020): I legitimately wish we could help you get out of this state from the Terminal side, but here's how it plays out. 1. Terminal says "hey, open this JSON file" 2. `ShellExecute` says "gotcha" 3. (something) launches and emits a ding We can only switch to notepad if the API in step 2 tells us it failed. Anything that succeeds, or looks like success, _must_ contractually be taken to mean that it succeeded. There's a couple different avenues we could take to determine whether something _actually_ launched in response to our ShellExecute, but they fall apart on closer inspection. * Detect a new process in the entire process tree * prone to false positives * editors like `code` and perhaps `notepad++` like to single-instance themselves, so there would be no durable new process * Detect a new window * prone to false positives, but less so than with processes because windows are spawned less often * editors like `code` and perhaps `notepad++` like to single-instance themselves, so there would be no durable new window * slow editors might take a long time to come up. * ??? It's not a tractable problem. Terminal has to trust, to some extent, the OS APIs that it uses. If an application is successfully launching when we ask to open a JSON file, and _then_ that application is failing silently (or loudly, as the case may be for you!) after telling the OS that it was a great and complete success . . . that's the brakes. Would you mind running `assoc .json` from the command prompt? It might not turn up anything useful, but perhaps we can get to the actual root cause here.
Author
Owner

@DHowett commented on GitHub (Aug 20, 2020):

If there were any way for us to reliably detect that our otherwise apparently successful request to open the JSON file failed ... we would be doing it. 😄

@DHowett commented on GitHub (Aug 20, 2020): If there were any way for us to reliably detect that our _otherwise apparently successful_ request to open the JSON file failed ... we would be doing it. :smile:
Author
Owner

@amoldeshpande commented on GitHub (Aug 20, 2020):

Ahh, I see. I was able to reproduce the annoying behavior by just trying to open the settings file with "Visual Studio 2015" which is the bad installer state that I mentioned I'm in.

assoc output : .json=VisualStudio.json.14.0

when I set it back from gvim, but I already know the reason I guess.

So, I guess there is no Terminal bug here :(

As a side note, is there any interest in a GUI for settings ? I absolutely hate GUI apps having json settings (it's kinda excusable for editors like VSCode and Sublime, but not really) .

I would be happy to add one as a side project. Should be easy enough in XAML/MVVM to bind a nice view to the settings file ?

@amoldeshpande commented on GitHub (Aug 20, 2020): Ahh, I see. I was able to reproduce the annoying behavior by just trying to open the settings file with "Visual Studio 2015" which is the bad installer state that I mentioned I'm in. assoc output : .json=VisualStudio.json.14.0 when I set it back from gvim, but I already know the reason I guess. So, I guess there is no Terminal bug here :( As a side note, is there any interest in a GUI for settings ? I absolutely hate GUI apps having json settings (it's kinda excusable for editors like VSCode and Sublime, but not really) . I would be happy to add one as a side project. Should be easy enough in XAML/MVVM to bind a nice view to the settings file ?
Author
Owner

@DHowett commented on GitHub (Aug 20, 2020):

Oh, absolutely. Work is ongoing in #6720 to spec the UI, tracked in #1564. We've got datamodel changes going in #7141 that'll make life easier in the future when we do want to do XAML data binding. That's all scheduled for "by 2.0" 😄

@DHowett commented on GitHub (Aug 20, 2020): Oh, _absolutely_. Work is ongoing in #6720 to spec the UI, tracked in #1564. We've got datamodel changes going in #7141 that'll make life easier in the future when we do want to do XAML data binding. That's all scheduled for "by 2.0" :smile:
Author
Owner

@DHowett commented on GitHub (Aug 20, 2020):

Gonna mark this one resolved/external... but thanks for all the info!

@DHowett commented on GitHub (Aug 20, 2020): Gonna mark this one resolved/external... but thanks for all the info!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10238