Merge branch 'master' of github.com:Eugeny/terminus

This commit is contained in:
Eugene Pankov
2017-07-06 10:28:31 +02:00
7 changed files with 126 additions and 23 deletions

View File

@@ -69,6 +69,15 @@ export class TerminalTabComponent extends BaseTabComponent {
this.session.releaseInitialDataBuffer()
})
this.hotkeysSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
if (!this.hasFocus) {
return
}
if (hotkey === 'copy') {
this.hterm.copySelectionToClipboard()
}
if (hotkey === 'clear') {
this.clear()
}
if (hotkey === 'zoom-in') {
this.zoomIn()
}
@@ -228,6 +237,11 @@ export class TerminalTabComponent extends BaseTabComponent {
this.io.writeUTF8(data)
}
clear () {
this.hterm.wipeContents()
this.hterm.onVTKeystroke('\f')
}
async configure (): Promise<void> {
let config = this.config.store
preferenceManager.set('font-family', config.terminal.font)

View File

@@ -44,6 +44,12 @@ export class TerminalConfigProvider extends ConfigProvider {
shell: '~default-shell~',
},
hotkeys: {
'copy': [
'⌘-C',
],
'clear': [
'⌘-K',
],
'zoom-in': [
'⌘-=',
'⌘-Shift-+',
@@ -69,6 +75,12 @@ export class TerminalConfigProvider extends ConfigProvider {
shell: '~clink~',
},
hotkeys: {
'copy': [
'Ctrl-Shift-C',
],
'clear': [
'Ctrl-L',
],
'zoom-in': [
'Ctrl-=',
'Ctrl-Shift-+',
@@ -93,6 +105,12 @@ export class TerminalConfigProvider extends ConfigProvider {
shell: '~default-shell~',
},
hotkeys: {
'copy': [
'Ctrl-Shift-C',
],
'clear': [
'Ctrl-L',
],
'zoom-in': [
'Ctrl-=',
'Ctrl-Shift-+',

View File

@@ -4,6 +4,14 @@ import { IHotkeyDescription, HotkeyProvider } from 'terminus-core'
@Injectable()
export class TerminalHotkeyProvider extends HotkeyProvider {
hotkeys: IHotkeyDescription[] = [
{
id: 'copy',
name: 'Copy to clipboard',
},
{
id: 'clear',
name: 'Clear terminal',
},
{
id: 'zoom-in',
name: 'Zoom in',