install.sh hand-off `exec claude … < /dev/tty` crashes with `EINVAL: invalid argument, kqueue` on macOS

未关闭 适合新手
#2,977 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, bun, typescript
领域
cli

调研方向

从 install/install.sh 第555–560行附近的交接代码块开始;比较 tty 命令解析终端设备的方式与已报告的 Bun 复现案例中重定向到 /dev/tty 的做法。检查安装脚本的管道没有传递给 claude,并确认全新安装和更新时的交接在 macOS 上都能正常工作。完成标准是启动时不再因 EINVAL 崩溃,且不再需要建议的解决方法。

由索引模型根据 Issue 内容生成。

描述

Summary

The install finishes, but the last step ("Launching /LifeOS setup..." on a fresh install, "Launching /LifeOS update..." on an existing one) crashes. install.sh runs exec claude "$NEXT_INTENT" < "$TTY_DEV" with TTY_DEV defaulting to /dev/tty. On macOS, Bun cannot register the generic /dev/tty node with kqueue, so the process dies with an unhandled stream error. The user has to start the session by hand.

Environment

  • macOS 27.2.1 (arm64)
  • Bun 1.4.4 and 1.4.6 (the crash happens inside claude, which embeds Bun)
  • Reproduced in Terminal.app and in a second terminal, via curl -fsSL https://ourlifeos.ai/install.sh | bash, on both a fresh install and the update path

Minimal repro (no LifeOS or Claude Code involved)

bun -e 'process.stdin.resume(); setTimeout(() => process.exit(0), 500)' < /dev/tty
# -> error: EINVAL: invalid argument, kqueue   (Bun v1.4.4, macOS arm64)

bun -e 'process.stdin.resume(); setTimeout(() => process.exit(0), 500)' < "$(tty)"
# -> exits cleanly

Both commands were run separately in an interactive terminal; only the /dev/tty one crashes.

Actual output from the installer

ℹ Launching /LifeOS update...
error: EINVAL: invalid argument, kqueue
      at emitError (node:events:50:13)
      at emitErrorNT (internal:streams/destroy:88:12)
      at emitErrorCloseNT (internal:streams/destroy:69:14)

Bun v1.4.6 (macOS arm64)

Where

install/install.sh, hand-off block (~lines 555-560):

TTY_DEV="${LIFEOS_TTY:-/dev/tty}"
...
exec claude "$NEXT_INTENT" < "$TTY_DEV"

Suggested fix (untested)

The redirect exists so claude does not read the curl | bash script pipe. Resolving the real device name should keep that behavior:

TTY_DEV="${LIFEOS_TTY:-$(tty < /dev/tty 2>/dev/null || echo /dev/tty)}"

Alternatively, skip the redirect when [ -t 0 ] is already true. has_terminal should keep working unchanged.

Workaround

Run claude "/LifeOS setup" directly, or install with LIFEOS_NO_LAUNCH=1.

Related upstream

oven-sh/bun#24158 (closed) covers a similar /dev/tty + kqueue EINVAL on macOS. I have not checked which Bun release contains its fix.

主要语言
TypeScript
星标
20k
派生
2.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

danielmiessler/LifeOS 的其他 Issue

查看 danielmiessler/LifeOS 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。