feat: Implement colored output (with `NO_COLOR` support)
还没有人认领这个 Issue。
评估
调研方向
从 rust/stackablectl/src/main.rs 中链接的 pretty 方法附近开始,比较 tracing_subscriber::fmt 是否应负责终端检测。使用重定向和管道输出运行列出的 stackablectl 命令,包括 TERM 为空的情况,并确认非交互式输出不包含转义序列,而受支持终端的输出仍保持彩色,并且遵循 NO_COLOR。
由索引模型根据 Issue 内容生成。
描述
Colours sould only be enabled when the terminal supports them.
For example, when redirecting output or piping to cat, there should be no escape sequences.
I believe there needs to be a condition around the pretty method (or maybe it should be handled by tracing_subscriber::fmt):
Examples:
stackablectl --log-level=DEBUG stack list > /tmp/stackablectl.stdout # plain redirect
stackablectl --log-level=DEBUG stack list | cat > /tmp/stackablectl.stdout # pipe through cat
TERM= stackablectl --log-level=DEBUG stack list > /tmp/stackablectl.stdout # explicitly set TERM to nothing
If I open it in VIM, it looks like this:
- 主要语言
- Rust
- 星标
- 10
- 派生
- 5
- 平均合并
- 4 小时 41 分钟
- 30 天内合并 PR
- 4
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stackabletech/stackablectl 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
stackabletech/stackablectl#456 ·
-
RUSTSEC-2026-0221: `event-listener` allows `!Send` tags to cross thread boundaries via `StackSlot` 未关闭
难度 3/5 1-2 天 新手友好度 35/100
stackabletech/stackablectl#452 ·
-
难度 4/5 3-5 天 新手友好度 45/100
stackabletech/stackablectl#444 ·
-
难度 5/5 一周以上 新手友好度 35/100
stackabletech/stackablectl#419 ·
-
难度 4/5 3-5 天 新手友好度 35/100
stackabletech/stackablectl#413 ·
查看 stackabletech/stackablectl 的全部 Issue
相似的 Issue
-
area: compat bug
难度 2/5 1-3 小时 新手友好度 72/100
-
area: dogs bug priority: P3 silent failure test-code
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 70/100
MystenLabs/sui#28056 · 1 条评论 ·
-
type/bug
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 75/100
Luminous-Dynamics/mycelix#2577 ·