提交 deb4b963 编写于 作者: E Eugene Pankov

copy hotkey for macOS (fixes #61)

上级 fc060acd
......@@ -69,6 +69,12 @@ 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 === 'zoom-in') {
this.zoomIn()
}
......
......@@ -44,6 +44,9 @@ export class TerminalConfigProvider extends ConfigProvider {
shell: '~default-shell~',
},
hotkeys: {
'copy': [
'⌘-C',
],
'zoom-in': [
'⌘-=',
'⌘-Shift-+',
......@@ -69,6 +72,9 @@ export class TerminalConfigProvider extends ConfigProvider {
shell: '~clink~',
},
hotkeys: {
'copy': [
'Ctrl-Shift-C',
],
'zoom-in': [
'Ctrl-=',
'Ctrl-Shift-+',
......@@ -93,6 +99,9 @@ export class TerminalConfigProvider extends ConfigProvider {
shell: '~default-shell~',
},
hotkeys: {
'copy': [
'Ctrl-Shift-C',
],
'zoom-in': [
'Ctrl-=',
'Ctrl-Shift-+',
......
......@@ -4,6 +4,10 @@ import { IHotkeyDescription, HotkeyProvider } from 'terminus-core'
@Injectable()
export class TerminalHotkeyProvider extends HotkeyProvider {
hotkeys: IHotkeyDescription[] = [
{
id: 'copy',
name: 'Copy to clipboard',
},
{
id: 'zoom-in',
name: 'Zoom in',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册