src/jdk.internal.le/share/classes/jdk/internal/jline/NoInterruptUnixTerminal.java
author wetmore
Thu, 21 Sep 2017 12:13:25 -0700
changeset 47238 2557ac47e731
parent 47216 71c04702a3d5
child 50338 1d5694c1aa03
permissions -rw-r--r--
8187788: Disasble javax/net tests until JDK-8187786 is resolved Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31530
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     1
/*
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     2
 * Copyright (c) 2002-2012, the original author or authors.
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     3
 *
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     4
 * This software is distributable under the BSD license. See the terms of the
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     5
 * BSD license in the documentation provided with this software.
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     6
 *
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     7
 * http://www.opensource.org/licenses/bsd-license.php
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     8
 */
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     9
package jdk.internal.jline;
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    10
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    11
// Based on Apache Karaf impl
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    12
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    13
/**
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    14
 * Non-interruptible (via CTRL-C) {@link UnixTerminal}.
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    15
 *
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    16
 * @since 2.0
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    17
 */
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    18
public class NoInterruptUnixTerminal
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    19
    extends UnixTerminal
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    20
{
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    21
    public NoInterruptUnixTerminal() throws Exception {
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    22
        super();
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    23
    }
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    24
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    25
    @Override
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    26
    public void init() throws Exception {
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    27
        super.init();
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    28
        getSettings().set("intr undef");
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    29
    }
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    30
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    31
    @Override
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    32
    public void restore() throws Exception {
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    33
        getSettings().set("intr ^C");
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    34
        super.restore();
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    35
    }
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
    36
}