
使用mintty(

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.
Cygwin非常適合在Windows中獲得Linux命令行優勢,但是使用Windows Shell進行訪問可以消除這種魔力。 使用Mintty和其他一些方法,您可以使體驗更加豪華。
Windows Shell限制 (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:
我們已經向您展示了如何安裝和使用Cygwin,以便您可以使用Windows,而不必錯過命令行的優點。 但是,對于許多人來說,由于Cygwin使用Command Prompt shell完成任務,因此嚴重阻礙了Windows中運行bash的興奮性。 以下是此設置的一些較常見的問題和不滿意之處:
- 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. 與Linux終端所提供的相比,這真是丑陋。
A useful tool that’s a chore to utilize doesn’t really take me very far. How about you?
一件有用的有用工具并不能使我走得太遠。 你呢?
Mintty節省了一天 (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.
Mintty是Cygwin的絕佳替代外殼,它提供了許多有用的功能并緩解了上述問題。 如果您使用MSYS / MinGW而不是Cygwin,那么Mintty也可以很好地工作。
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.
您可以通過從項目的下載頁面獲取Mintty來安裝Mintty(請確保您獲取的安裝版本正確!),也可以再次運行Cygwin的Setup.exe文件。

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.
在“選擇軟件包”屏幕上,在“外殼”下查找并找到Mintty。 單擊顯示“跳過”的位置,然后單擊“下一步”按鈕。 安裝完成后,您應該可以轉到開始>所有程序> Cygwin> mintty來啟動它。

Here’s what the default Mintty window looks like:
這是默認的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…
這有點香草,但是您會注意到調整大小的工作正常,并且字體至少好一點。 您可以按Ctrl和+或–在任何時間點放大或縮小字體。 右鍵單擊標題欄,然后選擇“選項”。

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.
我要做的第一件事是將窗口透明度和“外觀”選項卡中的光標更改為我更熟悉的內容。 完成后,轉到“文本”選項卡。

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.
當然,您可以更改默認字體,但也可以將“區域設置”和“字符集”更改為與Windows當前使用的字體不同的名稱。 如果顯示器顯示的鋸齒有點太鋸齒,您也可以使用字體平滑處理。

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.
在“鼠標”選項下,您將能夠更改鼠標交互設置,例如復制和粘貼。 您也可以輕松地使鼠標放在命令行光標上,這是vim用戶經常喜歡的東西。 最后,單擊“窗口”。

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.
在這里,您可以更改默認終端大小,回滾緩沖區大小,并選擇修改器以使用箭頭鍵滾動。 默認情況下,Shift +上/下將滾動瀏覽窗口中的緩沖區。 現在,這就是我修改后的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.
Mintty很棒,但是其他人可能不太喜歡它。 我們向您展示了如何在Cygwin上安裝SSH服務器,許多人使用PuTTY或KiTTY以這種方式連接到Cygwin。 但是,如果您不想設置SSH訪問,則有一種更簡單的方法。
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.
PuTTYcyg是PuTTY的修補版本,能夠連接到本機Cygwin安裝。 只有一個障礙:PuTTY最近更新到版本0.61,增加了對Windows 7跳轉列表,Aero調整大小和非固定寬度字體的支持。 PuTTYcyg尚未更新,因此您必須在Cygwin支持和Windows 7兼容性之間進行選擇。 我還沒有找到補丁本身,所以沒有嘗試為最新版本的PuTTY添加支持。 如果有,請在評論中保留一行。
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.
就個人而言,我更喜歡KiTTY,而不是PuTTY,因為它具有更高的可定制性,并且在過去4年中更新的頻率更高。 有一個與KiTTY兼容的PuTTYcfg補丁程序,為我這樣的其他人添加了此功能。 不過,老實說,自從我開始在Cygwin中使用Mintty以來,我已經有幾周沒接觸過KiTTY了。
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.
最后,如果您正在尋找支持Cygwin以及Windows Command Prompt的產品,那么您可能會對Console感興趣。 它是控制臺的替代品,它允許制表符多種類型的外殼,以及增加透明度和即時字體更改。
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!
您有首選的Cygwin外殼嗎? 您有Cygwin的替代產品嗎? 知道適用于PuTTY 0.61的補丁程序嗎? 讓我們在下面知道!
翻譯自: https://www.howtogeek.com/68511/how-to-improve-your-cygwin-experience-with-mintty/
使用mintty(