0

I just went to commit using git bash. Before type anything accidentally typed character ' and press Enter key.

Unfortunately, I can not exit the editor it keeps going further down when I typed something and press Enter. I tried Exit, Clear everything.

Anyone can help me please.

Thanks for reading.

werkritter
  • 1,479
  • 10
  • 12
Hareen Laks
  • 1,432
  • 2
  • 17
  • 33

1 Answers1

3

You can type Ctrl + C to kill the process. Follow this link to see how it works

Ctrl+C is a map to the kill command. When you press them, kill sends a SIGINT signal, that's interrupts the process.

You can also type another ' to "fix" your issue. Read this link to understand how quoting is treated in bash

Strong quoting

Strong quoting is very easy to explain:

Inside a single-quoted string nothing(!!!!) is interpreted, except the single-quote that closes the quoting.

echo 'Your PATH is: $PATH' That $PATH won't be expanded, it's interpreted as normal ordinary text, because it's surrounded by strong quotes. In practise that means, to produce a text like Here's my test… as a single-quoted string, you have to leave and re-enter the single-quoting to get the character "'" as literal text: # WRONG echo 'Here's my test...'

RIGHT echo 'Here'\''s my test...'

ALTERNATIVE: It's also possible to mix-and-match quotes for readability: echo "Here's my test"

Community
  • 1
  • 1
Naveen Dennis
  • 1,223
  • 3
  • 24
  • 39