You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让Windows Terminal中不同控制台的配色方案保持一致

How to Ensure Consistent Color Schemes Across Different Consoles in Windows Terminal

The issue you're seeing happens because while Windows Terminal's global color scheme sets the base palette for the terminal window, each shell (like PowerShell Core and Yori) has its own internal configuration for syntax highlighting and file/folder coloring. These shell-specific settings can override or map to different colors in your Terminal scheme, causing inconsistencies. Here's how to fix it:

1. Align Yori's Folder/File Coloring with Your Terminal Scheme

Yori maintains its own color rules separate from Windows Terminal. To make it match PowerShell Core:

  • Open Yori and run the command yori-config to launch its settings window.
  • Navigate to the Colors section. Look for the setting labeled "Directory" (or similar for folders) and set its color to match the white you see in PowerShell Core. Use the hex value from your DraculaPlusCustom scheme: #F8F8F2 (the white entry).
  • Alternatively, edit Yori's config file directly (usually located at %APPDATA%\Yori\yori.ini). Find the [Colors] section and update the Dir line to:
    Dir=0xF8F8F2
    
    Save the file and restart Yori for changes to take effect.

2. Verify PowerShell Core's Color Configuration

PowerShell Core (especially if you use modules like posh-git) might have custom color settings for folders. Check your PowerShell profile to ensure it's using the same color as your Terminal scheme:

  • Open your PowerShell profile by running notepad $PROFILE.
  • If you're using posh-git, look for lines that set directory colors. Adjust them to use the white from your scheme. For example:
    # Ensure folder text uses the "white" from your Terminal scheme
    $GitPromptSettings.DirectoryForegroundColor = [ConsoleColor]::White
    
  • Save the profile and restart PowerShell Core.

3. Match ANSI Color Code Mapping (Advanced)

Both shells use ANSI color codes to apply highlighting. Make sure they're using the same ANSI code for folders so Windows Terminal maps them to the same color in your scheme:

  • PowerShell Core typically uses \e[37m for white (which maps to your scheme's white entry). Confirm Yori is configured to use the same code for folders in its color settings.

Final Check

After adjusting these settings, restart Windows Terminal entirely, then open both Yori and PowerShell Core tabs. Run dir (Yori) or ls (PowerShell Core) and verify that folder colors now match.

内容的提问来源于stack exchange,提问作者Bhavesh Jadav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 07:28:14