microsoft / terminal

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

Graphical corruption when Terminal loses/regains focus (on Intel iGPU?) #8286

Closed Johnlon closed 1 year ago

Johnlon commented 3 years ago

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] Version 10.0.18363 Build 18363

Windows Terminal version (if applicable): Version: 1.4.3141.0

Any other software?

Steps to reproduce

Moving away focus to another app and coming back.

Expected behavior

No corruption

Actual behavior

image

Seems to get worse as I alt tab away and back.

Not consistently happening so not sure how to provoke.

If I force a repaint by dragging over it then this repairs the view

However, if I scroll the window then the corruption moves with it so I guess the canvas data is corrupted somehow?

zadjii-msft commented 3 years ago

Well I've certainly never heard of anything like that. What kind of graphics card, driver, do you have? If the corruption scrolls with the buffer, then whatever is corrupted in the graphics memory must be getting moved with the Present1 call we use to scroll the buffer.

Johnlon commented 3 years ago

This is a Dell XPS 15 laptop running integrated graphics on an i7-9750H cpu.

It just happened again and I recorded a video if you would like me to share it privately with you.

On this occasion I was in vi inside WSL inside Terminal.

Inside vi I was able to scroll the terminal up/down and the corruption followed. However, when vi scrolled up it repainted the screen and refreshed the corruption fixing it - this may be a vi thing.

When at the terminal prompt instead of being in vi I have seen hitting CR cause corruption to scroll off the top. I have a video of this too.

When moving the window then the whole window is freshed, or dragging across it causes the dragged area to refresh..

JL

DHowett commented 3 years ago

This is amazing!

Can you try these two options? Don't try them at the same time unless you want a significant performance hit :smile:

global settings (outside of any profile, outside the defaults section)

"experimental.rendering.forceFullRepaint": true: this will keep GPU acceleration on, but redraw the entire screen every time something changes

"experimental.rendering.software": true: this will disable GPU acceleration, but keep the partial screen repainting

(If you enable both, you get full screen repainting plus software rendering, which while slow is a great fallback compatibility mode.)

Johnlon commented 3 years ago

Not happen today. Will see if it reoccurring tomorrow

ghost commented 3 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.

Johnlon commented 3 years ago

I haven't been using the terminal for a few days. Will get back to you.

Johnlon commented 3 years ago

No further issues since .. experimental.rendering.forceFullRepaint": true: Should I also try other setting?

However, Calculator has exactly the same corruption issue?

What's the theory?

zadjii-msft commented 3 years ago

However, Calculator has exactly the same corruption issue?

w a t. If experimental.rendering.forceFullRepaint fixed it, I'd think that it was some glitch in how we're handling partial presentation for scrolling the buffer, esp. w.r.t. your specific graphics card. This happens from time to time, see #8371 for another instance just this week.

However, if this is happening in Calculator too, then I'm out of theories as to what might be happening. Did you file an issue on the calculator repo? Maybe they've got a better theory?

Johnlon commented 3 years ago

I figured that terminal and calculator might be using some common framework?

The corruption has not reoccurred in terminal since that cfg hack.

I have not raised ticket on calculator

Johnlon commented 3 years ago

My laptop has integrated graphics and also as 1060 graphics card. However I believe in the integrated graphics are used for everything

onomatopellan commented 3 years ago

@Johnlon You can try this to assign a specific GPU for the Windows Terminal.

zadjii-msft commented 3 years ago

I think this is gonna end up like #8371. We can't repro it locally, so I'm not sure there's anything else we can do to debug it, but we can keep an eye out for future reports, and maybe help narrow the cause down. I've marked this bug up for our backlog and stuck the "needs repro" tag on it. Probably our best bet is gonna be someone on the team getting this under a debugger . . . but that's going to be difficult.

epigramx commented 3 years ago

I see something similar (though not exactly (it has some kind of transparency having the corruption(point me to another report if it exists))) on amd graphics on multi monitor. I suspect it's very related to hardware acceleration (I do not know if it's their bug or this' bug but I suspect it's common hardware acceleration bugs because chrome has some issues with it as well). I will try the setting related to accel above because I'm almost certain it will alleviate it.

NeonOdyssey commented 3 years ago

I am also having this same issue. I did not encounter this issue until today. System resources were all below 10-2%.

System Specs

GTX 1080 Ti 32 GB Ram i7-9700k

Screenshot

It does not cover the whole screen but does not affect the terminal application.

image

DanPinGF commented 2 years ago

Looks like an outdated graphics driver, perhaps? I actually had a similar graphics-related problem (artifacts, screen flickering, etc.), especially outside the Terminal app. My HP Laptop 15-dy1751ms, 10th Gen i5 Quad-Core, has had a faulty Intel UHD Graphics driver shipped with it, and I did not manage to fix it until way later when I upgraded to Windows 11 and downloaded the latest graphics driver software a bit afterwards.

epigramx commented 2 years ago

I see something similar (though not exactly (it has some kind of transparency having the corruption(point me to another report if it exists))) on amd graphics on multi monitor. I suspect it's very related to hardware acceleration (I do not know if it's their bug or this' bug but I suspect it's common hardware acceleration bugs because chrome has some issues with it as well). I will try the setting related to accel above because I'm almost certain it will alleviate it.

That didn't fix it by the way. It's probably related to amd drivers. It might be also terminal's fault because when I use ConEmu instead: it does not happen.

epigramx commented 2 years ago

It's not 100% confirmed yet, but I haven't seen this issue on windows 11 yet, so it could be a windows bug with a fix that never found its way into 10.

NeonOdyssey commented 2 years ago

It's not 100% confirmed yet, but I haven't seen this issue on windows 11 yet, so it could be a windows bug with a fix that never found its way into 10.

I can confirm that this issue has not occurred since upgrading to windows 11

zadjii-msft commented 1 year ago

I'm fully expecting that this was either:

If anyone is still seeing this on 1.18+, we'll probably want a new thread to track it. The new rendering engine is quite a bit different.