Skip to content

fix(tui): replace hardcoded colors with Color::Reset (closes #666)#671

Closed
merchloubna70-dot wants to merge 2 commits into
Hmbown:mainfrom
merchloubna70-dot:fix/terminal-colors-666
Closed

fix(tui): replace hardcoded colors with Color::Reset (closes #666)#671
merchloubna70-dot wants to merge 2 commits into
Hmbown:mainfrom
merchloubna70-dot:fix/terminal-colors-666

Conversation

@merchloubna70-dot

Copy link
Copy Markdown

用户反馈 v0.8.10 终端颜色渲染异常(#666)。

修复两处剩余硬编码颜色:

  • pager.rs: Color::Black → Color::Reset(高亮文字在暗色终端不可见)
  • widgets/mod.rs: Color::Rgb(18,29,39) → Color::Reset(硬编码深蓝背景在浅色终端显示异常)

新增 use_terminal_colors 配置项(预留,后续可全局切换)。

Closes #666


wangfengcsu@qq.com

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@ILoveScratch2

Copy link
Copy Markdown

谁家PR机器人

@Hmbown

Hmbown commented May 5, 2026

Copy link
Copy Markdown
Owner

Triple-check finding: dead config field

The use_terminal_colors config key was added to Config, config.example.toml, and config.rs merge logic, but zero rendering code paths read it. The field is set from config, stored, and never consulted. Setting use_terminal_colors = true has no effect on the TUI.

Recommendation: Either wire the field into the rendering layer (read it in deepseek_theme.rs or ui.rs to gate Color::Reset behavior) or remove the config key until the behavior is implemented. The Color::Reset migration from #651 already fixes the visual issue — this config knob is a plan for future user control over the feature, but the knob doesn't actually control anything yet.

@Hmbown

Hmbown commented May 5, 2026

Copy link
Copy Markdown
Owner

v0.8.12: removed dead use_terminal_colors field

Per the earlier review finding, the use_terminal_colors config field has been removed from both TuiConfig and config.example.toml. The field was defined and parsed but zero rendering code paths read it — setting it had no effect.

The Color::Reset migration from #651 already fixes the underlying visual issue. This config knob was intended for future user control over that behavior, but without the rendering-layer integration it was a no-op.

Commit: c0e27485a

The `use_terminal_colors` key was defined in config.rs and documented in
config.example.toml, but no rendering code ever read it. Setting it had
no effect. Remove the field until the behavior is implemented; the
Color::Reset migration already applies the correct terminal-color
behavior by default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@merchloubna70-dot

Copy link
Copy Markdown
Author

Fixed — removed use_terminal_colors: Option<bool> from Config and its entry in config.example.toml. The Color::Reset migration from this PR already fixes the visual behavior; the config knob can be reintroduced in a follow-up once the rendering path is wired to respect it.

…follow-up)

apply_detail_target_highlight needs a visible background to mark the
selected transcript cell. Color::Reset makes it invisible since it
defaults to the terminal background. Use palette::DEEPSEEK_INK instead
of the original hardcoded Rgb(18,29,39).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@merchloubna70-dot

Copy link
Copy Markdown
Author

Follow-up fix pushed: apply_detail_target_highlight was incorrectly changed to Color::Reset, making the cell-selection highlight invisible. Reverted to palette::DEEPSEEK_INK (the named constant rather than the raw Rgb literal).

kibuniverse pushed a commit to kibuniverse/DeepSeek-TUI that referenced this pull request May 5, 2026
kibuniverse pushed a commit to kibuniverse/DeepSeek-TUI that referenced this pull request May 5, 2026
…terminal_colors (Hmbown#671)

Neither field had any code path that read it. Shipping config knobs
that do nothing trains users to mistrust config. Remove until the
implementation exists.
MMMarcinho pushed a commit to MMMarcinho/DeepSeek-TUI that referenced this pull request May 6, 2026
MMMarcinho pushed a commit to MMMarcinho/DeepSeek-TUI that referenced this pull request May 6, 2026
…terminal_colors (Hmbown#671)

Neither field had any code path that read it. Shipping config knobs
that do nothing trains users to mistrust config. Remove until the
implementation exists.
@Hmbown Hmbown closed this May 6, 2026
@Hmbown Hmbown reopened this May 6, 2026
@Hmbown

Hmbown commented May 23, 2026

Copy link
Copy Markdown
Owner

This PR was opened before the v0.8.41 rebrand and is now stale. Feel free to rebase onto current main and reopen. 鲸鱼兄弟们等你 🐋

@Hmbown Hmbown closed this May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

终端颜色渲染有问题

3 participants