As i also faced the same problem and because some people here commented that the solution wasn't working for them, here's the link to the post where a working solution has been found.
https://stackoverflow.com/a/24406721/3751590
Also see the "Update" in the best answer for using Cygwin terminal