microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.02k stars 8.23k forks source link

Split-Pane with 'backgroundImage' set, not showing all background images #6340

Open sleepnmojo opened 4 years ago

sleepnmojo commented 4 years ago

Environment

Microsoft Windows [Version 10.0.18363.836]
Windows Terminal version: 1.0.1401.0

Steps to reproduce

  1. Set up a profile to have a background image
  2. Close all terminals
  3. Open the terminal via wt split-pane, or wt -p "Command Prompt" ; split-pane -p "Windows PowerShell"

Expected behavior

Terminal to open with both background images shown

Actual behavior

Only a single pane shows the background image.

wt split-pane;split-pane also works correctly, and shows the expected behavior.

DHowett commented 4 years ago

... which profile has the background image?

sleepnmojo commented 4 years ago

I had it on my default (Windows Powershell 5.1) and Command Prompt. I get the same behavior if I do wt -p "Command Prompt" ; split-pane -p "Command Prompt".

sleepnmojo commented 4 years ago

These are the relevant sections of my settings:

    "profiles":
    {
        "defaults":
        {
            "fontFace": "FiraCode",
            "colorScheme": "Darkly",
            "cursorShape": "filledBox",
            "useAcrylic": true,
            "acrylicOpacity": 0.9,
            "padding": 3,
            "historySize": 32767
        },
        "list":
        [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "PowerShell 5.1",
                "commandline": "powershell.exe",
                "colorScheme": "Darkly Powershell",
                "hidden": false,
                "backgroundImage": "C:/Windows/Web/win.png",
                "backgroundImageOpacity": 0.05
            },
            {
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.scale-100.png",
                "name": "Command Prompt",
                "commandline": "cmd.exe",
                "hidden": false,
                "backgroundImage": "C:/Windows/Web/win.png",
                "backgroundImageOpacity": 0.05
            }

I tried turning off backgroundOpacity, and removing all the defaults, the issue persisted.

zadjii-msft commented 4 years ago

Wait is the commandline you're using wt -p "Command Prompt" ; split-pane -p "Windows PowerShell" or wt -p "Command Prompt" ; split-pane -p "PowerShell 5.1"?

sleepnmojo commented 4 years ago

They actually give the same result. The Command Prompt side shows no background image, the PowerShell side shows the background image.

I was using wt -p "Command Prompt" ; split-pane -p "Windows PowerShell", but I see why you ask, my profile is named PowerShell 5.1. I don't have a profile named, "Windows PowerShell", so it looks like it is loading the default profile. Regardless, wt split-pane produces the same issue.

I can also reproduce the issue with wt -p "Command Prompt"; split-pane -p "Command Prompt"

epoweripione commented 4 years ago

This issue seems to occur randomly, i met a few times, maybe the backgroup image too large (~350KB) and load timeout?

I run Windows Terminal 1.0.1401.0 on Windows 10.0.19041.329, Using: $env:comspec /c wt new-tab -p Debian; split-pane -p "PowerShell Core" -V

My profile settings:

    "profiles": {
        "defaults": {
            "fontFace": "FiraCode Nerd Font Mono",
            "fontSize": 12,
            "acrylicOpacity": 1.0,
            "useAcrylic": true,
            "cursorShape": "underscore",
            "backgroundImage":"%USERPROFILE%\\Pictures\\wt_bg.jpg",
            "backgroundImageOpacity" : 0.3,
            "backgroundImageStretchMode": "uniformToFill",
            "backgroundImageAlignment": "center",
            "colorScheme": "One Half Dark"
        },
        "list": [
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "name": "PowerShell Core",
                "commandline": "pwsh.exe -NoLogo",
                "hidden": false
                // "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
                "name": "Debian",
                "commandline": "wsl.exe ~ -d Debian",
                "hidden": false
                // "startingDirectory": "%USERPROFILE%/wslhome"
                // "source": "Windows.Terminal.Wsl"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "cmd",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure",
                "hidden": false
            }
        ]
    },
sleepnmojo commented 4 years ago

The image I'm using is 125KB. Its dimensions are 7111x4000. It is a png, with transparency.

zadjii-msft commented 4 years ago

By any chance, does resizing the window a little bit cause the image to load? I'm honestly just grasping at straws at this point. Does opening more that two panes with the image work?

I've tried locally with a profile with a background gif to no avail, so maybe the image size has something to do with it, but honestly I've got no ideas.

sleepnmojo commented 4 years ago

Resizing or maximizing shows the background image. The issue only happens on two panes. If I have three or more panes, then all background images show.

I changed the background image to a 46KB jpg (1920x1080), and I still have the issue. I changed the background image to a 496KB gif (320x180), and I did not have the issue.

zadjii-msft commented 2 years ago

Hey we've had piles of changes to the codebase over the last 18 months since this was filed - any chance you're still seeing this? This seems like the kind of thing that might have been fixed by a refactor along the way.

sleepnmojo commented 2 years ago

Microsoft Windows [Version 10.0.19043.1526] Windows Terminal Version: 1.11.3471.0

wt split-pane still does not work. wt -p "Command Prompt" ; split-pane -p "Command Prompt" does not work either wt -p "Command Prompt" ; split-pane -p "PowerShell 5.1" works now wt split-pane;split-pane still works wt split-pane;split-pane -p "Command Prompt" works

Looks like if I load two of the same instance, the issue is there. Go to three, it is gone. Two different instances, then no problem.

zadjii-msft commented 2 years ago

@sleepnmojo can you try out this preview build, v1.13? https://github.com/microsoft/terminal/releases/tag/v1.13.10395.0

I just realized that the refactor I'm thinking of might only be in 1.13

ghost commented 2 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

sleepnmojo commented 2 years ago

Microsoft Windows [Version 10.0.19043.1526] Windows Terminal Preview Version: 1.13.10395.0

Problem still occurs with these two commands wt split-pane wt -p "Command Prompt" ; split-pane -p "Command Prompt"

zadjii-msft commented 2 years ago

Help, thanks for trying, sorry we didn't just magically fix this one. I can't repro this myself so I suppose we'll need someone who actually can repro this to take a look. Thanks for confirming for me!

rafaeltab commented 2 years ago

I have a very similar problem When I run wt -d . ; split-pane -d . it will sometimes cause the right image not to load, sometimes the left one not to load, and sometimes both of them to load. At least one of them loads. Windows Terminal version: 1.12.10982.0

egherrmann commented 1 year ago

I encounter this bug literally every day. I use the "firstWindowPreference": "persistedWindowLayout" setting so my previous layout state is persisted when Terminal starts, and I usually have 3 tabs open with each having an up/down split pane.

The bug seems to occur most reliably when I change the focus to any non-Terminal window, like my browser or email client, then move the focus back to Terminal. Nearly every time I do that, either the top or bottom pane in at least one of the tabs will be missing its background image. I sometimes also see the bug when my focus stays in the Terminal window, but less frequently than when changing focus.

Resizing or maximizing the entire window or resizing the panes causes the background to load. Navigating between different Terminal tabs usually causes the background to load too.

I'm happy to provide whatever details I can to help repro this.