Git Bash unresponsive after Do you agree to all the source agreements terms? [Y] Yes [N] No:
Hello, I am starting out in software development - please don't crucify me if I don't know the basics!
I have been trying to cache my GitHub credentials in Git. I am trying to install Git CLI with Bash
winget install --id GitHub.cli
I'm getting the following prompt: Do you agree to all the source agreements terms? [Y] Yes [N] No:
The problem is that I can't find a way to answer this! I have tried Yes, Y, y and even no but each time the cursor just jumps to a new line when I press enter. How do I accept this and get over this part?
Which Terminal are you using? Is it CMD or Windows Terminal?
For a "work around", you can append "--acceptSourceAgreements" to accept the agreement from the "msstore" source. It's checked the first time you connect to get the list of packages from a source with agreements. You can also append "--acceptPackageAgreements" to accept any package level agreements. Those also come from the "msstore" source. In this case, the GitHub.cli package is not coming from the "msstore" source so:
winget install GitHub.cli --acceptSourceAgreements should work.
The prompt is looking for "Y" so when that is prompted, you should be able to type "Y" and then press [Enter].
I believe you have to run the install command in your command prompt, not your git bash
I believe you have to run the install command in your command prompt, not your git bash
This solved my issue.
This is actually a Known Issue in Git-for-windows
Some console programs, most notably non-MSYS2 Python, PHP, Node and OpenSSL, interact correctly with MinTTY only when called through winpty (e.g. the Python console needs to be started as winpty python instead of just python).
Calling winget --wait will cause the same unresponsiveness, but calling winpty winget --wait works as expected. In fact, the default aliases file for Git Bash contains a section on apps that require a win32 console -
case "$TERM" in
xterm*)
# The following programs are known to require a Win32 Console
# for interactive usage, therefore let's launch them through winpty
# when run inside `mintty`.
for name in node ipython php php5 python2.7
do
case "$(type -p "$name".exe 2>/dev/null)" in
''|/usr/bin/*) continue;;
esac
alias $name="winpty $name.exe"
done
;;
esac
/d/Program Files/Git/etc/profile.d/aliases.sh [unix] (22:10 20/10/2022)
By opening the file in a text editor and adding winget after the list of names, closing and then reopening git bash, it should work as expected (Leaving this here as a note for time travellers)
This issue should be resolved with Git For Windows version 2.40.0.
See https://github.com/git-for-windows/build-extra/pull/483 and https://github.com/microsoft/winget-pkgs/pull/99577