无法在ConEmu中启用256色 [英] Can't enable 256 colors in ConEmu

查看:219
本文介绍了无法在ConEmu中启用256色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在出色的 ConEmu-Maximus5 控制台中获得256种颜色

I'm trying to get 256 colors in the fantastic ConEmu-Maximus5 console.

更新:现在它仅显示8种颜色.我知道,因为"$ tput颜色"输出为"8"

Update: Now it only shows 8 colors. I know because '$tput colors' output is '8'

我遵循了

  • TrueMod(24位颜色)支持
  • 注入ConEmuHk
  • ANSI x3.64/xterm 256色
  • 我不知道如何处理'检查缓冲区/幻灯片是否存在.'

    • 我在Windows 7中.
    • 我使用自定义直接链接启动ConEmu,因此它会加载cygwin bash文件.
    
    "C:\Program Files\ConEmu\ConEmu64.exe" /cmd ""C:\cygwin\bin\bash.exe" --login -i"
    

    • 在我的bashrc个人资料中->导出TERM = cygwin
    • 这是我的自定义命令提示符:
    • 
          function prompt {
      
          local RED="\[\033[0;31m\]"
          local GREEN="\[\033[0;32m\]"
          local COOLRED="\e[38;5;173m"
          local COOLGREEN="\e[38;5;113m"
          PS1="$COOLRED\u@\h $LIGHT_COOLGREEN\$PWD \[\e[0m\] > "
      
          }
      
          prompt
      

      • 顺便说一下,ConEmuANSI的值为ON.
      • 我有一些屏幕截图:

        如您所见,命令提示符看起来非常奢侈,因为它不喜欢256色设置.如果我将变量COOLRED和COOLGREEN替换为RED和GREEN,则看起来还可以,但不是256色.

        As you can see the command prompt looks very extravagant because it doesn't like the 256 color settings. If i substitute the variables COOLRED and COOLGREEN with RED and GREEN, then it looks ok, but it's not 256 colors.

        更多设置截图:

        最后一个镜头是Cygwin的薄荷味.那里一切都很好.支持全256色.可惜的是薄荷没有标签.这主要是我要迁移到ConEmu的原因.

        And the last sceen shot it's cygwin's mintty. Everything is ok there. Full 256 color supported. It's a shame mintty doesn't have tabs. That's mostly the reason why I'm trying to move to ConEmu.

        非常感谢您的帮助!!!

        Thank you very much for helping!!!

        推荐答案

        Bash不会将ANSI序列发送到控制台.它试图自己处理它们.而且,由于* nix终端通常只有8色(不考虑256色模式),因此bash使用8色调色板而不是Windows终端常见的16色调色板.

        Bash does not send ANSI sequences to console. It tries to process them itself. And, because *nix terminal is generally only 8-color (not taking into account 256-color mode), bash uses 8-color palette instead of 16-color palette which is common to Windows terminal.

        我认为256色具有薄荷味,因为_isatty在该终端中返回零.但是它在ConEmu下返回非零值.可能在将来的版本中,我解决了这个难题(如何为某些应用程序创建具有PTY功能的真实终端).

        I think, 256-colors works in mintty because _isatty returns zero in that terminal. But it returns non zero value under ConEmu. May be in future builds I solve this puzzle (how to create real terminal with PTY features for some applications).

        关于这个问题

        实际上,您不需要256色.要重新定义提示调色板,您可以使用使用背景扩展前景色"功能.在breaf中-在ConEmu中设置颜色16、17等,在bash中将提示背景设置为#5(在ConEmu中可配置),然后瞧.

        You have no need in 256-colors In fact. To redefine prompt palette you may use "Extend foreground colors with background" feature. In breaf - set up colors 16, 17, etc. in ConEmu, set prompt background in bash to #5 (configurable in ConEmu), and voila.

        ConEmu扩展..."处理中存在一个小错误.使用内部版本121016或更高版本.

        There was a small bug in ConEmu "Extend..." processing. Use build 121016 or later.

        PS1="\e[30;45m\u@\h \e[34;45m$PWD \[\e[0m\] > "
        

        以下信息与问题不符,但可能有用

        当前版本在整个"控制台缓冲区中不支持256色模式(限制,是的,请在计划中删除它).

        Current version does not support 256-color mode in 'whole' console buffer (limitation, yes, removing it in plans).

        所以,您可以选择2种方式

        So, you can go 2 ways

        • 完全禁用回滚缓冲区(许多方式,例如"cmd -cur_console:h0")
        • 在滚动缓冲区的底部工作.

        这篇关于无法在ConEmu中启用256色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