antfu-collective / taze

🥦 A modern cli tool that keeps your deps fresh
MIT License
2.83k stars 86 forks source link

Interaction mode flicker issue (交互模式闪烁问题) #107

Open fxzer opened 6 months ago

fxzer commented 6 months ago

Describe the bug

执行 taze -rI major -f ,上下移动进行选择时出现终端闪烁问题 There is a terminal flashing issue when executing taze -rI major -f while moving up and down for selection

VSCode Terminal testing

flash-bug

Warp 测试(使用 Warp 执行也是一样的,应该不是命令行工具的问题)

Warp testing (using Warp to execute is also the same, it should not be a problem with command-line tools) warp-test


prompts (2.4.2)Demo测试(没有出现闪烁现象,应该不是 promps 的 bug)

prompts (2.4.2) Demo test (no flickering phenomenon, it should not be a bug in prompts)

test

Reproduction

taze -rI major -f

System Info

node       v18.18.2
taze       0.13.3
prompts    2.4.2
zsh 5.9    (x86_64-apple-darwin23.0)

Used Package Manager

pnpm

Validations

antfu commented 6 months ago

PR welcome :)

SukkaW commented 6 months ago

I have successfully reproduced the issue on a significantly large repository (vercel/next.js with 439 devDeps).

I suspect that the issue is caused by having prompts rendered an extensive amount of text. Each time it re-renders (triggered by a keyboard input), it repaints the entire screen from scratch. This is evident in the screen recording where the cursor consistently jumps back to the initial position.

I guess the only solution is either render a small UI, or make prompts faster.