terminal: Renderer encountered an unexpected error: -2005270527

Windows Terminal version

1.16.2642.0

Windows build number

10.0.22000.978

Other Software

No response

Steps to reproduce

  1. Have a session open (this one is powershell running OpenSSH to a Linux VM)
  2. Suspend the system
  3. Wake the system

After resuming, I continuously get the following error: Renderer encountered an unexpected error: -2005270527. Dismissing it just causes it to come up again. I tried dismissing it about 20 times and it didn’t clear.

Expected Behavior

No errors.

Actual Behavior

Repeated continuous popups of the following error: image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 42 (17 by maintainers)

Commits related to this issue

Most upvoted comments

@lhecker Your posted version Version: 1.18.1443.0 seems to fix everything.

To be clear I was facing at least 3 distinct issues:

  1. If I snapped the Window to any side of the screen with Win+Arrow it would immediately crash with the -2005270527 error as titled in this issue.
  2. When initially started the terminal would only show bars or blocks instead of text. Texted typed would also be the same, and output to the terminal was blank, and then it would magically resolve itself after some time, or when I pressed Print Screen or opened the snipping tool (probably switching to any other window would fix it?). So I couldn’t screen shot it.
  3. The “Filled Block” cursor was showing up when I thought I had selected “Bar”, which you’ve described was a config issue.

I think I was getting confused by 2 and 3 together, because I thought the series of blocks/bars was my cursor, but it was just what the terminal was spitting out instead of the normal prompt of my text.

In PowerShell if I run the given "$([char]0x1b)]11;rgb:7f/7f/7f$([char]0x1b)\" command the screen turns grey with light grey text, but the cursor is visibly flashing.

Everything seem entirely fixed now with 1.18.1443.0 while using the AtlasEngine.

Yep that’s for sure. The way the old text renderer uses IDXGISwapChain::Present is a lot more primitive. But does using “Atlas” with the custom preview build I linked above solve the issue? It’s okay if you don’t want to use such a custom version of course. 🙂 We’ll likely release an update sometime soon. We do intend to make the new text renderer the default with 1.19 and any help we can get to test it would be extremely appreciated!

If anyone is still experiencing this issue in the latest Terminal versions, please let me know! I’ll close this issue as resolved in a week otherwise. 🙂

