-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Windows Terminal crashes when a profile's icon URL or background is unparseable/invalid #2329
Comments
Yes, this is a good followup to #1468 |
Like Community edition? |
Lol, yea, I meant Professional - I haven't used VS before but I see Community VS is full featured. I'm surprised these critical bugs aren't getting fixed quicker. I've been out of the loop for a few years touristing, interesting to see how far MS has embraced Open Source. Once I get a dev env set up I'll probably contribute. |
🎉This issue was addressed in #2376, which has now been successfully released as Handy links: |
Interesting. I had to try about six different variants before I was able to find one that would crash. |
There should be a default icon that a profile will revert to, when the specified icon is not found |
@DHowett-MSFT Mind sharing what URL variant caused the crash? Or filing a new issue with that variant? |
"icon": "/beeftown.png", It can't construct a
|
I just ran into this when I tried to use environmental variables in the icon path. This will crash in 0.5.2681.0
This will not.
I realise that env variables might not be supported for icons. But just wanted to throw in my crash scenario. |
Does this issue still repro? I can't get a crash with any of the icon paths. Let me know if you've got an icon path which can consistently crash WT, and any specific repro steps required. |
I posted in #2376 which got merged into this issue. Using my original steps, I am unable to reproduce this issue in 0.7.3451.0 so it seems to have been fixed. |
Phantom fixes, nice. Would be good if others in the thread who had repros after #2376 was merged could confirm too. |
I'm not able to reproduce this either now. |
Fascinating. I'm going to close this for now, but we'll keep our eyes peeled. Thanks for the confirmations! |
We're reactivating this from discussion in #4002:
|
Rather than defensively catching an exception, I wonder if it would make sense to validate the media associated with a profile somewhere during the profile creation process. Then we could intercept the issue (error page, inserting some default media...) before any event is even launched. |
WT crashes when an unparseable/invalid `backgroundImage` or `icon` resource path is provided in `profiles.json`. This PR averts the crash by the validating and correcting resource paths as a part of the `_ValidateSettings()` function in `CascadiaSettings`. `_ValidateSettings()` is run on start up and any time `profiles.json` is changed, so a user can not change a file path and avoid the validation step. When a bad `backgroundImage` or `icon` resource path is detected, a warning screen will be presented. References #4002, which identified a consistent repro for the crash. To validate the resource, a `Windows::Foundation::Uri` object is constructed with the path. The ctor will throw if the resource path is invalid. Whether or not this validation method is robust enough is a subject worth review. The correction method for when a bad resource path is detected is to reset the `std::optional<winrt::hstring>` holding the file path. The text in the warning display was cribbed from the text used when an invalid `colorScheme` is used. Whether or not the case of a bad background image file path warrants a warning display is a subject worth review. Ensured the repro steps in #4002 did not trigger a crash. Additionally, some potential backdoor paths to a crash were tested: - Deleting the file of a validated background image file path - Changing the actual file name of a validated background image file path - Replacing the file of a validated background image file path with a non-image file (of the same name) - Using a non-image file as a background image In all the above cases WT does not crash, and instead defaults to the background color specified in the profile's `colorScheme`. This PR does not implement this recovery behavior (existing error catching code does). Closes #2329
WT crashes when an unparseable/invalid `backgroundImage` or `icon` resource path is provided in `profiles.json`. This PR averts the crash by the validating and correcting resource paths as a part of the `_ValidateSettings()` function in `CascadiaSettings`. `_ValidateSettings()` is run on start up and any time `profiles.json` is changed, so a user can not change a file path and avoid the validation step. When a bad `backgroundImage` or `icon` resource path is detected, a warning screen will be presented. References #4002, which identified a consistent repro for the crash. To validate the resource, a `Windows::Foundation::Uri` object is constructed with the path. The ctor will throw if the resource path is invalid. Whether or not this validation method is robust enough is a subject worth review. The correction method for when a bad resource path is detected is to reset the `std::optional<winrt::hstring>` holding the file path. The text in the warning display was cribbed from the text used when an invalid `colorScheme` is used. Whether or not the case of a bad background image file path warrants a warning display is a subject worth review. Ensured the repro steps in #4002 did not trigger a crash. Additionally, some potential backdoor paths to a crash were tested: - Deleting the file of a validated background image file path - Changing the actual file name of a validated background image file path - Replacing the file of a validated background image file path with a non-image file (of the same name) - Using a non-image file as a background image In all the above cases WT does not crash, and instead defaults to the background color specified in the profile's `colorScheme`. This PR does not implement this recovery behavior (existing error catching code does). Closes #2329 (cherry picked from commit 77dd51a)
🎉This issue was addressed in #4194, which has now been successfully released as Handy links: |
🎉This issue was addressed in #4194, which has now been successfully released as Handy links: |
I got the latest from choco and set up an Ubuntu terminal entry. I found that if I put a garbage URL in the profiles.json icon setting entry it crashes Windows Terminal and WT won't start thereafter.
That probably shouldn't happen, though technically low priority its probably making WT look fragile.
To repeat this behavior simply remove "ms-appx:" from any icon path.
The text was updated successfully, but these errors were encountered: