@Override
    public void exitPrivateMode() {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                if (terminalFrame == null) {
                    return;
                }

                blinkTimer.stop();
                terminalFrame.setVisible(false);
                terminalFrame.dispose();
                terminalFrame = null;
            }
        };
        if (SwingUtilities.isEventDispatchThread()) {
            runnable.run();
        }
        else {
            try {
                SwingUtilities.invokeAndWait(runnable);
            }
            catch (Exception e) {
                throw new RuntimeException(
                        "Unexpected " + e.getClass().getSimpleName()
                        + " while disposing SwingTerminal JFrame", e);
            }
        }
    }