microsoft / terminal

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

Terminal becomes extremely laggy after printing large amount of CJK characters #17414

Closed fireattack closed 3 months ago

fireattack commented 4 months ago

Windows Terminal version

1.20.11381.0

Windows build number

10.0.19045.4412

Other Software

No response

Steps to reproduce

s = '打印一个非常长的中文句子,啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊'
for _ in range(100):
    print(s)
var s = '打印一个非常长的中文句子,啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊'
for (var i = 0; i < 100; i++) {    console.log(s)    }

Run any of the above script (python or node) in a WT tab.

Expected Behavior

It prints all the lines very quickly and you can scroll the window with ease.

Actual Behavior

It becomes very laggy (takes seconds to print the whole thing) and after printing, the whole window becomes very laggy, you can barely scroll back and forth.


So, this problem is tricky because I can't find a reliable way to reproduce it. All I can confirm is that:

The issue only started to happen in recent months.

It usually starts to happen after I use my computer for extended time (I leave my computer on 24/7). And once it started to appear, it will affect all the Terminal windows, old or new. And it does not matter which type, can reproduce in CMD, PS, PS7 etc.

Furthermore, once the bug appears, the only way I can fix it is by restarting my computer.

It only happens when printing large amount CJK characters (Chinese, Japanese, etc.). Printing ASCII characters are fine.

crazyGru commented 4 months ago
  1. Close all instances of Windows Terminal.
  2. Delete the settings file located at %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json.
  3. Restart Windows Terminal, which will generate a new settings file with default settings.
lhecker commented 4 months ago

You may be running out of GPU memory. The next time this happens can you check your GPU memory usage in Task Manager?

DHowett commented 4 months ago

Can you confirm whether you are using the "new text rendering engine", or whether you have it disabled? Version 1.20 will be the last version with the old text rendering engine, so it will be important to know if the issue is with the new one.

fireattack commented 4 months ago

Yes, I'm using the new "AtlasEngine":

2024-06-13

As for GPU memory, I think it's unlikely since I have a 16GB RTX 4060Ti, but I can check it next time this happened.

The full settings.json is also attached but nothing unusual.

carlos-zamora commented 3 months ago

@fireattack Any updates? Has this occurred again over the past few weeks /?

fireattack commented 3 months ago

@carlos-zamora no, i didn't see it happen lately (granted, i didn't use it heavily either).

carlos-zamora commented 3 months ago

Thanks! We're going to close this bug, but happy to reopen it if you see it again. Just let us know 😊