Skip to content

Commit

Permalink
Create close pane hotkey.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwmyers committed Apr 16, 2019
1 parent 1190202 commit 4949f14
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions terminus-core/src/components/splitTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
case 'split-nav-down':
this.navigate('b')
break
case 'close-focus-pane':
this.removeTab(this.focusedTab)
break
}
})
}
Expand Down Expand Up @@ -336,6 +339,8 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes

if (this.root.children.length === 0) {
this.destroy()
} else {
this.focusAnyIn(parent)
}
}

Expand Down
1 change: 1 addition & 0 deletions terminus-core/src/configDefaults.linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ hotkeys:
- 'Ctrl-Alt-ArrowUp'
split-nav-left:
- 'Ctrl-Alt-ArrowLeft'
close-focus-pane: []
pluginBlacklist: ['ssh']
2 changes: 2 additions & 0 deletions terminus-core/src/configDefaults.macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ hotkeys:
- '⌘-⌥-ArrowUp'
split-nav-left:
- '⌘-⌥-ArrowLeft'
close-focus-pane:
- '⌘-Shift-W'
pluginBlacklist: ['ssh']
1 change: 1 addition & 0 deletions terminus-core/src/configDefaults.windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ hotkeys:
- 'Ctrl-Alt-ArrowUp'
split-nav-left:
- 'Ctrl-Alt-ArrowLeft'
close-focus-pane: []
pluginBlacklist: []
4 changes: 4 additions & 0 deletions terminus-core/src/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ export class AppHotkeyProvider extends HotkeyProvider {
id: 'split-nav-right',
name: 'Focus the pane on the right',
},
{
id: 'close-focus-pane',
name: 'Close focused pane',
},
]

async provide (): Promise<IHotkeyDescription[]> {
Expand Down

0 comments on commit 4949f14

Please sign in to comment.