我如何摆脱>>当我犯错时在powershell中提示?
我将 powershell 与 git 一起使用以实现 poshgit 功能,有时我会在输入 git 命令时出错,例如 git commit -m 'something and for get to close the ' 在按 Enter 之前。它转到我输入 ' 并按 Enter 键的新行,但我仍然得到 >>迅速的。有没有简单的方法可以说给我一个新的提示并摆脱无限>>>循环而不关闭powershell?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
按ctrl+C。
Press ctrl+C.
@jon Z 的答案告诉你如何中止它,但你想要的是在空的
>>
提示符处按 Enter 键,然后你就会退出:注意最后一个
> ;>
提示我只需按 Enter 键即可完成命令。当您需要多行命令(在本例中提交消息是多行)并表示结束时,只需在空行上按回车键即可退出。@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: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.在提示符下键入“退出”。 ^C 对我不起作用。也没有进去。
Type "exit" at the prompt. ^C didn't work for me. Nor did enter.
如果您想退出控制台而不运行输入的命令,只需键入 Ctr+C。
如果您想运行输入的命令,但即使在多次输入后,power-shell 仍然给出双倍的权利,请检查您的命令语法。
任何额外的空格或引号都可能导致此问题。
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.
我也尝试了上面答案中的各种命令。
然后我简单地“退格”并将所有命令删除回“C:\”!
效果很好。
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.
Ctr-C 是在类似情况下对我有用的唯一选项,并且带有 >>
Ctr-C is the only option that worked for me in the similar situation with a >>
只需按 ctrl-z + return(enter) 几次,您就会退出
just press ctrl-z + return(enter) a few times and you will be out
使用 exit() 或 Ctrl-Z 加 Return 退出
Use exit() or Ctrl-Z plus Return to exit
我发现退出并重新启动 Visual Studio 更容易。我首先尝试了以上几种。顺便说一句,我正在使用 VS 2022。
I found it easier to the exit and restart Visual Studio. I tried several of the above first. BTW, I am using VS 2022.
我现在有点晚了,但是在遇到这个问题并且 Ctrl+C、Ctrl+Z、Enter 和 Exit 对我不起作用之后,我发现这有效:
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: