public void toggleTerminalView() {
        boolean wasEnabled = isTerminalViewEnabled();
        if (wasEnabled) {
            if (viewContext != null) {
                viewContext.dispose();
            }
            setConsoleViewEnabled(false);
        } else {
            setConsoleViewEnabled(true);
            if (editor.hasMaximizedControl()) {
                editor.toggleResultPanel(true, false);
            }
            obtainViewContext();
        }        
        editor.getActivePreferenceStore().firePropertyChangeEvent(
            SQLTerminalPreferencesConstants.SHOW_TERMINAL_VIEW_BY_DEFAULT,
            wasEnabled, !wasEnabled
        );
    }
Changes the state of SQL Terminal.
The state is stored in the editor properties.
plugins/org.jkiss.dbeaver.ui.editors.sql.terminal/src/org/jkiss/dbeaver/ui/editors/sql/terminal/SQLTerminalEditorAddIn.java