Reputation: 2333
I use powershell with git for the poshgit features and sometimes I'll make an error typing the git command like git commit -m 'something and for get to close the ' before hitting enter. It goes to the new line I type ' and hit enter and I still get the >> prompt. Is there any easy way to say give me back a new prompt and get out of the infinite >> loop with out closing powershell?
Upvotes: 30
Views: 56167
Reputation: 11
I'm a little late on this now, but after having this issue and Ctrl+C, Ctrl+Z, Enter, and Exit not working for me, I found this worked:
PS C:\Users\[USER]>> $host.EnterNestedPrompt()
PS C:\Users\[USER]>>> exit
PS C:\Users\[USER]>> exit
PS C:\Users\[USER]>
Upvotes: 0
Reputation: 929
I found it easier to the exit and restart Visual Studio. I tried several of the above first. BTW, I am using VS 2022.
Upvotes: 0
Reputation: 25
just press ctrl-z + return(enter) a few times and you will be out
Upvotes: 1
Reputation: 11
Ctr-C is the only option that worked for me in the similar situation with a >>
Upvotes: 1
Reputation: 31
I tried the various commands in the above answers as well. Then I simply "backspaced" and deleted all my commands back to "C:\" ! Works just fine.
Upvotes: 2
Reputation: 337
If you want to come out of console without running entered command just type Ctr+C.
If you want to run entered command, but power-shell still giving that double right even after after hitting multiple enters, CHECK FOR YOUR COMMAND SYNTAX. Possibly any extra WHITE SPACE or QUOTEs might be causing this problem.
Upvotes: 4
Reputation: 301147
@jon Z 's answer tells you how to abort it, but what you want is to hit enter at the empty >>
prompt and you will be out:
PS > git commit -m 'test
>> '
>>
[temp 7b96875] test
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 c
Notice in the last >>
prompt I just hit enter and it completes the command. This is done when you want the command multiline ( in this case commit message is multiline) and to signify the end, you just hit return on an empty line to get out.
Upvotes: 19