Getting 256 colors from Cygwin within cmder/ConEmu

0

1

I am trying to get 256 colors under Cygwin while running cmder. Generally, what I am doing is opening a terminal session in Windows 10 by typing "cmd" into Start. If I need to open a Cygwin terminal, I generally enter "bash" into that cmder instance.

When I run tput colors from within either the cmder prompt or the Cygwin terminal running within cmder, the system returns 8.

I have reviewed the following similar threads and references: ConEmu + ls -- 256 colors not working https://conemu.github.io/en/CygwinMsysConnector.html

(some links omitted due to low reputation limitations, see comments, but I am familiar with how Cygwin processes ANSI internally before passing it, parsed, to a ConEmu terminal)

I have downloaded the cygwin/msys connector and, indeed, tput colors returns 256 when I run the connector. What I would like to do is find a way to integrate this connector more directly into my workflow. I have environment variables that tie Cygwin more directly into my Windows terminal environment within cmder and sometimes run Cygwin commands from outside of a bash prompt, e.g. running vim on some file from a windows prompt, so simply running the connector every time I'd like access to the Cygwin bash isn't quite a complete solution for me. I'd like to know how to "wire up" this connector more directly so that it's running automatically, in the background, in lieu of running bash directly. I don't know if that makes any sense at all.

What I'm looking for is what environment variables, tasks, etc I need to set specifically to make this linkage happen more seamlessly.

edit: I realized it may be important to point out that I have cygwin's path put into my system environment variables.

Bradley Evans

Posted 2016-07-12T18:09:29.003

Reputation: 304

Output from cat AnsiColors256.ans: http://i.stack.imgur.com/Hc2Hf.png ... Here's what some of my cmder settings look like. Hopefully it's useful information: ... cmder Tasks: http://imgur.com/bkSyLQG ... cmder Environment Variables: http://imgur.com/bkSyLQG ... Cygwin.bat: http://imgur.com/2GAVzse ... Apologies for the clumsy comment edit, formatting limitations.

– Bradley Evans – 2016-07-12T18:09:39.410

Why do you crop screenshots? Neither title nor status bars are visible. – Maximus – 2016-07-12T19:14:04.407

Privacy, largely. Was there specific information you would find helpful that I might provide? I hadn't realized the content of the title / statusbars was relevant. Looking back more closely, what you may be looking for is my ConEmu version, which is ConEmu 160710 [32] {Stable}. – Bradley Evans – 2016-07-12T20:54:42.500

Generally I'm interested in status bar: modes, sizes, visible rect, etc. – Maximus – 2016-07-13T01:09:21.980

check TERM value. with TERM=xterm-16color I have on mintty $ tput colors 16 – matzeri – 2016-07-13T09:20:30.867

@matzeri In which dotfile? That was always unclear to me from guides I was reading. – Bradley Evans – 2016-07-13T09:23:17.770

@Maximus I'll be sure to get you better screenshots in the morning. – Bradley Evans – 2016-07-13T09:23:43.380

Use echo $TERM, TERM is usually defined by the terminal program before starting the bash. – matzeri – 2016-07-13T09:28:44.727

@matzeri echo $TERM returns cygwin – Bradley Evans – 2016-07-13T09:30:26.180

Terminal after running commands suggested by matzeri, @Maximus the statusbar is included in this screenshot. http://imgur.com/ud0ELuY

edit: I also totally get that this is a Cygwin issue and not a ConEmu issue, just trying to figure out how to implement the msys connector in my workflow.

– Bradley Evans – 2016-07-13T17:39:33.037

Sorry, but your screenshot does not show "Terminal modes". What is there? "W"? – Maximus – 2016-07-13T21:22:29.927

Answers

1

To couple cygwin with ConEmu. Tested on ConEmu 160714 with terminals.v0.7.4.7z

https://github.com/Maximus5/cygwin-connector/releases

Extract conemu-cyg-64.exe from terminals.v0.7.4.7z and copied on C:\cygwin64\bin

Modify the Predefined task on Settings->Startup->Tasks from

set CHERE_INVOKING=1 & C:\CygWin64\bin\bash.exe --login -i -new_console:C:"C:\CygWin\Cygwin.ico"

to

set CHERE_INVOKING=1 & C:\cygwin64\bin\conemu-cyg-64.exe  /usr/bin/bash.exe --login -i -new_console:C:"C:\cygwin64\Cygwin.ico"

Set the Settings-> Features -> Colors -> Scheme to xterm

The 256colors are not fantastic, they look more only 16, but I guess is due to the mismatch between the connector and ConEmu

enter image description here

matzeri

Posted 2016-07-12T18:09:29.003

Reputation: 1 662