Categories
Interior

How to improve your cygwin console with mintty

Comments

GoogleCodeExporter commented Jun 4, 2015

Original issue reported on code.google.com by sami.kyo. @gmail.com on 17 Feb 2009 at 3:07

The text was updated successfully, but these errors were encountered:

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 17 Feb 2009 at 5:47

GoogleCodeExporter commented Jun 4, 2015

Original comment by sami.kyo. @gmail.com on 19 Feb 2009 at 12:09

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 3 Mar 2009 at 2:24

GoogleCodeExporter commented Jun 4, 2015

Original comment by sschuberth on 28 Mar 2009 at 7:29

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 28 Mar 2009 at 7:44

GoogleCodeExporter commented Jun 4, 2015

Original comment by sschuberth on 8 Apr 2009 at 10:24

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 26 Apr 2009 at 12:28

GoogleCodeExporter commented Jun 4, 2015

Original comment by barry.do. @gmail.com on 1 May 2009 at 8:08

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 1 May 2009 at 7:11

GoogleCodeExporter commented Jun 4, 2015

Original comment by barry.do. @gmail.com on 7 May 2009 at 3:30

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 8 May 2009 at 4:47

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 16 May 2009 at 6:03

GoogleCodeExporter commented Jun 4, 2015

Original comment by medgar123 on 17 Sep 2009 at 2:27

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 19 Sep 2009 at 3:54

GoogleCodeExporter commented Jun 4, 2015

Original comment by om. @elowar.com on 4 Oct 2009 at 1:10

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 4 Oct 2009 at 5:26

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 3 Nov 2009 at 8:37

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 6 Nov 2009 at 7:18

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 13 Nov 2009 at 9:14

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 15 Nov 2009 at 8:19

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 12 Dec 2009 at 2:38

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 20 Jan 2010 at 7:26

GoogleCodeExporter commented Jun 4, 2015

Original comment by andy.koppe on 20 Jan 2010 at 7:47

GoogleCodeExporter commented Jun 4, 2015

Original comment by sher. @gmail.com on 8 Mar 2010 at 3:36

GoogleCodeExporter commented Jun 4, 2015

Original comment by sher. @gmail.com on 8 Mar 2010 at 3:41

GoogleCodeExporter commented Jun 4, 2015

chaosreload commented Sep 20, 2017

I found when I use windows-native redis-cli.exe, mintty hangs and crash totally, while other interactive programs just hang and you can use Ctrl + C to stop the program

be5invis commented Dec 22, 2018

Maybe you can take a look at ConPTY now. That’s the missing part of Windows’ console system recently filled.

Recently, Microsoft has made the first stable release of Windows Terminal, a new terminal program for Windows 10. Windows Terminal allows you to add and use multiple shells, like Windows PowerShell, the old command prompt, and any shell in your Windows Subsystem for Linux (WSL) environments. It also provides way more features and customization options than the old Windows console host conhost.exe , which has been used for command prompt and WSL.

This post will instruct you to add other shell executables to Windows Terminal, such as the shell you installed for Cygwin or Git Bash if you have Git for Windows. By doing this, you can access a Unix shell and potentially other Unix programs within Windows Terminal without the need for WSL.

The main purpose of this post is to show you how to use your Cygwin installation or Git Bash in Windows Terminal if you happen to have them installed. It is not intended to recommend Cygwin or Git Bash as WSL alternatives, though if you are interested, you may definitely try them.

The steps for Cygwin and Git Bash slightly differ, so I will first introduce the method for Cygwin, then mention what is different in the method for Git Bash.

Steps for Cygwin

For the following steps, it is assumed that you have Bash installed in Cygwin. It should be possible to use other shells, but your configuration file will look differently from what is shown here, so please pay attention to that.

Download Windows Terminal from Microsoft Store.

How to improve your cygwin console with mintty

Open Windows Terminal. You can find the button that opens the drop-down menu on the top, and the menu contains multiple profiles. We will create a new profile for Cygwin’s shell.

How to improve your cygwin console with mintty

In the drop-down menu, choose “Settings”. This will open up the configuration file for Windows Terminal. If you scroll down a little bit, you will see the profiles key and the list array under it. This is where the new profile will be added to.

How to improve your cygwin console with mintty

The basic attributes for a profile are:

guid : A unique identifier for the profile

name : The profile’s name

commandline : The command to start the shell used for this profile

The unique identifier in guid can be any 128-bit UUID that does not repeat any existing one in the configuration file. Please notice that you cannot reuse the identifier for a deleted preset profile. For instance, even if you never use the Azure Cloud Shell and deleted its profile, you should not use that profile’s guid for any new profile.

After all, this should not be a problem because there are many ways to get a UUID:

  • Run the uuidgen program in Cygwin
  • Search for UUID generators online and use one of them
  • Simply use the UUID I generated for the demo, which is a1f2ceb2-795d-4f2a-81cc-723cceec49c0

How to improve your cygwin console with mintty

Now, you need to know the command line used to start Cygwin’s shell.

