Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

dock config #15

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions lib/status-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Copy link
Member Author

@UziTech UziTech Nov 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I basically copied the onDropTabBar method. This would obviously need to be refactored.

}

return terminusView
}

Expand Down
6 changes: 6 additions & 0 deletions lib/terminus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?',
Expand Down