CLAUDE.md@packages/tuiA
CLAUDE.md@packages/tui from context4ai/context is a CLAUDE.md file: the standing instructions Claude Code reads in that repo.
mdr add context4ai/context/packages/tui/CLAUDE.md@git:20260817.7056cd2Pins git:20260817.7056cd2 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 14 of 14 checks passed
- Kind
- CLAUDE.md file
- Repository
- context4ai/context
- Path
packages/tui/CLAUDE.md- Versions recorded
- 1
- Latest version
- git:20260817.7056cd2, committed Aug 17, 2026
- Size
- 2,752 bytes
- Repository stars
- 8
- License
- MIT
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# @c4a/tui
基于 Ink 5.x 的终端 UI 共享组件库,供 `dev-cli` 使用。
## Ink stdin 生命周期陷阱(必须遵守)
Ink 在 unmount 时会对 `process.stdin` 执行以下操作:
1. `stdin.setRawMode(false)` — 关闭 raw mode
2. `stdin.removeListener("readable", ...)` — 移除数据监听
3. **`stdin.unref()`** — 取消事件循环引用
第 3 步会导致:Ink 退出后如果立即使用 `readline.createInterface` 读取用户输入,Node.js 事件循环因无活跃 ref handle 而**直接退出进程**,readline 来不及等待输入。
**任何在 Ink render/unmount 之后需要读取 stdin 的场景,都必须先恢复 stdin 状态:**
```typescript
function resetStdin(): void {
const { stdin } = process;
if (stdin.isTTY) {
try {
stdin.setRawMode(false);
} catch {
// ignore
}
}
if (typeof stdin.ref === "function") {
stdin.ref(); // 重新引用,防止事件循环退出
}
if (stdin.isPaused()) {
stdin.resume(); // 恢复流
}
// 清理 Ink 遗留的 listener
stdin.removeAllListeners("readable");
stdin.removeAllListeners("data");
}
```
**调用时机**:在 `inkRender` 返回的 `waitUntilExit()` resolve 之后、执行任何 readline 操作之前。
典型模式:
```typescript
const selection = await showMenu(); // 内部 inkRender + waitUntilExit
resetStdin(); // 必须在此恢复
await executeCommand(selection); // 内部可安全使用 readline
```
## Unicode 宽字符与 Ink 布局(必须遵守)
…Read the whole file at its exact version.
How to install
mdr add context4ai/context/packages/tui/CLAUDE.md@sha256:e4649ce838ac241bThe line at the top of this page pins the label git:20260817.7056cd2, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_67vpceagzejtxvur)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Aug 17, 2026.
Audit of the latest version
- pass: Size between 200 bytes and 200 KB (2752 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
context4ai/context · 8 stars · license MIT · pushed 2026-10-19 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_67vpceagzejtxvur GET https://markdownregistry.com/api/v1/resolve?ref=context4ai/context/packages/tui/CLAUDE.md GET https://markdownregistry.com/api/v1/blob/e4649ce838ac241bbd4598eadbb349226cf3203983bd8418733085c66a8c6a84
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: what a CLAUDE.md file is · keeping AGENTS.md and CLAUDE.md in sync · which agent file does what.
More from context4ai/context
Every file in context4ai/context