First, find your Cygwin installation path. By default, it is C:\cygwin64 for the 64-bit version. The bash.exe executable in a Cygwin installation should be placed in the bin folder under Cygwin’s installation path. Therefore, the absolute path to the executable file is C:\cygwin64\bin\bash.exe by default.

For Bash in Cygwin, you need to start bash as an interactive login shell; otherwise, you will encounter the “command not found” error when executing basic commands like ls . This is because the file /etc/profile , which adds Cygwin’s /usr/bin and /usr/local/bin directories to the PATH environment variable, is not executed for non-login shells. An interactive login shell can be started with -i -l flags. If you are using another shell, please confirm the way to get Cygwin’s /usr/bin and /usr/local/bin into PATH for your shell.

Therefore, the full command to run Bash in Cygwin is C:\cygwin64\bin\bash.exe -i -l . If you have installed Cygwin to a non-default path and/or want to use another shell, then please change the command accordingly.

Finally, the configuration file accepts the forward slash / as the path component separator, so you can replace every backslash \ in the command with / . For instance, the above command will be changed to C:/cygwin64/bin/bash.exe -i -l . If you want to use the backslash instead, you have to escape it by adding another backslash, causing the command to become C:\\cygwin64\\bin\\bash.exe -i -l .

At this point you have collected all information needed for the new profile, so it’s time to add it to the configuration file:

The order of the profiles in the configuration is the same as the order in which they are shown in Windows Terminal. Here, because I want it to be the first entry, I put it before every other profile. If you are not adding it as the last profile, then don’t forget the trailing comma; otherwise, make sure the trailing comma is not there, and add a comma after the profile that was originally the last one.

How to improve your cygwin console with mintty

Save the file. If your configuration file is valid, then you should now see the new profile added to the menu. When you choose it, you should see Bash running in a new terminal tab.

How to improve your cygwin console with mintty

How to improve your cygwin console with mintty

Steps for Git Bash

The steps to add Git Bash differ at only two places:

You cannot run uuidgen in Git Bash to obtain a unique identifier. However, you can still use any alternative method mentioned above to get one.

If you installed Git for Windows at C:\Program Files\Git , then the absolute path to the Git Bash executable is C:\Program Files\Git\bin\bash.exe .

How to improve your cygwin console with mintty

Removing “Process Exited With Code x” Messages

How to improve your cygwin console with mintty

If the last command you ran before quitting the shell using exit or Ctrl-D finished with a non-zero exit status, you might see something like what the screenshot shows. Sometimes this can even happen if you did not run any command, which is likely to be caused by a command in initialization scripts like .bashrc .

These messages must be dismissed manually. To stop Windows Terminal from generating them, add an “closeOnExit”: “always” option to the new profile in the configuration file. Don’t forget, if this option is the last line for the profile, you need to make sure a comma exists at the end of the previous line.

How to improve your cygwin console with mintty

Setting Default Windows Terminal Profile

There is a defaultProfile option in the configuration file, which allows you to choose the default shell when a new terminal window or tab is opened. The default profile should be specified by its guid .

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.

How to improve your cygwin console with mintty

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.

How to improve your cygwin console with mintty

Here’s what the default Mintty window looks like:

How to improve your cygwin console with mintty

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…

How to improve your cygwin console with mintty

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.

How to improve your cygwin console with mintty

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.

How to improve your cygwin console with mintty

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.

How to improve your cygwin console with mintty

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.

How to improve your cygwin console with mintty

