See Aborting commands and processes
Ctrl+G
Abort the current command which may either be running or just partially typed in. Use Esc in Mac OS editor emulation.
Esc