1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-23 21:34:13 +03:00

smart ctrl-c behaviour (fixes #307)

This commit is contained in:
Eugene Pankov 2018-03-30 23:42:50 +02:00
parent f947fe3f0f
commit dce8647f55
2 changed files with 11 additions and 0 deletions

View File

@ -90,6 +90,13 @@ export class TerminalTabComponent extends BaseTabComponent {
return
}
switch (hotkey) {
case 'ctrl-c':
if (this.hterm.getSelectionText()) {
this.hterm.copySelectionToClipboard()
} else {
this.sendInput('\x03')
}
break
case 'copy':
this.hterm.copySelectionToClipboard()
break
@ -366,6 +373,7 @@ export class TerminalTabComponent extends BaseTabComponent {
preferenceManager.set('alt-gr-mode', 'ctrl-alt')
preferenceManager.set('pass-alt-number', true)
preferenceManager.set('cursor-blink', config.terminal.cursorBlink)
preferenceManager.set('clear-selection-after-copy', true)
if (config.terminal.colorScheme.foreground) {
preferenceManager.set('foreground-color', config.terminal.colorScheme.foreground)

View File

@ -53,6 +53,7 @@ export class TerminalConfigProvider extends ConfigProvider {
persistence: 'screen',
},
hotkeys: {
'ctrl-c': ['Ctrl-C'],
'copy': [
'⌘-C',
],
@ -96,6 +97,7 @@ export class TerminalConfigProvider extends ConfigProvider {
copyOnSelect: true,
},
hotkeys: {
'ctrl-c': ['Ctrl-C'],
'copy': [
'Ctrl-Shift-C',
],
@ -136,6 +138,7 @@ export class TerminalConfigProvider extends ConfigProvider {
persistence: 'tmux',
},
hotkeys: {
'ctrl-c': ['Ctrl-C'],
'copy': [
'Ctrl-Shift-C',
],