microsoft / microsoft/terminal

Terminal becomes extremely laggy after printing large amount of CJK characters

Open
#17,414 13 comments 0 reactions 0 assignees View on GitHub
Area-Rendering Issue-Bug Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.20.11381.0

### Windows build number

10.0.19045.4412

### Other Software

_No response_

### Steps to reproduce

```python
s = '打印一个非常长的中文句子,啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊'
for _ in range(100):
print(s)
```

```js
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.

Contributor guide

Open the contributing guide

Research direction

Start by running the Python or Node.js reproduction in a Windows Terminal tab and compare CJK output with ASCII after extended system uptime. The report names no source file or test entry point, and done would require identifying and fixing the lag while preserving fast printing and scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.