code: public void waitAbortable() throws IOException, InterruptedException {
          try {
              isWaiting.set(true);
              terminal.waitAbortable(updater);
          } finally {
              close();
              updateLines();
              terminal.finish();
          }
      }
docs: Wait for all scheduled tasks to finish allowing the user to abort all
  tasks with &lt;ctrl&gt;-C.
  
  @throws IOException If interrupted by user.
  @throws InterruptedException If interrupted by system or other threads.