How to use Mintty with Cygwin (by default)

Since I discovered Git, I was bothered by the really (REALLY!) stupid bash window. Why is it stupid? Try to paste something in that window! You have to click on the title bar, edit, paste. So I searched for an alternative. I found Console 2 and Mintty. Right now I’ll show you how to use Mintty by default, instead of that ugly and user not-so friendly default bash shell.

Requirements

First of all, you will need… Cygwin. You need to install chere package as well. After that, open a bash prompt and type: chere -i.
Second, you need to download Mintty and extract mintty.exe into cygwin/bin directory.
Third (and last) step is to open regedit (press win+r key then type regedit), go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cygwin_bash\command, edit default key and replace its content with:

C:\cygwin\bin\mintty.exe -e c:\cygwin\bin\bash -c "/bin/xhere /bin/bash.exe '%L'"

Please change cygwin path according to your instalation.

You are done! Just right click on a folder and click on Bash prompt here. A nice mintty console will open. Enjoy!

17 Comentarii to “How to use Mintty with Cygwin (by default)”

  1. Deci să moară gaia dacă te înțeleg.

    Dacă ai un sistem cu Windows la ce te chinui atâta să emulezi un mediu CLI de linux?

    Nu mai bine instalezi rapid un Linux într-o mașină virtuală și îi dai acces la o partiție NTFS sau un folder acolo?

    Sau îți rulezi propriul server de linux pe un calculator separat și îți dai acces prin Samba respectiv ssh/putty de pe mașina cu Windows?
    Iar dacă nu vrei un ditamai serverul cred că poți încerca un device micuț, cu procesor ARM?

  2. Staicu Ionuț-Bogdan

    Să moară gaia dacă înțeleg eu de ce comentezi în română la un post în engleză… Dar hai să-ți răspund.

    Cygwin îl am instalat pentru că este necesar pentru editorul folosit de mine (e-text). Dacă tot am cygwin instalat, de ce să nu-l folosesc? :)

  3. Hi, thanks for writing about mintty. You can install it through Cygwin’s setup.exe actually, where it appears in the ‘Shells’ category. This will also create a mintty shortcut in the Cygwin folder in the start menu. Also, chere actually has support for mintty built in: just do ‘chere -i -t mintty’, so no need to edit the registry.

  4. Staicu Ionuț-Bogdan

    Hey Andy, thanks for comment.

    I tried to install Mintty via cygwin few weeks ago and all I got was three shortcuts on desktop and one tray application. None of them seemed to be mintty tho! :D

    I didn’t knew about extra chere config. Thanks!

  5. The shortcut should have been at “Start Menu/Programs/Cygwin”. Were you installing as an administrator or limited user? There’d been an issue with the install script that caused the shortcut not to be created for limited users under certain circumstances. Should be fine now though.

  6. Staicu Ionuț-Bogdan

    Well… I’ll see in a month or so, when I will reinstall Windows :)

  7. Additionally, you could right click on the title, choose properties and check the QuickEdit mode. Then when you close that down, you can have it apply that to any command window ever opened.

  8. Thanks, this is cool!

    By the way, you can paste into the bash git window, or any cmd window for that matter, by right clicking. This feature only works if you first access the properties menu -> Options -> Edit Options and toggle the Insert Mode checkbox. If you also check the Quick Edit Mode checkbox you can highlight text with your mouse and right click to copy. And then right click again to paste.

  9. I should also point out that the default behavior for mintty is to show a popup menu when right clicking. If you middle click instead the contents of the clipboard will be pasted into the terminal.

  10. Thanks, that’s awesome!

    I use the shift-rclick in directory and then open command prompt here. So I also needed to change this key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\cmd\command

    to this:
    C:\cygwin\bin\mintty.exe -e c:\cygwin\bin\bash -c “/bin/xhere /bin/bash.exe”

  11. I got a better solution, just run this command:

    chere -il -t mintty -s bash

  12. Just want to drop a thank you, I got some pointers on how to and where to locate mitty.

    Hector

  13. This app rulz.
    Why emulate *NIX environment on WINDOZE:
    – Command Prompt Sucks (never got its way of doing autocomplete)
    – Does a good team with e Text Editor / VIM / Keyboard
    – Not waiting billions of years for a VM to start/close
    – Because I use Windows(have to) at work
    – Because in some areas, I am more familiar with Linux than Windows and the CLI interface eases the pain
    – Because I can run/test/port software to windows
    – Simply because it can be done

  14. Thanks :]
    I’m working on Win7 the current directory argument seems different.
    C:\cygwin\bin\mintty.exe -e c:\cygwin\bin\bash -c “/bin/xhere /bin/bash.exe ‘%V'”

  15. i don’t change registry,just use”chere -i -t mintty -s bash -e chere-mintty”,it works perfect!
    thank you telling me the chere

  16. Using the latest x64 version of setup, rxvt (which is what I’m used to), is missing. So I’m using mintty. Now I notice that I can’t find chere either. Anyone know what is up with that?

    Thanks

Show trackbacks

Leave a comment!

You can insert code snippets using BBcode:
[js].[/js] [html].[/html] [php].[/php] [css].[/css]
You can also use some HTML tags:
<blockquote>.</blockquote> <code>.</code> <a href="">.</a> <strong>.</strong> <em>.</em>