SEARCH

How-To Geek

How To Improve Your Cygwin Console With Mintty

banner

Cygwin’s great for getting some Linux command-line goodness in Windows, but using the Windows Shell to access it kills some of that magic. Using Mintty and a few other methods, you can make the experience much more luxurious.

Windows Shell Limitations

We’ve already shown you how to install and use Cygwin so you can use Windows and not have to miss out on that command-line goodness. For a lot of people, however, the excitement of running bash in Windows is severely hampered by the fact that Cygwin uses the Command Prompt shell to get things done. Here are some of the more common problems and complaints with this setup:

  • Resizing the window horizontally doesn’t work properly
  • Can’t efficiently change font faces or sizes on-the-fly.
  • Scrolling via the keyboard doesn’t work.
  • Selecting text over multiple lines doesn’t work.
  • With some configurations, selecting text at all doesn’t work.
  • It’s all sorts of ugly compared to what Linux terminals provide.

A useful tool that’s a chore to utilize doesn’t really take me very far. How about you?

Mintty Saves the Day

Mintty is a great alternative shell for Cygwin that provides a host of useful features and alleviates the above problems. If you use MSYS/MinGW instead of Cygwin, Mintty works beautifully with that, too.

You can install Mintty by grabbing it from the project’s download page (make sure you get the proper version for your setup!), or you can just run Cygwin’s Setup.exe file again.

sshot-1

At the Select Packages screen, look under “Shells” and find Mintty. Click where it says “Skip” and hit the Next button. Once you’ve finished installing it, you should be able to go to Start > All Programs > Cygwin > mintty to launch it.

sshot-2

Here’s what the default Mintty window looks like:

sshot-3

It’s a little vanilla, but you’ll notice the resizing works properly and the font is at least a little better. You can hit Ctrl and + or – to make the font bigger or smaller at any point in time. Right-click the Title Bar and choose Options…

sshot-4

First thing I did was change the window transparency and the cursor in the Looks tab to something I’m more familiar with. Head over to the Text tab when you’re done that.

sshot-5

You can change the default font, of course, but also the Locale and Character Set to something different from what Windows is using right now. You can also play with font smoothing if your monitor shows it a little too jaggedly.

sshot-6

Under the Mouse options, you’ll be able to change your mouse interaction settings, such as copying and pasting. You can also easily make the mouse place the command-line cursor, something that vim users often seem to like. Lastly, click on Window.

sshot-7

Here, you can change the default terminal size, the scrollback buffer size, and choose a modifier for scrolling with the arrow keys. By default, Shift+Up/Down will scroll through the buffer in the window. Now here’s what my modified Mintty configuration looks like.

sshot-8

(Click on the above image to see a larger version.)

Other Methods (for PuTTY-Lovers)

Mintty is great, but others may not like it so much. We showed you how to install an SSH server on Cygwin, and many people use PuTTY or KiTTY to connect to Cygwin that way. However, if you don’t want to set up SSH access, there’s an easier way.

PuTTYcyg is a patched version of PuTTY that is able to connect to native Cygwin installations. There’s only one hitch: PuTTY was recently updated to version 0.61, adding support for Windows 7’s jump lists, Aero-resizing, and non-fixed-width fonts. PuTTYcyg hasn’t been updated yet, so you’ll have to choose between Cygwin support and Windows 7-compatibility. I haven’t been able to find the patch itself, so I haven’t tried adding support to the latest version of PuTTY. If you have, please leave a line in the comments.

Personally, I prefer KiTTY over PuTTY because of it’s more customizable and was updated more often over the past 4-years. There’s a KiTTY-compatible PuTTYcfg patch which adds this functionality for others like me. To be honest, though, since I started using Mintty with Cygwin I haven’t touched KiTTY in weeks.

Lastly, if you’re looking for something that supports Cygwin as well as the Windows Command Prompt, you might be interested in Console. It’s a console replacement that allows tabbing of multiple types of shells as well as adding transparency and on-the-fly font changes.


Do you have a preferred Cygwin shell? Do you have an alternative to Cygwin? Know of a patch that works with PuTTY 0.61? Let us know below!

 

Yatri Trivedi is a monk-like geek. When he's not overdosing on meditation and geek news of all kinds, he's hacking and tweaking something, often while mumbling in 4 or 5 other languages.

  • Published 07/21/11

Comments (9)

  1. Tom C.

    Ever tried http://www.andlinux.org/ ???
    At this time no 64bit support, but a(nother) great way to run native linux commands and programs …

  2. spaceyjase

    Cygwin users can run a terminal via the X server which removes most of the Windows console limitations.

  3. Jason Wu

    Is that an ATI graphics card I see? Nvidia FTW!

  4. walter butrymowicz

    mintty is kinna nice — but I haven’t discovered yet how to redirect a console back to the mintty session. I know that I would interact with xserver on the remote machine — is there a mechanism in mintty that would allow this functionality ?

    a simple example — desktop open mintty — ssh to remote server — run xclock … fails because display not found. I tried setting DISPLAY in the unix fashion but ng.

    I’m happy with xterm and ssh — just trying to get this to work.

    Thanks !
    Walt

  5. Andy

    @Walt Assuming you’ve got an X server running on Windows and it’s at ‘:0′, setting DISPLAY to ‘:0′ before sshing to the remote server with X forwarding enabled should do the trick.

  6. Jonathan

    Thank you so much! Much better with mintty!! So easy to install, I’m already addicted.

  7. Marcus Pope

    I still prefer the standard console with a path reference to unxutils http://sourceforge.net/projects/unxutils/

    But I could also live with or without all of the features described as lacking in the windows cmd console.

  8. Arun

    Nice article

  9. Jean-Michel

    I like both MinTTY and PuTTY Tray (another enhanced alternative to PuTTY).
    But KiTTY seems very nice too. I give it a try…

Enter Your Email Here to Get Access for Free:

Go check your email!