1 /*
   2  * Copyright (c) 2002-2012, the original author or authors.
   3  *
   4  * This software is distributable under the BSD license. See the terms of the
   5  * BSD license in the documentation provided with this software.
   6  *
   7  * http://www.opensource.org/licenses/bsd-license.php
   8  */
   9 package jdk.internal.jline;
  10 
  11 // Based on Apache Karaf impl
  12 
  13 /**
  14  * Non-interruptible (via CTRL-C) {@link UnixTerminal}.
  15  *
  16  * @since 2.0
  17  */
  18 public class NoInterruptUnixTerminal
  19     extends UnixTerminal
  20 {
  21     public NoInterruptUnixTerminal() throws Exception {
  22         super();
  23     }
  24 
  25     @Override
  26     public void init() throws Exception {
  27         super.init();
  28         getSettings().set("intr undef");
  29     }
  30 
  31     @Override
  32     public void restore() throws Exception {
  33         getSettings().set("intr ^C");
  34         super.restore();
  35     }
  36 }