Heroku login success, but then freezes - windows

I am using Git Bash on Windows.
I just verified my Heroku account,
then I open git bash and type:
$ heroku login
bash responds:
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/browser/c31ddaf9-7a55-4daf-afad-a0500e924c26
heroku: Waiting for login...
Logging in... done
Logged in as [my mail address]
and then, I can type whatever I want, but it does not get and execute the command, behaving like a text editor. Then, when I click on the cross to close it, a warning message appears, telling that some processes are still going on.
How do I unlock the freezing and go on using Bash?

I solved it by hitting CTRL+C to break out and chose yes (type y).
It turns out that the git bash terminal has the frequent problem of turning "frozen" after you enter a command.
Whenever it happens, you should press CTRL+C

Related

How to stop Heroku Local without restarting Powershell?

I have my index.jsp running on local:5000 and when I type CTRL+C in Powershell to stop the local app, I get a message saying "[Done] Killing all processes with signal SIGINT".
I then Receive another prompt to "Terminate batch job? [Y/N]" and I typed Y and hit enter. This stops any output showing in powershell but for some reason the index.jsp still works fine as if it's still being hosted on localhost:5000.
How do I stop heroku without closing my entire powershell terminal and restarting (which seems to work, but its a PITA)?

How to Automate pressing [ENTER] to continue in bash script

I have a bash script that helps install a few applications automatically.
One app requests that I press ENTER to continue, or CTRL+C to cancel.
How can I automate my script to press ENTER when that prompt comes up?
For simple enter or confirmation, consider using the yes command:
yes '' | command_or_script
For automating more complex interactions, consider using expect.
See: https://stackoverflow.com/a/7013379/7939871

Unix - Suppress informatory messages

I am trying to execute a remote command for one of my scripts. I have to run this script across many servers. so i will put it in a script. What I am trying to do is
ssh root#10.158.42.12 nohup perl /script/myscript.pl 06/04/2014 60 &
The script runs just fine but there is an info message which is displayed whenever you try to login . The one many of you would be familiar with ..
|-----------------------------------------------------------------|
| This system is for the use of authorized users only. |
| Individuals using this computer system without authority, or in |
Due to this the script execution is haulted unless an enter is pressed. I want to put the script in a cronjob for automatic execution, so i dont need to see this info message.
Here's my theory:
Your command doesn't run the program in the background on the server. It runs runs the program in the foreground on the server, and then you background ssh.
Since ssh runs in the background, you are immediately returned to your prompt.
Milliseconds later, ssh overwrites your prompt with this message and runs the command.
You are now looking at the ssh message and no prompt.
You hit press enter, which causes the prompt to be redrawn on the next line.
This leads you to believe ssh was actually waiting for you to press enter. In reality, the command was already run, and bash was ready for new commands, just obscured by ssh noise.
How to test:
If I'm right, pressing Ctrl+L instead of Enter will clear the screen and show the bash prompt. (assuming you don't use bash's vi mode).
If I'm not, Ctrl+L will instead either do nothing, print the ssh message again or just write ^L to the screen.
How to fix if I'm right:
ssh -f root#10.158.42.12 'nohup perl /script/myscript.pl 06/04/2014 60 &' 2> /dev/null

Capistrano "Press [Enter] to start a shell" on shell login

I'm trying to use capistrano to deploy on a shared host. However the ssh connection seems not to be standard, when I connect with the terminal, it asks me to press Enter to continue, and this seems to prevent Capistrano from working. Here's the console output:
Asking for console, please wait
Connected
Grabbing terminal
Ok
Press [Enter] to start a shell
hosting-user#paas_12345:~$
Any idea on how I could hack Capistrano to press the Enter key just after login? Or at least some ideas about what this strange terminal technology is?

Why does git freeze on git-credential-osxkeychain sometimes?

When I do cd some-repo; git push origin master in my bash terminal, it doesn't ask me for username/password because I guess git has already saved that (it was so long ago that I don't remember the details of how that went down). I'm pushing to a GitHub repo as the remote origin.
So I have a C++ program that does a fork and
execl("/bin/bash", "/bin/bash", "-c", "cd some-repo; git push origin master", (char *)0);
Then waits for the child bash process to finish.
Sometimes it works just fine, but other times (seemingly randomly) it will freeze up. Looking at the running process hierarchy, I see:
MyProgram
git
git-remote-http
git
git-credential-osxkeychain
If I kill the child-most git-credential-osx process, my program resumes (because the parent-most git command finishes), with not surprising output such as:
error: git-credential-osxkeychain died of signal 15
error: RPC failed; result=7, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
My question: why does git push origin master always seem to work (without asking me for any username password or other stdin) in a bash terminal, but hangs (probably asks for something on stdin) on git-credential-osxkeychain sometimes but not other times when I run it from my C++ program?
I tried looking for man page on git-credential-osxkeychain and couldn't really find anything. Running it only prints Usage: git credential-osxkeychain <get|store|erase> which isn't self-explanatory enough for me. Thank you!
I'm running OS X 10.8.3; git version 1.7.12.4 (Apple Git-37); GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12).
Without much information, my guess is that the hanging depends on whether or not your login keychain is locked at the time. On the Mac, if the login keychain is unlocked, then the query to get your username and password can proceed unhindered. But if the keychain is locked, then then Mac OS X wants to prompt you for your login password to unlock the keychain. I suspect the dialog box is there, just hidden behind something, so you may have missed it. It'll wait for you to type in your password, effectively hanging the process.
There is more information on the gitcredential infrastructure here, and more about the API (including the command line for a helper) here.

Resources