Can't enable 256 colors in ConEmu

前端 未结 4 1634
清歌不尽
清歌不尽 2021-01-30 23:21

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

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

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 23:42

    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.

    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).

    As for the question

    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.

    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\] > "
    

    ConEmu and real console window

    ConEmu settings

    Following info does not match the question, but may be useful

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

    So, you can go 2 ways

    • totally disable scrollback buffer (many ways, for example "cmd -cur_console:h0")
    • work in the bottom of the scroll-buffer.

提交回复
热议问题