Windows 终端和(MinGW、Cygwin)

Windows Terminal and (MinGW, Cygwin)

微软似乎要推出 "Windows Terminal",参见 https://devblogs.microsoft.com/commandline/introducing-windows-terminal/ 看来您将能够使用 C 语言进行编程。

我正在考虑安装 MinGW 或 Cygwin,以便我可以用 C 编写一些程序。Windows 终端的引入会使这些变得多余吗?

作为 Seva Alekseyev indicated, you don't need a terminal program to write C programs. You also don't need Cygwin or MinGW to write them. However, to answer the question that was asked, it appears that the new Windows Terminal will allow you to launch various shells. I'm hopeful that Cygwin will be among them. Note, however, that the new Windows Terminal appears that it will only work on the latest Windows 10 builds. In which case, you might consider WSL or even WSL 2(也定于今年晚些时候),这对您来说可能是比 Cygwin 或 MinGW 更好的环境。

如中所述:https://github.com/microsoft/terminal/blob/master/doc/user-docs/ThirdPartyToolProfiles.md

假设您已经将 Cygwin 安装到 C:/Cygwin:

{
    "guid": "{916f2925-597a-4b52-aac2-9a4387626b4c}",
    "name" : "Cygwin",
    "commandline" : "C:/Cygwin/bin/bash --login -i",
    "icon" : "C:/Cygwin/Cygwin.ico",
    "startingDirectory" : "C:/Cygwin/bin" 
}  

请注意,Cygwin 的起始目录设置为使路径有效。由于 --login 标志,启动 Cygwin 时打开的默认目录将为 $HOME

仅供参考:使用 Cygwin64 在我的 PC 上进行以下工作:

{
    "guid": "{379bd4d8-dc40-409a-abd4-3ff1712c12f7}",
    "name" : "Cygwin",
    "commandline" : "c:/cygwin64/bin/bash --login -i",
    "icon" : "c:/cygwin64/Cygwin.ico",
    "startingDirectory" : "c:/cygwin64/bin"
}