(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!

Recently, Microsoft has made the first stable release of Windows Terminal, a new terminal program for Windows 10. Windows Terminal allows you to add and use multiple shells, like Windows PowerShell, the old command prompt, and any shell in your Windows Subsystem for Linux (WSL) environments. It also provides way more features and customization options than the old Windows console host conhost.exe , which has been used for command prompt and WSL.

This post will instruct you to add other shell executables to Windows Terminal, such as the shell you installed for Cygwin or Git Bash if you have Git for Windows. By doing this, you can access a Unix shell and potentially other Unix programs within Windows Terminal without the need for WSL.

The main purpose of this post is to show you how to use your Cygwin installation or Git Bash in Windows Terminal if you happen to have them installed. It is not intended to recommend Cygwin or Git Bash as WSL alternatives, though if you are interested, you may definitely try them.

The steps for Cygwin and Git Bash slightly differ, so I will first introduce the method for Cygwin, then mention what is different in the method for Git Bash.

Steps for Cygwin

For the following steps, it is assumed that you have Bash installed in Cygwin. It should be possible to use other shells, but your configuration file will look differently from what is shown here, so please pay attention to that.

Download Windows Terminal from Microsoft Store.

How to improve your cygwin console with mintty

Open Windows Terminal. You can find the button that opens the drop-down menu on the top, and the menu contains multiple profiles. We will create a new profile for Cygwin’s shell.

How to improve your cygwin console with mintty

In the drop-down menu, choose “Settings”. This will open up the configuration file for Windows Terminal. If you scroll down a little bit, you will see the profiles key and the list array under it. This is where the new profile will be added to.

How to improve your cygwin console with mintty

The basic attributes for a profile are:

guid : A unique identifier for the profile

name : The profile’s name

commandline : The command to start the shell used for this profile

The unique identifier in guid can be any 128-bit UUID that does not repeat any existing one in the configuration file. Please notice that you cannot reuse the identifier for a deleted preset profile. For instance, even if you never use the Azure Cloud Shell and deleted its profile, you should not use that profile’s guid for any new profile.

After all, this should not be a problem because there are many ways to get a UUID:

  • Run the uuidgen program in Cygwin
  • Search for UUID generators online and use one of them
  • Simply use the UUID I generated for the demo, which is a1f2ceb2-795d-4f2a-81cc-723cceec49c0

How to improve your cygwin console with mintty

Now, you need to know the command line used to start Cygwin’s shell.

First, find your Cygwin installation path. By default, it is C:\cygwin64 for the 64-bit version. The bash.exe executable in a Cygwin installation should be placed in the bin folder under Cygwin’s installation path. Therefore, the absolute path to the executable file is C:\cygwin64\bin\bash.exe by default.

For Bash in Cygwin, you need to start bash as an interactive login shell; otherwise, you will encounter the “command not found” error when executing basic commands like ls . This is because the file /etc/profile , which adds Cygwin’s /usr/bin and /usr/local/bin directories to the PATH environment variable, is not executed for non-login shells. An interactive login shell can be started with -i -l flags. If you are using another shell, please confirm the way to get Cygwin’s /usr/bin and /usr/local/bin into PATH for your shell.

Therefore, the full command to run Bash in Cygwin is C:\cygwin64\bin\bash.exe -i -l . If you have installed Cygwin to a non-default path and/or want to use another shell, then please change the command accordingly.

Finally, the configuration file accepts the forward slash / as the path component separator, so you can replace every backslash \ in the command with / . For instance, the above command will be changed to C:/cygwin64/bin/bash.exe -i -l . If you want to use the backslash instead, you have to escape it by adding another backslash, causing the command to become C:\\cygwin64\\bin\\bash.exe -i -l .

At this point you have collected all information needed for the new profile, so it’s time to add it to the configuration file:

The order of the profiles in the configuration is the same as the order in which they are shown in Windows Terminal. Here, because I want it to be the first entry, I put it before every other profile. If you are not adding it as the last profile, then don’t forget the trailing comma; otherwise, make sure the trailing comma is not there, and add a comma after the profile that was originally the last one.

How to improve your cygwin console with mintty

Save the file. If your configuration file is valid, then you should now see the new profile added to the menu. When you choose it, you should see Bash running in a new terminal tab.

How to improve your cygwin console with mintty

How to improve your cygwin console with mintty

Steps for Git Bash

The steps to add Git Bash differ at only two places:

You cannot run uuidgen in Git Bash to obtain a unique identifier. However, you can still use any alternative method mentioned above to get one.

If you installed Git for Windows at C:\Program Files\Git , then the absolute path to the Git Bash executable is C:\Program Files\Git\bin\bash.exe .

How to improve your cygwin console with mintty

Removing “Process Exited With Code x” Messages

How to improve your cygwin console with mintty

If the last command you ran before quitting the shell using exit or Ctrl-D finished with a non-zero exit status, you might see something like what the screenshot shows. Sometimes this can even happen if you did not run any command, which is likely to be caused by a command in initialization scripts like .bashrc .

These messages must be dismissed manually. To stop Windows Terminal from generating them, add an “closeOnExit”: “always” option to the new profile in the configuration file. Don’t forget, if this option is the last line for the profile, you need to make sure a comma exists at the end of the previous line.

How to improve your cygwin console with mintty

Setting Default Windows Terminal Profile

There is a defaultProfile option in the configuration file, which allows you to choose the default shell when a new terminal window or tab is opened. The default profile should be specified by its guid .

Comments

nojb commented Oct 3, 2018

Would it be possible to use the recently introduced ConPTY API (https://blogs.msdn.microsoft.com/commandline/2018/08/02/windows-command-line-introducing-the-windows-pseudo-console-conpty/) to improve the compatibility of mintty with native Windows programs (esp. interactive ones)?

The text was updated successfully, but these errors were encountered:

mintty commented Oct 3, 2018

It’s been announced for a while already but documentation is not yet available.
Anyway, this might be an enhancement for cygwin, but not for mintty, because that’s the platform level where this kind of interoperability issue can be handled.

nojb commented Oct 3, 2018

Thanks for the reply @mintty! I will ask in Cygwin’s mailing list about it.

Biswa96 commented Oct 3, 2018

@nojb If you do that please share the link of that mail.

nojb commented Oct 3, 2018

Biswa96 commented Oct 3, 2018

@nojb You mentioned about native Windows Applications. But its not the case. No native console app use that CONPTY. Windows Console team mimics the PTY connection like in *nix systems in a whole different way.

nojb commented Oct 3, 2018

Not sure I understand your objection, but if you look at the section ConHost – Investing in yesterday for tomorrow in the linked blog post, you will see it clearly states that this API can be used to make traditional, existing Console applications behave like typical Unix terminal applications (VT codes, etc.).

fcharlie commented Sep 3, 2019

An exciting news, cygwin currently supports conpty. see commit: bminor/[email protected]169d65a

mintty commented Sep 3, 2019

Yes, but note it’s still a test release. We’ll have to wait another few weeks until the official cygwin release.
And then I can close all the related issues here!

fpqc commented Sep 27, 2019

@mintty Does this mean you won’t need to use the bridge anymore?

mintty commented Sep 27, 2019

fpqc commented Sep 27, 2019

@mintty By the way, you might find this interesting:

In the newer builds of windows, you know how you can access the linux filesystem from:
\\wsl$\

well, if you set up your mintty shortcut for wsltty to start in:

How to improve your cygwin console with mintty

Cygwin eignet sich hervorragend, um eine gute Linux-Befehlszeilenqualität in Windows zu erhalten, aber die Verwendung der Windows-Shell für den Zugriff macht einige dieser magischen Kräfte zunichte. Mit Mintty und einigen anderen Methoden können Sie das Erlebnis noch luxuriöser gestalten.

Einschränkungen der Windows-Shell

Wir haben Ihnen bereits gezeigt, wie Sie Cygwin installieren und verwenden, damit Sie Windows verwenden können und nicht auf die Befehlszeilengüte verzichten müssen. Für viele Leute wird die Aufregung beim Ausführen von bash in Windows jedoch stark durch die Tatsache behindert, dass Cygwin die Eingabeaufforderungs-Shell verwendet, um Dinge zu erledigen. Hier sind einige der häufigsten Probleme und Beschwerden bei diesem Setup:

  • Die horizontale Größenänderung des Fensters funktioniert nicht richtig
  • Die Schriftflächen oder -größen können nicht schnell und effizient geändert werden.
  • Das Scrollen über die Tastatur funktioniert nicht.
  • Das Auswählen von Text über mehrere Zeilen funktioniert nicht.
  • Bei einigen Konfigurationen funktioniert das Auswählen von Text überhaupt nicht.
  • Im Vergleich zu den Linux-Terminals ist das alles hässlich.

Ein nützliches Werkzeug, das eine lästige Aufgabe ist, bringt mich nicht sehr weit. Wie ist es mit Ihnen?

Mintty rettet den Tag

Mintty ist eine großartige alternative Shell für Cygwin, die eine Vielzahl nützlicher Funktionen bietet und die oben genannten Probleme löst. Wenn Sie MSYS / MinGW anstelle von Cygwin verwenden, funktioniert Mintty auch hervorragend damit.

Sie können Mintty installieren, indem Sie es von der Download-Seite des Projekts herunterladen (stellen Sie sicher, dass Sie die richtige Version für Ihr Setup erhalten!) Oder Sie können die Datei Setup.exe von Cygwin einfach erneut ausführen.

How to improve your cygwin console with mintty

Suchen Sie im Bildschirm “Pakete auswählen” unter “Shells” nach Mintty. Klicken Sie auf die Stelle, an der “Überspringen” angezeigt wird, und klicken Sie auf die Schaltfläche Weiter. Wenn Sie die Installation abgeschlossen haben, können Sie Start> Alle Programme> Cygwin> mintty aufrufen, um die Installation zu starten.

How to improve your cygwin console with mintty

So sieht das Standard-Mintty-Fenster aus:

How to improve your cygwin console with mintty

Es ist ein wenig Vanille, aber Sie werden feststellen, dass die Größenänderung richtig funktioniert und die Schrift zumindest etwas besser ist. Sie können Strg und + oder – drücken, um die Schriftart zu einem beliebigen Zeitpunkt zu vergrößern oder zu verkleinern. Klicken Sie mit der rechten Maustaste auf die Titelleiste und wählen Sie Optionen. How to improve your cygwin console with mintty

Zuerst habe ich die Fenstertransparenz und den Cursor auf der Registerkarte “Looks” in etwas geändert, mit dem ich besser vertraut bin. Gehen Sie zum Tab “Text”, wenn Sie das getan haben.

How to improve your cygwin console with mintty

Sie können natürlich die Standardschriftart, aber auch das Gebietsschema und den Zeichensatz ändern, um etwas anderes als Windows zu verwenden. Sie können auch mit der Schriftglättung spielen, wenn Ihr Monitor dies etwas zu scharf zeigt.

How to improve your cygwin console with mintty

Unter den Mausoptionen können Sie die Mausinteraktionseinstellungen ändern, z. B. Kopieren und Einfügen. Sie können auch einfach den Mauszeiger auf den Befehlszeilencursor setzen, was Vim-Benutzer häufig zu mögen scheinen. Zuletzt klicken Sie auf Fenster.

How to improve your cygwin console with mintty

Hier können Sie die Standard-Terminalgröße und die Größe des Scrollback-Puffers ändern und einen Modifikator für das Scrollen mit den Pfeiltasten auswählen. Standardmäßig wird mit Shift + Up / Down durch den Puffer im Fenster geblättert. So sieht meine modifizierte Mintty-Konfiguration aus.

(Klicken Sie auf das obige Bild, um eine größere Version zu sehen.)

Andere Methoden (für PuTTY-Liebhaber)

Mintty ist großartig, aber andere mögen es nicht so sehr. Wir haben Ihnen gezeigt, wie Sie einen SSH-Server auf Cygwin installieren, und viele Leute verwenden PuTTY oder KiTTY, um sich auf diese Weise mit Cygwin zu verbinden. Wenn Sie jedoch keinen SSH-Zugriff einrichten möchten, gibt es einen einfacheren Weg.

PuTTYcyg ist eine gepatchte Version von PuTTY, die eine Verbindung zu nativen Cygwin-Installationen herstellen kann. Es gibt nur einen Haken: PuTTY wurde vor kurzem auf Version 0.61 aktualisiert und fügte Unterstützung für die Sprunglisten von Windows 7, Aero-Größenänderung und Schriftarten mit nicht fester Breite hinzu. PuTTYcyg wurde noch nicht aktualisiert. Sie müssen zwischen Cygwin-Unterstützung und Windows 7-Kompatibilität wählen. Ich konnte den Patch selbst nicht finden, also habe ich nicht versucht, der neuesten Version von PuTTY Unterstützung hinzuzufügen. Falls ja, hinterlassen Sie bitte eine Zeile in den Kommentaren.

Ich persönlich bevorzuge KiTTY gegenüber PuTTY, da es mehr anpassbar ist und in den letzten 4 Jahren häufiger aktualisiert wurde. Es gibt einen KiTTY-kompatiblen PuTTYcfg-Patch, der diese Funktionalität für andere wie mich hinzufügt. Um ehrlich zu sein, seit ich mit Mintty zusammen mit Cygwin angefangen habe, habe ich KiTTY seit Wochen nicht mehr angerührt.

Wenn Sie nach etwas suchen, das sowohl Cygwin als auch die Windows-Eingabeaufforderung unterstützt, sind Sie möglicherweise an Console interessiert. Es handelt sich um einen Konsolenersatz, mit dem Sie mehrere Arten von Shells mit Tabulatoren versehen können, um Transparenz und Schriftartenänderungen im laufenden Betrieb hinzuzufügen.

Hast du eine bevorzugte Cygwin-Hülle? Hast du eine Alternative zu Cygwin? Kennen Sie einen Patch, der mit PuTTY 0.61 funktioniert? Lass es uns unten wissen!

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 4 years ago .

I installed Cygwin, to be disappointed that bash by default runs within “cmd.exe”. I googled around and found Console2. It’s not a particularly well-designed application, as doing adjustments is slightly painful, although most of the time it works well.

I am still looking for a better way to survive in a Windows environment as even Console 2 occasionally crashes e.g. when trying to resize my terminal when editing in vim and there are plenty of other annoyances that I’m really not satisfied with.

Any ideas? I tried using Cygwin via PuTTY and that was an equally bad user experience.

How to improve your cygwin console with mintty

How to improve your cygwin console with mintty

10 Answers 10

It makes Cygwin entirely usable on Windows. I would be lost without it. Based on the original PuTTY code, but integrates straight into Cygwin (and in fact, is bundled with Cygwin).

Or where-ever you installed it. The ‘-‘ is key.

There are a few other useful additions for Cygwin as well, one being apt-cyg. It’s not perfect, but it’s better than running setup.exe every time you remember you’re missing a package.

Even with Cygwin/X, I still use MinTTY as my primary terminal (I hate the scroll bars on xterm).

How to improve your cygwin console with mintty

Reviving an old thread; however, I stumbled across this while doing my own search. So rather than make a new thread – Here’s what I found:

The core of Babun consists of a pre-configured Cygwin. Cygwin is a great tool, but there’s a lot of quirks and tricks that makes you lose a lot of time to make it actually ‘usable’. Not only does babun solve most of these problems, but also contains a lot of vital packages, so that you can be productive from the very first minute.

It installs quickly and sets up the environment for you, which is great, and installs pact (a package manager similar to yum / apt-get)

Uses mintty as the console.

Overall, I’d say it’s a great project and the more people that use it, the better it will become.

How to improve your cygwin console with mintty

Install Cygwin/X and use xterm. (And then you’ll probably either want their version of gvim or the Windows native one.)

Alternatively, you can try AndLinux and work with a real terminal.

I added C:\cygwin\bin (the Cygwin installation path) to the System environment variable: Path . It solves two problems:

How to improve your cygwin console with mintty

I realize this is very old, but since things have changed, ConEmu is the best in my opinion. It lets me run all variety of tabbed shells with massive customization, hot keys, etc. My primary use case is a series of named Cygwin zsh instances.

I’ve been using Poderosa for a long time.

It works beautifully with Cygwin.

It has a dedicated button to launch a Cygwin terminal, while being a capable terminal itself. It’s a tabbed terminal, has the ability to send commands to all your tabs (using a plugin), display profiles (text/background color) per session, copy-by-select, etc.

I mainly use it to test awk / sed scripts on Cygwin before running it on the server.

To answer the wider question about surviving on a Windows box coming from a Linux world, I’d like to recommend MobaXterm from Mobatek. It’s a self-contained Windows application, works on Windows 7 & 8, and includes a plugin for Cygwin. You get the nice wide console that you don’t get from the pre-packaged Windows cmd.exe. You can easily create session shells to Linux boxes from your windows machine. It’s got X server capabilities so you can launch Linux apps and have them served up locally on the Windows box.

My primary machine at work is (unfortunately) Windows. But, I’m able to quite easily access and work with remote Linux boxes using my favorite GUI interfaces — all popping up quite nicely in Windows. Quick examples of things I run include gtkterm, gedit, and Eclipse.

I have no affiliation with the company. Just a very satisfied customer who simply loves how easy it is to install and use. Download the standalone version, run the executable, and you’ll be going in no time. Seriously. The Home Edition works just as well as the Pro Edition with some session count limitations that I honestly never even ran into before I became a paying customer.

  • เคล็ดลับ
  • บล็อก
  • ทำอย่างไร
  • หน้าต่าง
  • โทรศัพท์

How to improve your cygwin console with mintty

How to improve your cygwin console with mintty

How to improve your cygwin console with mintty

  • หลัก 
  • บล็อก 
  • วิธีการปรับปรุง Cygwin Console ของคุณด้วย Mintty

How to improve your cygwin console with mintty

Cygwin ดีมากสำหรับการรับความดีของบรรทัดคำสั่ง Linux ใน Windows แต่การใช้ Windows Shell เพื่อเข้าถึงจะเป็นการฆ่าบางส่วนของเวทมนตร์นั้น ใช้ Mintty และวิธีอื่น ๆ เพียงไม่กี่คุณก็สามารถทำให้ประสบการณ์หรูหรามากขึ้น

ข้อ จำกัด ของ Windows Shell

เราได้แสดงวิธีการติดตั้งและใช้ Cygwin ไว้แล้วเพื่อให้คุณสามารถใช้ Windows ได้และไม่ต้องพลาดในความดีของบรรทัดคำสั่งนั้น สำหรับผู้คนจำนวนมากอย่างไรก็ตามความตื่นเต้นในการรันทุบตีใน Windows นั้นถูกขัดขวางโดย Cygwin ใช้เชลล์ Command Prompt เพื่อทำสิ่งต่างๆให้เสร็จสิ้น ต่อไปนี้เป็นปัญหาทั่วไปและข้อร้องเรียนเกี่ยวกับการตั้งค่านี้:

  • การปรับขนาดหน้าต่างในแนวนอนไม่ทำงานอย่างถูกต้อง
  • ไม่สามารถเปลี่ยนใบหน้าแบบอักษรหรือขนาดได้อย่างมีประสิทธิภาพในทันที
  • การเลื่อนผ่านแป้นพิมพ์ไม่ทำงาน
  • การเลือกข้อความมากกว่าหลายบรรทัดไม่ทำงาน
  • ด้วยการกำหนดค่าบางอย่างการเลือกข้อความทั้งหมดไม่ได้ผล
  • ทุกอย่างน่าเกลียดเมื่อเทียบกับที่ลินุกซ์เทอร์มินัลให้

Mintty บันทึกวัน

Mintty เป็นทางเลือกที่ยอดเยี่ยมสำหรับ Cygwin ที่มีคุณสมบัติที่เป็นประโยชน์และช่วยแก้ปัญหาข้างต้น ถ้าคุณใช้ MSYS / MinGW แทน Cygwin Mintty จะทำงานได้อย่างสวยงามด้วยเช่นกัน

คุณสามารถติดตั้ง Mintty โดยคว้ามันจากหน้าดาวน์โหลดของโครงการ (ตรวจดูให้แน่ใจว่าคุณได้รับเวอร์ชันที่เหมาะสมสำหรับการติดตั้งของคุณ) หรือคุณสามารถเรียกใช้ไฟล์ Setup.exe ของ Cygwin ได้อีกครั้ง

How to improve your cygwin console with mintty

ที่หน้าจอเลือกแพ็คเกจให้ดูที่ “เปลือกหอย” และค้นหา Mintty คลิกที่คำว่า “ข้าม” แล้วคลิกปุ่มถัดไป เมื่อเสร็จสิ้นการติดตั้งแล้วคุณสามารถไปที่ Start> All Programs> Cygwin> mintty เพื่อเปิดใช้งาน

How to improve your cygwin console with mintty

นี่คือสิ่งที่หน้าต่าง Mintty เริ่มต้นมีลักษณะดังนี้:

How to improve your cygwin console with mintty

เป็นวานิลลาเพียงเล็กน้อย แต่คุณจะเห็นว่าการปรับขนาดจะทำงานได้ดีและตัวอักษรจะดีกว่านิดหน่อย คุณสามารถกด Ctrl และ + หรือ – เพื่อทำให้ตัวอักษรใหญ่ขึ้นหรือเล็กลงได้ตลอดเวลา คลิกขวาที่ Title Bar และเลือก Options .

How to improve your cygwin console with mintty

สิ่งแรกที่ฉันทำก็คือเปลี่ยนความโปร่งใสของหน้าต่างและเคอร์เซอร์ในแท็บ “ดู” ไปเป็นสิ่งที่ฉันคุ้นเคยมากขึ้น ไปที่แท็บ Text เมื่อคุณทำเสร็จแล้ว

How to improve your cygwin console with mintty

คุณสามารถเปลี่ยนแบบอักษรเริ่มต้นได้แน่นอน แต่ยังมี Locale และ Character Set ให้แตกต่างจากที่ Windows ใช้อยู่ในขณะนี้ คุณยังสามารถเล่นกับแบบอักษรที่เรียบถ้าจอแสดงผลของคุณแสดงให้เห็นว่ามีขรุขระเกินไป

How to improve your cygwin console with mintty

ภายใต้ตัวเลือกเมาส์คุณจะสามารถเปลี่ยนการตั้งค่าการโต้ตอบของเมาส์ได้เช่นการคัดลอกและวาง นอกจากนี้คุณยังสามารถทำให้เคอร์เซอร์บรรทัดคำสั่งของเมาส์เป็นเรื่องที่ผู้ใช้มักเป็นที่ต้องการ สุดท้ายคลิกที่หน้าต่าง

How to improve your cygwin console with mintty

ที่นี่คุณสามารถเปลี่ยนขนาดเทอร์มินัลมาตรฐานขนาดบัฟเฟอร์ scrollback และเลือกตัวปรับแต่งสำหรับการเลื่อนด้วยปุ่มลูกศร โดยค่าเริ่มต้น Shift + ขึ้น / ลงจะเลื่อนดูบัฟเฟอร์ในหน้าต่าง ต่อไปนี้คือรูปลักษณ์ของ Mintty ที่แก้ไขแล้ว

How to improve your cygwin console with mintty

วิธีการอื่น ๆ (สำหรับ PuTTY-Lovers)

Mintty ดีมาก แต่คนอื่นอาจไม่ชอบมันมากนัก เราได้แสดงวิธีการติดตั้งเซิร์ฟเวอร์ SSH ใน Cygwin และหลายคนใช้ PuTTY หรือ KiTTY เพื่อเชื่อมต่อกับ Cygwin ด้วยวิธีนี้ อย่างไรก็ตามหากคุณไม่ต้องการตั้งค่าการเข้าถึง SSH มีวิธีง่ายๆ

PuTtycyg เป็น Patchted ของ PuTTY ซึ่งสามารถเชื่อมต่อกับ Cygwin installation ได้ มีเพียงหนึ่งข้อต่อ: PuTTY ได้รับการอัปเดตเมื่อเร็ว ๆ นี้เป็นเวอร์ชัน 0.61 เพิ่มการสนับสนุนรายการกระโดดกระโดดของ Windows 7 แบบอักษรปรับขนาด Aero และแบบอักษรที่ไม่ใช่ความกว้างคงที่ PuTtycyg ยังไม่ได้รับการอัพเดตดังนั้นคุณจะต้องเลือกระหว่างการสนับสนุน Cygwin และ Windows 7 ฉันไม่สามารถหาแพทช์นี้ได้ดังนั้นฉันไม่ได้พยายามเพิ่มการสนับสนุน PuTTY เวอร์ชันล่าสุด ถ้าคุณมีโปรดปล่อยให้เส้นในความคิดเห็น

ส่วนตัวฉันชอบ KiTTY มากกว่า PuTTY เนื่องจากมีการปรับแต่งได้มากขึ้นและได้รับการอัปเดตบ่อยครั้งในช่วง 4 ปีที่ผ่านมา มีแพทช์ PuTTYcfg ที่เข้ากันได้กับ KiTTY ซึ่งจะเพิ่มฟังก์ชันการทำงานนี้ให้กับผู้อื่นเช่นฉัน ความซื่อสัตย์แม้ว่าตั้งแต่ฉันเริ่มใช้ Mintty กับ Cygwin ฉันไม่ได้สัมผัส KiTTY ในสัปดาห์ที่ผ่านมา

สุดท้ายหากคุณกำลังมองหาบางอย่างที่สนับสนุน Cygwin และ Windows Command Prompt คุณอาจสนใจ Console เป็นการเปลี่ยนคอนโซลที่ช่วยให้แท็บมีหลายประเภทของเปลือกรวมทั้งเพิ่มความโปร่งใสและการเปลี่ยนแปลงแบบอักษร on-the-fly

คุณมีเปลือก Cygwin ที่ต้องการหรือไม่? คุณมีทางเลือกให้ Cygwin หรือไม่? รู้จักแพทช์ที่ทำงานร่วมกับ PuTTY 0.61 หรือไม่? แจ้งให้เราทราบด้านล่าง!

How to improve your cygwin console with mintty

Geoffrey_Carr

How to improve your cygwin console with mintty

O Cygwin é ótimo para obter alguma bondade de linha de comando do Linux no Windows, mas usar o Shell do Windows para acessá-lo elimina parte dessa mágica. Usando o Mintty e alguns outros métodos, você pode tornar a experiência muito mais luxuosa.

Limitações do Shell do Windows

Já mostramos como instalar e usar o Cygwin para que você possa usar o Windows e não ter que perder essa qualidade de linha de comando. Para muitas pessoas, no entanto, a emoção de executar bash no Windows é severamente prejudicada pelo fato de que o Cygwin usa o shell Prompt de Comando para fazer as coisas. Aqui estão alguns dos problemas mais comuns e reclamações com esta configuração:

  • Redimensionar a janela horizontalmente não funciona corretamente
  • Não é possível alterar de forma eficiente os rostos ou tamanhos de fontes dinamicamente.
  • A rolagem pelo teclado não funciona.
  • Selecionar texto em várias linhas não funciona.
  • Com algumas configurações, a seleção do texto não funciona.
  • É todo o tipo de feio comparado ao que os terminais Linux fornecem.

Uma ferramenta útil que é uma tarefa a ser utilizada não me leva muito longe. E quanto a você?

Mintty salva o dia

O Mintty é um excelente shell alternativo para o Cygwin que fornece uma série de recursos úteis e alivia os problemas acima. Se você usa o MSYS / MinGW em vez do Cygwin, o Mintty trabalha lindamente com isso também.

Você pode instalar o Mintty, pegando-o na página de download do projeto (certifique-se de obter a versão adequada para a sua configuração!), Ou você pode simplesmente executar o arquivo Setup.exe do Cygwin novamente.

How to improve your cygwin console with mintty

Na tela Selecionar Pacotes, procure em “Shells” e encontre o Mintty. Clique onde diz “Skip” e aperte o botão Next. Assim que terminar de instalá-lo, você poderá acessar Iniciar> Todos os Programas> Cygwin> mintty para iniciá-lo.

How to improve your cygwin console with mintty

Veja como é a janela padrão do Mintty:

How to improve your cygwin console with mintty

É um pouco de baunilha, mas você notará que o redimensionamento funciona corretamente e que a fonte é pelo menos um pouco melhor. Você pode pressionar Ctrl e + ou – para aumentar ou diminuir a fonte a qualquer momento. Clique com o botão direito do mouse na Barra de Título e escolha Opções…

How to improve your cygwin console with mintty

A primeira coisa que fiz foi alterar a transparência da janela e o cursor na guia Looks para algo com o qual estou mais familiarizado. Vá até a guia “Texto” quando terminar.

How to improve your cygwin console with mintty

Você pode alterar a fonte padrão, é claro, mas também o Locale e Character Set para algo diferente do que o Windows está usando agora. Você também pode tocar com a suavização de fonte se o seu monitor mostrar um pouco irregular demais.

How to improve your cygwin console with mintty

Nas opções do mouse, você poderá alterar as configurações de interação do mouse, como copiar e colar. Você também pode facilmente fazer o mouse posicionar o cursor da linha de comando, algo que os usuários do vim frequentemente parecem gostar. Por último, clique na janela.

How to improve your cygwin console with mintty

Aqui, você pode alterar o tamanho do terminal padrão, o tamanho do buffer de rolagem e escolher um modificador para rolar com as teclas de seta. Por padrão, Shift + Up / Down percorrerá o buffer na janela. Agora, veja como fica minha configuração modificada do Mintty.

How to improve your cygwin console with mintty

(Clique na imagem acima para ver uma versão maior)

Outros Métodos (para PuTTY-Lovers)

Mintty é ótimo, mas outros podem não gostar muito. Mostramos a você como instalar um servidor SSH no Cygwin, e muitas pessoas usam o PuTTY ou o KiTTY para se conectar ao Cygwin dessa maneira. No entanto, se você não quiser configurar o acesso SSH, haverá uma maneira mais fácil.

O PuTTYcyg é uma versão corrigida do PuTTY que é capaz de se conectar a instalações nativas do Cygwin. Há apenas um problema: o PuTTY foi recentemente atualizado para a versão 0.61, adicionando suporte para as listas de atalhos do Windows 7, redimensionamento de Aero e fontes de largura não fixa. O PuTTYcyg ainda não foi atualizado, então você terá que escolher entre o suporte ao Cygwin e o Windows 7. Ainda não consegui encontrar o patch, por isso não tentei adicionar suporte à versão mais recente do PuTTY. Se você tiver, por favor deixe uma linha nos comentários.

Pessoalmente, eu prefiro o KiTTY ao PuTTY porque ele é mais personalizável e foi atualizado com mais frequência nos últimos 4 anos. Há um patch PuTTYcfg compatível com KiTTY que adiciona essa funcionalidade a outras pessoas como eu. Para ser honesto, desde que comecei a usar o Mintty com o Cygwin, não toquei no KiTTY em semanas.

Por fim, se você estiver procurando por algo que ofereça suporte ao Cygwin e ao Prompt de Comando do Windows, talvez esteja interessado no Console. É um substituto do console que permite a tabulação de vários tipos de shells, além de adicionar transparência e alterações imediatas de fontes.

Você tem um shell Cygwin preferido? Você tem uma alternativa ao Cygwin? Sabe de um patch que funciona com o PuTTY 0.61? Deixe-nos saber abaixo!