Skip to content

Conversation

@SANJAY23CB50
Copy link

Problem

When using --light-mode on terminals with light backgrounds, the output is difficult to read due to:

  1. Grey backgrounds on code blocks that don't contrast well with light terminals
  2. Dark backgrounds on error messages and panels
  3. Completion menu backgrounds that are hard to see
  4. No way to disable these backgrounds even with color customization

This makes aider unusable for users with light-themed terminals, as reported in issue #4519.

Solution

This PR implements a complete fix for light-mode background issues:

Changes Made:

  • Added --code-theme-no-background flag: New command-line option to disable background colors in code themes
  • Automatic background removal in light-mode: When --light-mode is enabled, backgrounds are automatically disabled
  • Custom Markdown renderer (aider/md_renderer.py): Handles code block rendering with optional background removal
  • Theme utilities (aider/theme_utils.py): Centralized theme management and background control
  • Clear menu backgrounds: Completion menu background colors are set to None in light mode
  • Updated color scheme: Light-mode now uses appropriate colors for light terminals

Technical Implementation:

  1. Modified aider/args.py to add the --code-theme-no-background argument
  2. Updated aider/main.py to automatically enable background removal in light-mode
  3. Enhanced aider/io.py to accept and pass the code_theme_no_background parameter
  4. Created CustomMarkdown class that extends Rich's Markdown with background control
  5. Updated aider/mdstream.py to use the new custom renderer

Testing:

  • Tested with --light-mode flag on light-themed terminals
  • Verified code blocks render

…ap config_writer() in try-except block - Add graceful error handling for permission issues - Prevents crash when using repositories on network drives - Fixes Aider-AI#4508
…me-no-background flag to disable backgrounds - Implement CustomMarkdown renderer with background control - Clear menu background colors in light mode - Add theme utilities for background removal - Update light-mode to work properly on light terminals - Fixes Aider-AI#4519
@CLAassistant
Copy link

CLAassistant commented Oct 10, 2025

CLA assistant check
All committers have signed the CLA.

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