8

Whenever I want to quit something in Cygwin, Ctrl + Z usually does the trick.

What's the equivalent in the command prompt?

2
  • 2
    ^c (ctrl+c) i believe, but its been awhile and i am not 100% sure
    – Xantec
    Nov 23, 2010 at 17:11
  • it's not working, usually in cygwin when I do git diff ctrl+z would allow me to quickly exit a large diff, but in DOS ctrl+z and ctrl+c both do nothing.
    – erikvold
    Nov 23, 2010 at 17:53

4 Answers 4

14

Depends on what you mean by "quit something"; within Windows cmd:

Ctrl+Z sends the EOF character, which could terminate a process if you're providing input, but otherwise will probably do nothing.

Ctrl+C normally sends SIGINT to the foreground process, which should terminate it, but programs can respond however they like - ie, they can catch the signal but then ignore it. The command can also be remapped to other jobs (such that for a specific program it doesn't really send a signal) or ignored entirely.

Ctrl+Break always sends SIGBREAK, which again should terminate the process, but unlike Ctrl+C cannot be remapped, but can still be ignored. This is probably what you need.

Here's a source: MSDN article: CTRL+C and CTRL+BREAK Signals.

1

It's Ctrl-C, if you want to cancel a long DOS command (e.g. C:\>dir /s)

2
  • IIRC, Ctrl-C is only processed during I/O operations. Would not interrupt a task that doesn't happen to enter a DOS I/O subroutine. Nov 23, 2010 at 19:38
  • @Brian: yes, you're probably right. I think DMA57361's answer is correct - Ctrl-Break is probably what he wants.
    – gkrogers
    Nov 24, 2010 at 10:29
0

Ctrl-Z is a DOS/Windows convention, not a Cygwin convention. Try the same keystroke.

1
  • 2
    As a honored member of Super User, please try to elaborate on your answer to provide more detail. Jul 13, 2012 at 9:09
0

Ctrl-C

1
  • Mind filling this out a bit with exactly what it does?
    – soandos
    Jul 23, 2012 at 2:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .