This is a post about how to configure Cygwin on Windows 10.

How to install new package?

There is no official way to install a new package. Just run the Cygwin setup tool one more time and select the package you want to install. It will not rewrite the package you have installed, only the new package will be insatlled.

If the package download speed is slow, you can choose a local mirror for Cygwin. In China, TUNA is good.


When I use ssh to connect to my server, I got an error message “Pseudo-terminal will not be allocated because stdin is not a terminal”

On Windows 10, there is a builtin ssh program under C:/Windows/System32/OpenSSH/ssh.exe. You are probably using this program. If that is the case, you have to install openssh yourself. Just run the Cygwin setup program one more time to install the additional package. Then this issue should disappear.


How do I set up the mintty terminal emulator type, i.e., TERM variable?

Right-click Cygwin window title and choose Options..., go to Terminal, and choose Type to be xterm-256color. That is all.

How to use an external color theme for mintty?

By default, mintty provides a few color themes. The color theme for mintty are just a list of settings for different colors. There are serveral places where you can find mintty themes. A non-exhaustive list is:

Save the color theme file under $CYGWIN_ROOT/usr/share/mintty/themes. Open mintty options (right click on Cygwin title bar), go to Looks pane and choose from the Theme pull-down menu a color theme you want to use.

Alternatively, create a .minttyrc file under your $HOME. Paste the content of color theme in this file and save it. The next time you open Cygwin, mintty will automatically use the configurations in .minttyrc.


How do I configure mintty to use the settings from a config file and what are the available options?

As I have said, create a .minttyrc under your $HOME, and put mintty settings in this file. To see all the options aviable, visist this page.