diff --git a/lib/status-bar.js b/lib/status-bar.js index 8f6fbb82..b8cb6760 100644 --- a/lib/status-bar.js +++ b/lib/status-bar.js @@ -243,6 +243,30 @@ class StatusBar extends View { this.terminalViews.push(terminusView) this.statusContainer.append(statusIcon) + + if (atom.config.get('terminus.toggles.useDock')) { + const pane = atom.workspace.getBottomDock().getActivePane() + + event.preventDefault() + event.stopPropagation() + this.clearDropTarget() + + const fromIndex = this.terminalViews.length - 1 + const view = this.terminalViews[fromIndex] + view.css('height', '') + // view.terminal.element.style.height = atom.config.get('terminus.style.defaultPanelHeight') + + view.toggleTabView() + this.removeTerminalView(view) + this.statusContainer.children().eq(fromIndex).detach() + view.statusIcon.removeTooltip() + + pane.addItem(view, { index: pane.getItems().length }) + pane.activateItem(view) + + view.focus() + } + return terminusView } diff --git a/lib/terminus.js b/lib/terminus.js index b6a1d15a..e9d34bf4 100644 --- a/lib/terminus.js +++ b/lib/terminus.js @@ -38,6 +38,12 @@ module.exports = { type: 'object', order: 1, properties: { + useDock: { + title: 'Use Bottom Dock', + description: 'Should the terminals be rendered in the bottom dock?', + type: 'boolean', + default: false + }, autoClose: { title: 'Close Terminal on Exit', description: 'Should the terminal close if the shell exits?',