Skip to content

fix: avoid local terminal selection on open - #55

Merged
qfxiongbinbin merged 1 commit into
mainfrom
fix/local-terminal-selection-on-open
Apr 15, 2026
Merged

qfxiongbinbin merged 1 commit into
mainfrom
fix/local-terminal-selection-on-open

Conversation

@qfxiongbinbin

Copy link
Copy Markdown
Owner

问题

本地 terminal 在刚打开时,容易出现一大片误选中的绿色区域。用户并没有主动想选中文本,只是打开了 terminal。

原因判断

  • terminal 挂载后立即 focus
  • 打开 terminal 的鼠标动作还没完全结束
  • xterm 接住这一轮事件后,容易把它当成选择行为

这次修复

  • 去掉 terminal 挂载时的立即 focus
  • 在挂载后的下一帧主动清一次 selection
  • 清理时顺手取消对应的 animation frame

预期效果

  • 刚打开本地 terminal 时,不再轻易出现大片误选
  • 用户真正点击 terminal 时,仍然可以正常聚焦和输入

@qfxiongbinbin
qfxiongbinbin merged commit 6c15c6e into main Apr 15, 2026
@qfxiongbinbin
qfxiongbinbin deleted the fix/local-terminal-selection-on-open branch April 15, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant