24

I want to start using Cygwin, but I am not pleased with the font color and would like to change it to light green with a black background.

(I tried googling to no avail BTW)

1
  • 1
    congratulations on being the first search result Sep 23, 2017 at 11:48

10 Answers 10

29

It is basically just a DOS window. So click on the icon in the upper left of the shell window to get the menu. Go to properties. You can then change the colors, font, command history, and edit options (you will want to turn on Quick Edit and Insert modes).

4
  • Thanks, that was far easier than the accepted solution. May 27, 2014 at 7:28
  • thanks. its "options..." on mine, and in there is where you can change the Text Jul 4, 2014 at 15:42
  • 2
    Btw, cannot change individual colors with this method. Like if the blue is so dark you cannot see on the black background. You can change the background color but then the light colors are hard to see.
    – swdev
    Dec 11, 2015 at 19:05
  • this is a valid solution, but not a proper solution. if you use the cygwin terminal, it only gives you the options to change the fg, bg, and cursor colors. if you open cygwin via dos, you have more precision, but has odd side effects. the real killer is the dark blue fonts on a black bg. any darker colors are a pain to read for anyone.
    – user3159377
    Jul 16, 2016 at 18:44
12

I find the standard shell to be pretty horrible myself.

I download and install the rxvt package and change the cygwin.bat to launch rxvt which has nicer support of copy-cut-n-paste.

@echo off
c:
chdir c:\data\cygwin\bin
set EDITOR=vi
set VISUAL=vi
set CYGWIN=codepage:ansi
rxvt -fn '*-courier-*-r-*-16-*' -sl  9999 -bg Black -fg Cyan -e /bin/bash -login

The -e and -login switch the launch shell to the rxvt one and the rest: -fn sets a courier size 16 font (sue me) -sl scroll lines of 9999 Black background and Cyan foreground selecting text will fill the paste buffer automatically the last bit (-e /bin/bash -login) launches bash and tells it that its a login shell which runs the profile setups and such.

1
9

If you want a better terminal to use with cygwin than the Windows Command Line window you could start xterm from within cygwin, or look at using puttycyg, which is a patched version of the windows ssh client putty designed to work with a local cygwin installation (in addition to the normal ssh functionality). puttycyg should provide you with much better control of your terminal than the Windows Command Line window.

4
  • 1
    I just switched to puttycyg from rxvt and love it. +1 from me as well.
    – Buggabill
    Oct 8, 2010 at 17:16
  • I used Cygwin trough sshd server to make it work with Putty for 2 years... Now you can't even imagine, how grateful I am. Jul 10, 2012 at 17:57
  • I keep getting errors with puttycyg not being able to find cygwin1.dll Oct 11, 2013 at 1:11
  • FYI, xterm isnt installed by default with Cygwin Mar 11, 2015 at 17:12
9

While others suggest to use a different terminal, the default Cygwin terminal emulator (mintty) lets you change the colors itself. You can change the foreground, background and cursor colors via the options dialog. You can find the options dialog by clicking on the context menu (the icon in the upper left of the window).

The remaining ANSI colors can only be changed from the config file (~/.minttyrc). Unfortunately the reference for this file does not contain an example, so a bit of guesswork is needed. You can find my example over on github. I only increased the brightness for blue. There is also a repo which contains the light and dark themes of solarized. You use these for inspiration.

On a side-note, in my case it seemed that changing the definition of Blue did not change a thing, but changing BoldBlue changed both the bold and default variant. It took me a while to figure this out... I kept changing Blue and because nothing was happening, I got side-tracked by other details (f.ex.: Term=xterm-256color & co)... Maybe the docs I read are are not for the same Cygwin version I am running. You should keep this in mind when fiddling around with your theme.

After editing the file, close and re-open the Cygwin terminal and the new colors should show up.

Oh... and for your original request (green on black), the only thing you need is:

ForegroundColour=0, 255, 0
BackgroundColour=0, 0, 0

But you should consider keeping the default foreground colour to white (or light gray) unless you change all the other colour codes as well! Some application print colorised output, and you will not see "green", because everything else is green too :) However, the default color for green in Cygwin is rgb:0,191,0, so if you use something else (like the mentioned rgb:0,255,0) you will at least see a difference in brightness.

2
  • 1
    +1, This works and answers the OP question. The "blue" is the big issue and this fixes it. Only issue I see if if you use the "Options" dialog and make any other things like the background color, etc. it wipes out your custom color changes. (overwrites the .minttyrc file).
    – swdev
    Dec 11, 2015 at 19:01
  • @swdev good to know. I did not know this. I wonder if it would make sense to mark the file as read only to prevent mishaps. But then you'd obviously can't make changes in the options dialog anymore.
    – exhuma
    Dec 11, 2015 at 19:55
4

I'd recommend using Console2. This gives you a tabbed interface where you can have both Cygwin tabs and Windows Command prompt tabs. There's lots of customisation options, and much better cut and paste support.

3

The cygwin icon is actually just a MS-DOS batch file (if you right-click on it, you can edit it and see that it just launches bash from the cygwin\bin directory). If you right-click and go to Properties, there's a Colors tab where you can change the background and font colors. If you modify the main shortcut properties, it should launch with those every time.

3

I use Cygwin's rxvt and an .Xdefaults file to tweak

My cygwin.bat:

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off

start /B \cygwin\bin\rxvt.exe -geometry 80x40+325+195 -fn "Andale Mono-13" -sl 2500 -e /bin/bash -i
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::


My Cygwin .Xdefaults:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! See rxvt --help for items available

! Black
Rxvt*background: #000000
Rxvt*cutchars: `"'()*,;<>[]{|}@
!!!Rxvt*cursorColor: #00ff00
Rxvt*cursorColor: White
Rxvt*foreground: Wheat
Rxvt*saveLines: 2048
Rxvt*scrollColor: Grey26
Rxvt*scrollBar_right: on
Rxvt*termName: xterm
Rxvt*visualBell: on
! Black
Rxvt*color0: #000000
! Red
Rxvt*color1: Red2
! Green
Rxvt*color2: Green1
! Yellow (brown)
Rxvt*color3: Khaki1
! Blue
Rxvt*color4: DodgerBlue1
! Magenta
Rxvt*color5: DarkOrchid1
! Cyan
Rxvt*color6: Cyan2
! This does not refer to foreground color!
! White
Rxvt*color7: #fdfdfd
! Gray
Rxvt*color8: #666666
! Bright red
!!!Rxvt*color9: #ee0000
Rxvt*color9: OrangeRed
! Bright green
Rxvt*color10: SpringGreen1
! Yellow
Rxvt*color11: Yellow
! Bright blue
Rxvt*color12: DodgerBlue3
! Bright magenta
Rxvt*color13: #ff00ff
! Bright cyan
Rxvt*color14: #00ffff
! This does not refer to foreground color!
! Bright white
Rxvt*color15: #ffffff

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1
  • FYI, rxvt not installed by default in Cygwin. I found this out when I wanted to try out the batch file above. Mar 11, 2015 at 17:16
3

rxvt is great but I was also interested in changing the colors for cygwin's bash shell. To change these colors I edited cygwin\etc\DIR_COLORS and change the lines

# Attribute codes: 
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
EXEC      00;33 
NORMAL    00;37 # global default, although everything should be something.
FILE      00;37 # normal file
DIR       00;32     # directory

and re-sourced my .bashrc which had

eval `dircolors -b /etc/DIR_COLORS`

see http://cygwin.com/ml/cygwin/2001-05/msg00938.html also the prompt color is in /etc/profile for example setting the prompt to yellow in my login .bashrc to override the /etc/profile, I can add the line

PS1=('\033[33m$ ')
2

Just for your information. Cygwin is not a terminal (or console) application. It's similar to answer that you're using Windows to question in what browser do you surf the web. You can open website on Windows using various browsers, e.g. Chrome, Opera, Firefox or MSIE. Analogously you can open Cygwin's shell in various terminals. Terminal is an application, which manages input from and output to a user - renders text output from Cygwin's shell and sends user's input (keyboard and mouse) back to it. Therefore font and color settings depend on terminal you use.

There are a lot of various terminal applications for Windows. To name some of them:

  • ConEmu - I would definitely recommend this one, you can configure it in many ways, it has tabs etc.

  • Console2 - similar to the previous with less options

  • MinTTY - this one is installed with Cygwin by default, but it's very basic. You should find it in Start menu under the name "Cygwin Terminal".

  • Windows Console - you can also use plain Windows Console: execute cmd.exe, navigate to Cygwin's root directory and execute bin/bash.exe --login -i or Cygwin.bat

0

CygWin method for interpreting colors (whether be it the shell, printouts, prompt... etc) should be the same as any other Linux, but the problem here comes from the Windows shell, that has not much capabilities for that.

Well, I don't know if this could be of help, but for me this is the best solution since I love Putty as terminal:

  • Install OpenSSH (SSHD) package from inside CygWin:

    apt-cyg update apt-cyg install sshd ssh-host-config --> [Run as admin] net start sshd

  • Connect to your computer (localhost) with Putty:

    putty localhost

Now you should have a decent shell capable of interpreting colors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.