How do I distinguish a user hitting Ctrl-c vs EOF using Deno’s prompt function?

Let’s say I have a simple program like this:

while (true) {
  const command = prompt('Enter something');
  if (!command) {
    Deno.exit(0);
  }
}

What I want to do is replicate bash’s behavior where:

  1. Hitting Ctrl-d exits the process
  2. Hitting Ctrl-c is effectively just a continue so it goes to the next iteration of the loop

But it looks like by default the prompt function returns null in either case. Since the signal handler is async, I can’t see how I’d use one to distinguish whether the input was Ctrl-c vs Ctrl-d. Is there another way to do this?