Skip to content

fix(terminal): keep touch selection free of custom context menus - #340

Merged
shihuili1218 merged 1 commit into
mainfrom
fix/mobile-long-press-context-menu
Nov 14, 2026
Merged

shihuili1218 merged 1 commit into
mainfrom
fix/mobile-long-press-context-menu

Conversation

@shihuili1218

@shihuili1218 shihuili1218 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

终端命令块的长按事件仍会打开自定义菜单;触摸生成的兼容鼠标事件也可能绕过原有的触摸判断。本次让触摸/笔长按保留原生选字行为,跳过终端自定义菜单,并继续保留 #333 阻止 xterm 清空原生选区的处理。

通过 sourceCapabilities.firesTouchEvents 识别触摸生成的兼容鼠标事件;其余事件继续使用已有的 pointerType 和前序输入跟踪。Tab 长按菜单独立保留,SFTP 菜单无改动。

入口影响:

  • 桌面 GUI:鼠标右键菜单及复制/粘贴设置保持可用;触屏长按走原生选字。
  • 移动 GUI:终端与命令块的触摸/笔长按不打开自定义菜单,不取消浏览器默认行为;外接鼠标右键、Tab 长按菜单保持可用。
  • CLI:不涉及,改动仅在前端输入与菜单处理。
  • Headless / JetBrains:复用相同前端处理,无新增 command 或后端适配修改。

验证:

  • npm test:123 个测试文件、1413 项测试通过。
  • npm run build 通过。
  • Chromium 完整前端和真实 xterm 验证(仅模拟 Tauri IPC):触摸、笔、旧 MouseEvent、触摸兼容鼠标事件均不打开终端自定义菜单,不取消默认行为,已有 DOM 选区保持;鼠标命令块菜单和 Tab 长按菜单正常。
  • git diff --check 通过。

环境缺少 Rust/Cargo,未完成 Rust 检查以及 Tauri / headless 原生启动验证。安卓真机上的蓝色选字手柄尚未复验。

Copilot AI balanced review requested due to automatic review settings November 14, 2026 03:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T03:42:48.842332Z ca9027f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shihuili1218
shihuili1218 merged commit 7404d6b into main Nov 14, 2026
2 checks passed
@shihuili1218
shihuili1218 deleted the fix/mobile-long-press-context-menu branch November 14, 2026 04:04
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.

2 participants