In this post, I’m going to show you how to:

  • ‘cancel’ yourself out of a buffer/command
  • cancel a query
  • ctrl+c yourself back to the shell/cmd prompt

Starting over on your query/script

Ctrl+C will kill you out of SQLcl completely if you’re in the editor. This is a bug on one of the components we’re using (JLINE), and we have a fix scheduled for SQLcl 19.2. But in the meantime, using the ESC key will provide you all the relief necessary.

You start typing, and at some point, you realize, there’s no fixing this, let’s just start over.

Hit ESC to exit the editor, and we’ll leave the buffer contents instact

Again, we hope to have this working with Ctrl+C in version 19.2 of SQLcl.

Cancelling a query

You’ve successfully submitted your query or anonymous block to the database. Now we want to cancel it. Ctrl+C will send that request.

Now at that point, it’s up to the jdbc driver and the database to decide how and WHEN to handle that request.

Here’s an example.

Issue your Ctrl+C and wait.

I’m tired of waiting just get me out of here already

Just hit ctrl+c, again.

Yes, I know, I’m not the best typist out there.

Making this more transparent going forward

We also plan in version 19.2 to print status messages to the window. For example, when you send the query cancel, we’ll register that and let you know we’re working on it, so you don’t get frustrated and hit the button again.

I’m also told that in 19.2 with the new JLINE toys, we’ll be able to do some wicked-cool vi integration.


I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.


  1. Avatar

    On Windows 10 in the Windows Terminal under PowerShell the issue is still present.
    Esc doesn’t work. Ctrl+C aborts sqlcl and exits to the shell prompt.

    • Avatar

      Hmm, I also experience this problem. Environment: Windows 10 Pro 21H1, native CMD, SQLcl 20.4. If I press Ctrl-C on the “SQL>” prompt, in the SQL command editor or on an ACCEPT prompt, it kills SQLcl completely.

    • thatjeffsmith

      If you mean TRACEONLY, then not till at least version 20.2

      otherwise autotrace already works

Reply To Leandro Martins de Lima Cancel Reply