You can also just try:

    "profiles":
    {
        "defaults":
        {
            "useAtlasEngine": false
            

in the settings. That should switch back to the old renderer

I have this problem intermittently as well and am also running windows terminal preview 1.16.2642.0.

In my case I hibernate, as opposed to sleep, my machine. I tend to find the error occurs when I resume a tmux session, but I just happened to get the problem just now when I went into vim from a local bash shell.

What I find is that if I resize the main window after the error is shown, then it’s not shown again for the rest of the session.

It might be related but I also sometimes find that, after resuming, my tmux session doesn’t seem to know the window size correctly, for example it puts the tmux status bar on the wrong row. Again, resizing the main window fixes that problem.

FYI: If you use “Caskaydia Cove” from the Nerd Fonts website, I found that it had a lot (really, a lot) of subtle issues at least until a few months ago, whereas Delugia is almost flawless and extremely close to the original Cascadia Code. Delugia is sort of what Caskaydia Cove is based on, and I can only recommend trying it out.


@chrisl8 Ah I think I misunderstood you. The way you describe this issue:

However, I still get a “filled box” cursor in 18, regardless of what I set the cursor to, while I get the requested Bar cursor in 17.

made it sound like #15427. But what you wrote afterwards:

It seems I have a lot of profiles, some show up in the JSON but not the GUI and fiddling with the “cursorShape” entry in the JSON fixes this, even though fiddling with it in GUI does not.

makes it instead sound like you’ve been victim of our somewhat confusing “settings layering” where the per-profile settings “override” the settings in the “Defaults” profile and you need to reset the per-profile ones for the “Defaults” to take effect. So I guess it’s not really a rendering issue after all!

Otherwise, you can always confirm if you use the full-featured, performant Direct3D renderer, or the slower Direct2D renderer by running this in a new PowerShell tab:

"$([char]0x1b)]11;rgb:7f/7f/7f$([char]0x1b)\"

It doesn’t matter if it’s the old “powershell.exe” or the new “pwsh.exe”. If the cursor is visible afterwards, you’re using Direct3D and if it’s invisible Direct2D. #15427 only affects the Direct2D renderer.

I just tried your “totally not sketchy” build (i verified it was signed by MS 😃 ) and it crashes…

splitting-fail3

If the issue happens often enough, one option is to enable the debug layer and listen for debug messages. This however only works if you have the “Graphics Tools” feature installed (Settings app > “Apps” > “Optional Features”). If you want to try that, here’s how to do it:

1. First enable the debug layer:
   
   * On modern Windows you can run:
     ```powershell
     d3dconfig apps --add WindowsTerminal.exe
     d3dconfig debug-layer debug-layer-mode=force-on
     ```
   * On older Windows:
     Run `dxcpl` from the start menu and click this:
     ![image](https://user-images.githubusercontent.com/2256941/240584691-36b9a1d7-fc4c-4972-b77c-d7c33736924e.png)

2. Listen for debug output via [DbgView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview).

3. Disable the debug layer
   
   * New:
     ```powershell
     d3dconfig --reset
     ```
   * Old:
     ![image](https://user-images.githubusercontent.com/2256941/240585347-f93fc613-e4e6-49b9-8751-40012e909f2e.png)

I’ve got this upon error: 00000001 0.00000000 [18696] DXGI ERROR: IDXGISwapChain::Present: Partial Presentation (using scroll or dirty rects) is not valid until first submitting a regular Present without scroll or dirty rects. Otherwise, the preserved back-buffer data would be uninitialized. [ MISCELLANEOUS ERROR #105: ]

Got this issue “Renderer encountered an unexpected error: -2005270527” on the latest Terminal Preview [v1.18.1421.0] Repro: start nvim in WSL ubuntu

I fixed that issue here: #15262 It’s a somewhat annoying bug, so I’ll try to get it merged soon. I‘m super happy to see you try out the main branch btw! I hope there aren’t any serious issues apart from that one. 😊

I get this unexpected error when running oh-my-posh debug in maximized window (maximized before running the command) with “AtlasEngine” enabled.

DebugView shows the following message when the pop-up shows up:

[3676] DXGI ERROR: IDXGISwapChain::Present: The scroll rect #0 passed to Present is empty. ScrollRect = RECT{ left = 0, top = 0, right = 1888, bottom = 0 } [ MISCELLANEOUS ERROR #109: ]

Terminal version: ae7595b (Release, x64), can’t reproduce in 1.16.10261.0 Windows build number: 19045.2846 oh-my-posh version: 15.4.0

oh-my-posh theme
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  // "console_title_template": "{{ .Shell }} - {{ .UserName }}: {{ .PWD }}",
  "console_title_template": "{{ .UserName }}: {{ .PWD }}",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "os",
          "style": "diamond",
          "foreground": "#fff",
          "background": "#003543",
          "leading_diamond": "\ue0b6",
          "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}}",
          "properties": {
            "windows": "\ue62a"
          }
        },
        {
          "type": "session",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#d2ff5e",
          "background": "#003543",
          "template": "{{ if .SSHSession }}\udb80\udf18 {{ end }}{{ .UserName }} ",
          "properties": {
            "display_host": false
          }
        },
        {
          "type": "path",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#003544",
          "background": "#0087D8",
          "template": " \ue5ff {{ path .Path .Location }} ",
          "properties": {
            "folder_separator_icon": "/",
            "style": "full"
          }
        },
        {
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#193549",
          "background": "#d2ff5e",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}",
            "{{ if gt .Ahead 0 }}#89d1dc{{ end }}",
            "{{ if gt .Behind 0 }}#f17c37{{ end }}"
          ],
          "template": " {{ .UpstreamIcon }}{{ .HEAD }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \udb80\udd93 {{ .StashCount }}{{ end }} ",
          "properties": {
            "fetch_stash_count": true,
            "fetch_status": true,
            "fetch_upstream_icon": true
          }
        },
        {
          "type": "exit",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#242424",
          "background": "#33DD2D",
          "background_templates": [
            "{{ if gt .Code 0 }}#f1184c{{ end }}"
          ],
          "template": " \udb81\udf8f {{ if gt .Code 0 }}\uf00d {{ .Code }}{{ else }}\uf42e{{ end }} ",
          "properties": {
            "always_enabled": true
          }
        }
      ],
      "vertical_offset": 1
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "spotify",
          "style": "powerline",
          "powerline_symbol": "\ue0b2",
          "invert_powerline": true,
          "foreground": "#ffffff",
          "background": "#1BD760",
          "template": " \udb81\udcc7 {{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }} ",
          "properties": {
            "paused_icon": "\udb80\udfe4 ",
            "playing_icon": "\ue602 ",
            "stopped_icon": "\uf04d ",
            "track_separator": " - "
          }
        },
        {
          "type": "battery",
          "style": "powerline",
          "powerline_symbol": "\ue0b2",
          "invert_powerline": true,
          "foreground": "#242424",
          "background": "#f36943",
          "background_templates": [
            "{{ if eq \"Full\" .State.String }}#0476d0{{ end }}",
            "{{ if eq \"Charging\" .State.String }}#33DD2D{{ end }}",
            "{{ if eq \"Discharging\" .State.String }}#FFCD58{{ end }}"
          ],
          "template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}\uf295 \udb80\udc84 "
        },
        {
          "type": "python",
          "style": "powerline",
          "powerline_symbol": "\ue0b2",
          "invert_powerline": true,
          "foreground": "#003544",
          "background": "#0087D8",
          "template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ",
          "properties": {
            "display_mode": "context",
            "fetch_version": true,
            "fetch_virtual_env": true
          }
        },
        {
          "type": "node",
          "style": "powerline",
          "powerline_symbol": "\ue0b2",
          "invert_powerline": true,
          "foreground": "#ffffff",
          "background": "#6CA35E",
          "template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} "
        },
        {
          "type": "rust",
          "style": "powerline",
          "powerline_symbol": "\ue0b2",
          "invert_powerline": true,
          "foreground": "#193549",
          "background": "#99908a",
          "template": " \ue7a8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
        },
        {
          "type": "executiontime",
          "style": "powerline",
          "powerline_symbol": "\ue0b2",
          "invert_powerline": true,
          "foreground": "#ffffff",
          "background": "#8800dd",
          "template": " <#fefefe>\udb81\udead</> {{ .FormattedMs }} ",
          "properties": {
            "threshold": 500,
            "style": "austin"
          }
        },
        {
          "type": "time",
          "style": "diamond",
          "invert_powerline": true,
          "foreground": "#fff",
          "background": "#003543",
          "trailing_diamond": "\ue0b4",
          "template": "<#fff> \udb82\udd54 </>{{ .CurrentDate | date .Format }} "
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "root",
          "style": "plain",
          "foreground": "#FFD700",
          "template": " \uf0e7 "
        },
        {
          "type": "text",
          "style": "plain",
          "foreground": "#f1184c",
          "template": "\ud83d\ude80"
        }
      ],
      "newline": true
    }
  ]
  // "transient_prompt": {
  //   "background": "transparent",
  //   "foreground": "#FFD700",
  //   "template": "{{if .Root}}\u26a1 {{end}}🚀 "
  // }
}

Theme uses symbols from Nerd Fonts v3 (used font was CaskaydiaCove Nerd Font), but the bug can be reproduced even with the default font.

Maximized Terminal Dev with transparency and a "Renderer encountered an unexpected error: -2005270527" pop-up, behind it a DebugView and dxcpl windows are open, VS 2022 Preview open on the second screen