kingToolbox / kingToolbox/WindTerm
终端输入命令延迟很大。The first input of a terminal command has a large delay.
- Dominant language
- C
- Stars
- 32.3k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
这个软件很好用,我很喜欢。
我发现终端输入延迟很大,这个问题**周期性触发**,我经过简单观察和测试,我认为**和WindEdit有关**。
开启sysmon,然后什么都不要做,等待sysmon信息变化后,输入字符后就100%触发延迟bug。
首次:
我发现当我关闭了所有终端右下角监视器(sysmon)功能后,输入延迟得到了极大缓解。
进一步发现:
当WindEdit界面字符发生变化后,用我浅薄的知识分析一下,可能是只更新了状态而界面没有更新,导致此时输入命令时,会卡顿等待直到某个功能代码触发了界面更新后,命令字符出现了。当开启右下角监视器(sysmon)时,我观察监视器大约2s左右更新一次,所以首次输入的延迟在2s以内。
最后:
我关闭了sysmon后,虽然输入延迟有极大的缓解,但如果首次进入终端或者切换选项卡或者其他未知操作可能导致WindEdit变化时,可能还会出现延迟的问题。但是触发的次数很少并且我可以接受。
尽管如此,关闭sysmon后,触发延迟的次数降低了很多。
注:上文的WindEdit界面字符发生变化我认为分两种
1、代码层面控制WindEdit发生变化,如Sysmon定时更新CPU数值。
2、鼠标或者键盘的Input事件(假设类似Web中Input事件)。
还有一个注意:WindEdit的光标位置之后发生变化触发bug的概率更高。
我的语文和英文很差,未过多组织语言,想到哪里写到哪里,希望对修复这个bug有所帮助。
**如下为谷歌翻译内容,未检查**
**This is content translated by Google; I have not verified the accuracy of the translation.**
This software is great, I really like it.
I've noticed a significant input delay in the terminal. This problem triggers **periodically**. After some simple observation and testing, I believe it's **related to WindEdit**.
Enabling sysmon and doing nothing, waiting for the sysmon information to change, and then inputting characters triggers the delay bug 100% of the time.
Initial Impressions:
I found that disabling all sysmon (the monitor in the lower right corner of the terminal) significantly reduced the input delay.
Further Exploration:
When the characters in the WindEdit interface change, based on my limited knowledge, it seems only the status is updated, not the interface itself. This causes a pause when inputting commands until a certain function triggers an interface update, at which point the command characters appear. When sysmon is enabled, I observed that the monitor updates approximately every 2 seconds, so the initial input delay is less than 2 seconds.
Finally:
After disabling sysmon, the input delay was greatly reduced, but a delay might still occur if the user first enters the terminal, switches tabs, or performs other unknown operations that could cause changes in WindEdit. However, the number of times this happens is very small and acceptable to me.
Despite this, disabling sysmon significantly reduced the number of delayed triggers.
Note: I believe the changes in the WindEdit interface characters mentioned above fall into two categories:
1. Changes controlled at the code level, such as Sysmon periodically updating CPU values.
2. Mouse or keyboard input events (similar to input events in web applications).
Another point to note: Changing the cursor position in WindEdit afterward increases the probability of triggering the bug.
My Chinese and English are poor, so I haven't organized my thoughts much; I'm just writing as thoughts come to mind. I hope this helps in fixing this bug.
@dnlchen @kingToolbox
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue in the terminal with sysmon enabled: wait for its information to change, then type the first character and compare the behavior with sysmon disabled. Also test entering the terminal, switching tabs, and moving the cursor; done means the first command input no longer experiences the reported delay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100