简体   繁体   English

将cmdline(win7)添加为Eclipse控制台视图

[英]Adding cmdline (win7) as an Eclipse console view

I've seen it in linux. 我已经在linux中看到了。 There's a console you can open that is just a shell. 您可以打开一个只有外壳的控制台。 I want the same thing in windows only with either cmd, or with git bash. 我只想在Windows中使用cmd或git bash进行相同操作。 (MINGW32). (MINGW32)。 I tried googling it but just got flooded with articles about egit and normal git bash. 我尝试使用谷歌搜索,但是却充斥着有关egit和普通git bash的文章。

If you have msysgit, you can use it from a regular cmd session: 如果您有msysgit,则可以在常规cmd会话中使用它:

Launch c:\\windows\\system32\\cmd.exe /k <path\\to\\your\\msysgit>\\git-cmd.bat , and you can type in that cmd windows regular git commands. 启动c:\\windows\\system32\\cmd.exe /k <path\\to\\your\\msysgit>\\git-cmd.bat ,您可以在该cmd Windows中输入常规git命令。

For a bash session : c:\\windows\\system32\\cmd.exe /k <path\\to\\your\\msysgit>\\git-bash.bat . 对于bash会话c:\\windows\\system32\\cmd.exe /k <path\\to\\your\\msysgit>\\git-bash.bat

Note that you need to modify those bat: 请注意,您需要修改这些蝙蝠:

  • git-cmd.bat : add a rem before the setlocal command, and before the start at the end. git-cmd.bat :在setlocal命令之前和结尾处之前添加一个rem。
  • git-bash.bat : add a rem before the setlocal command. git-bash.bat :在setlocal命令之前添加一个rem。

So you can add to your Eclipse an external tool which will open a cmd in your console : 因此,您可以在Eclipse中添加一个外部工具,该工具将在控制台中打开一个cmd

http://www.avajava.com/tutorials/eclipse/how-do-i-open-a-windows-command-prompt-in-my-console/how-do-i-open-a-windows-command-提示 - 在 - 我 - 控制台03.gif

Except, instead of calling C:\\windows\\system32\\cmd.exe (in the " Location " field from the picture above), you could call directly: C:\\windows\\system32\\cmd.exe /k <path\\to\\your\\msysgit>\\git-bash.bat . 除了可以调用C:\\windows\\system32\\cmd.exe (在上图的“ Location ”字段中),您可以直接调用: C:\\windows\\system32\\cmd.exe /k <path\\to\\your\\msysgit>\\git-bash.bat

By 'msysgit', I refer to whatever name you gave to the uncompresdsed portable version of " Git For Windows ": download it there . 通过“ msysgit”,我指的是您为“ Git For Windows ”的未经压缩的便携式版本提供的任何名称: 在此处下载

And then you could type git command within the Eclipse console (including a bash session)! 然后,您可以在Eclipse控制台(包括bash会话)中键入git命令!


After testing, the color codes get in the way, even if git works: 经过测试后,即使git起作用,颜色代码也会妨碍您:

  • git-cmd.bat : git-cmd.bat
    CMD

  • git-bash.bat : git-bash.bat
    庆典

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM