`nuxt dev`: takeover prompt loses raw mode when terminal doesn't answer OSC 11
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
从 withUserAttention 和 host.withTerminal 开始,然后将它们对 stdin 的处理与 src/boot.ts 中的 attachKeys 和 whenStdinReleased() 以及接管提示路径进行比较。在不响应 OSC 11 的终端中复现,并确认超时后提示仍保持 raw 模式。在这种情况下,方向键能够移动选项且 Enter 能提交选项,即为完成。
由索引模型根据 Issue 内容生成。
描述
Version: @nuxt/cli 4.0.3, Nuxt 4.6.4, Node 24.16, macOS
Repro
- Start
nuxt devin a project and leave it running. - In a terminal that does not reply to OSC 11 (
ESC ] 11 ; ? BEL), runnuxt devagain in the same project. - The "A Nuxt dev server is already running here" select prompt appears. Press ↑/↓.
Expected: the selection moves.
Actual: ~250ms after the prompt renders, stdin drops out of raw mode. Arrow keys echo as ^[[A, and Enter arrives as \n (readline names it enter, not return), so the prompt can't be answered. Only Ctrl-C gets out.
Cause
bootDevUI (src/boot.ts) paints the panel and calls queryBackground before the dev command reaches takeOverServer. listen() in src/dev/tui/background.ts captures wasRaw = false, sets raw mode, then in finish() (on reply or on the 250ms timeout) runs if (!wasRaw) stdin.setRawMode(false). By then clack's select has taken raw mode, so the restore turns it off underneath the prompt. attachKeys already waits for whenStdinReleased(); the takeover prompt (via withUserAttention) does not.
Verified by sampling the pty's termios flags: ICANON and ECHO switch back on 0.27s after the prompt appears. With NUXT_TERM_THEME=dark (no query sent), raw mode holds.
Suggested fix
Have withUserAttention / host.withTerminal await whenStdinReleased() before running the prompt, the same way attachKeys does. Alternatively, finish() could skip the raw-mode restore if stdin's raw state changed while the query was pending.
Workaround
export NUXT_TERM_THEME=dark (or light).
- 主要语言
- TypeScript
- 星标
- 402
- 派生
- 125
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 37
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuxt/cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
dev: false "reachable from the network" warning when `devServer.host` is a `*.localhost` subdomain可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 45/100
维护者通常 1 天内回复
相似的 Issue
-
[Bug]: Search input loses focus while typing on the Inventory, Reservations and Locations lists (view_configurations enabled)可能已有人在做 @medusa-os-bot 今天认领。 未关闭status: needs triaging type: bug version: 2.0
难度 2/5 1-3 小时 新手友好度 86/100
medusajs/medusa#17886 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 95/100
marimo-team/marimo#11949 ·
维护者通常 1 天内回复
-
bug server-time v2
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/servers#5559 ·
维护者通常 1 天内回复
-
D1 Time Travel restore help advertises 30 days without a plan qualifier可能已有人在做 @akhil9tiet 今天认领。 未关闭bug package:wrangler product:d1
难度 1/5 1-3 小时 新手友好度 78/100
cloudflare/workers-sdk#17000 · 2 条评论 ·
维护者通常 1 天内回复
-
bug severity:medium triage:confirmed triage:reproduced
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复