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

Đang mở Phù hợp với người mới
#2,977 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash, bun, typescript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu với khối bàn giao quanh các dòng 555–560 trong install/install.sh; so sánh cách lệnh tty xác định thiết bị đầu cuối với thao tác chuyển hướng đến /dev/tty trong các trường hợp tái hiện bằng Bun đã được báo cáo. Kiểm tra để bảo đảm pipe của tập lệnh cài đặt không được truyền cho claude và các bước bàn giao khi cài mới cũng như cập nhật hoạt động trên macOS. Hoàn tất khi việc khởi chạy không còn gặp lỗi EINVAL và không cần đến cách khắc phục được đề xuất nữa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
20k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.