Windows Terminal crash when background image path contains tilde #5628

Closed
opened 2026-01-31 00:17:47 +00:00 by claunia · 7 comments
Owner

Originally created by @patriksvensson on GitHub (Dec 17, 2019).

Environment

Windows build number: Microsoft Windows NT 10.0.19041.0
Windows Terminal version (if applicable): 0.7.3451.0

Steps to reproduce

In profiles.json under a profile, add a background image path that references the home directory ~.

{
    ...
    "profiles": [
        {
            "name": "Windows PowerShell",
            "backgroundImage": "~/Pictures/Console/PowerShell.png",
        }
    ...
}

Expected behavior

Should not crash. Should show the expected background image.

Actual behavior

Windows Terminal crash at startup.

Originally created by @patriksvensson on GitHub (Dec 17, 2019). # Environment ```none Windows build number: Microsoft Windows NT 10.0.19041.0 Windows Terminal version (if applicable): 0.7.3451.0 ``` # Steps to reproduce In `profiles.json` under a profile, add a background image path that references the home directory `~`. ```json { ... "profiles": [ { "name": "Windows PowerShell", "backgroundImage": "~/Pictures/Console/PowerShell.png", } ... } ``` # Expected behavior Should not crash. Should show the expected background image. # Actual behavior Windows Terminal crash at startup.
claunia added the Resolution-Duplicate label 2026-01-31 00:17:47 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 19, 2019):

This looks like a /dupe of #2329, which we'll reopen. They're largely the same bug caused by the same issue somewhere in XAML land.

@DHowett-MSFT commented on GitHub (Dec 19, 2019): This looks like a /dupe of #2329, which we'll reopen. They're largely the same bug caused by the same issue somewhere in XAML land.
Author
Owner

@ghost commented on GitHub (Dec 19, 2019):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Dec 19, 2019): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@mkitzan commented on GitHub (Dec 19, 2019):

@DHowett-MSFT I'm not sure if this is a dup since a tilde in the icon path doesn't crash WT (at least, I wasn't able to repro with a few examples). Very weird.

@mkitzan commented on GitHub (Dec 19, 2019): @DHowett-MSFT I'm not sure if this is a dup since a tilde in the icon path doesn't crash WT (at least, I wasn't able to repro with a few examples). Very weird.
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 19, 2019):

@mkitzan I believe they are, but for reasons I didn't quite explain up front. 😄 Invalid resource paths to images (or all types) that end up getting displayed on a XAML surface end up running through the internet resource downloader somewhere deep in, uh, internet explorer libraries. Depending on where the image would have appeared in the visual tree, the exception caused by failing to load it can come out of different places.
Sometimes, it'll come right out when you try to create the image resource. Other times, it'll only come out when you attempt to navigate to a screen that contains that resource.
Since icons and backgrounds are just stuck into image views at the end of the day, I believe they're the same issue.

@DHowett-MSFT commented on GitHub (Dec 19, 2019): @mkitzan I believe they are, but for reasons I didn't quite explain up front. :smile: Invalid resource paths to images (or all types) that end up getting displayed on a XAML surface end up running through the internet resource downloader somewhere deep in, uh, _internet explorer libraries_. Depending on where the image would have appeared in the visual tree, the exception caused by failing to load it can come out of different places. Sometimes, it'll come right out when you try to create the image resource. Other times, it'll only come out when you attempt to navigate to a screen that contains that resource. Since icons and backgrounds are just stuck into image views at the end of the day, I _believe_ they're the same issue.
Author
Owner

@mkitzan commented on GitHub (Dec 19, 2019):

That makes a lot more sense. The image loading relation definitely is a key link between the two. Thanks for the explanation! Internet explorer libraries... I'm both horrified and intrigued.

@mkitzan commented on GitHub (Dec 19, 2019): That makes a lot more sense. The image loading relation definitely is a key link between the two. Thanks for the explanation! Internet explorer libraries... I'm both horrified and intrigued.
Author
Owner

@patriksvensson commented on GitHub (Dec 23, 2019):

@DHowett-MSFT Ah, I was looking for dupes before posting this but couldn't find any. Sorry! 😅

@patriksvensson commented on GitHub (Dec 23, 2019): @DHowett-MSFT Ah, I was looking for dupes before posting this but couldn't find any. Sorry! 😅
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 23, 2019):

Ah, don’t worry about that: we reopened a closed bug as the duplicate of this one, and I don’t expect people to find those as readily. :)

@DHowett-MSFT commented on GitHub (Dec 23, 2019): Ah, don’t worry about that: we reopened a closed bug as the duplicate of this one, and I don’t expect people to find those as readily. :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5628