dgloven
dgloven

Reputation: 71

Commands working on windows command line but not in Git Bash terminal

I am trying to run certain commands in Git Bash but they continue to hang and not display anything. When I run them in the Windows command prompt they work.

For example, in my windows command prompt the

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\danie>python.exe
Python 2.7.11 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:58:36) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks an d https://anaconda.org
>>>

and in Git Bash it just hangs...

danie@DESKTOP-36I511A MINGW64 ~
$ python

I have tried navigating directly in to the folders where the commands exist, trying 'python.exe', and waiting.

I have also looked at the PATH variables for Git Bash, and python.exe is inside of the Anaconda2 folder which I can see below when I run env|grep PATH.

danie@DESKTOP-36I511A MINGW64 ~
$ env|grep PATH
HOMEPATH=\Users\danie
MANPATH=/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man:
PATH=/c/Users/danie/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/danie/bin:/c/Program Files/Dell/DW WLAN Card:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/WIDCOMM/Bluetooth Software:/c/Program Files/WIDCOMM/Bluetooth Software/syswow64:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files (x86)/Skype/Phone:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/110/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn/ManagementStudio:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Users/danie/Anaconda2:/c/Users/danie/Anaconda2/Scripts:/c/Users/danie/Anaconda2/Library/bin:/c/Users/danie/SQLite:/usr/bin/vendor_perl:/usr/bin/core_perl
EXEPATH=C:\Program Files\Git
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info:

This happens with other commands too. Sometimes adding "interactive" helps, other times it doesn't. Any idea what is going on?

Upvotes: 6

Views: 3182

Answers (1)

dgloven
dgloven

Reputation: 71

Update: I ended up just aliasing the problematic windows commands (python, sqlite3, and some others) to get around typing winpty. Hopefully this is an OK solution.

To do this, I created a .bash_profile file in the home directly for Git Bash, and did something like this for each command: alias sqlite3='winpty sqlite3.exe'

Upvotes: 1

Related Questions