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
-
難度 2/5 1-3 小時 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
bug rules
難度 2/5 1-3 小時 新手友好度 72/100
-
app bug
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 88/100
IronCoreLabs/ironcore-alloy#346 ·
-
good first issue
難度 2/5 1-3 小時 新手友好度 65/100