Embed Git bash in PyCharm as external tool and work with it in PyCharm window (windows xp)

纵饮孤独 提交于 2019-12-03 05:57:07

问题


I added cmd as external tool in PyCharm, and it works nicely in PyCharm console (View -> Run). Here is described how to launch Git bash from cmd. It opens in separate window, but I want it to be in the same PyCharm window, so I can type commands without pressing the CTRL+TAB.

I suppose there should be other way, more straight-forward, but I dont see it.


回答1:


Configure the Terminal to use bash.exe or sh.exe from Git installation like this:

"c:\Program Files\Git\bin\sh.exe" --login

Use Tools | Open Terminal... (or click on the Terminal tool window) then run your git command in the Terminal tool window.




回答2:


File -> settings -> terminal -> shell path

Paste this if you have a 32-bit installation of Git:

"C:\Program Files (x86)\Git\bin\sh.exe" --login

Or this for 64-bit installation:

"C:\Program Files\Git\bin\sh.exe" --login

The quotes are important: if you don't specify them you'll get an error because the path contains spaces.

If you encounter java.io.IOException: Couldn't create PTY, check that:

  1. There is an istallation of git in the specified path.
  2. You have used quotes around the path.



回答3:


You must add to PATH variable

;C:\Program Files\Git\bin

And open terminal in idea.



来源:https://stackoverflow.com/questions/20573213/embed-git-bash-in-pycharm-as-external-tool-and-work-with-it-in-pycharm-window-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!