mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-25 11:33:35 +03:00
fixed alt-arrow keys on Mac as well as Home and End combinations (fixes #255)
This commit is contained in:
parent
b007ff6ff6
commit
132d0553ae
@ -5,7 +5,7 @@ export const metaKeyName = {
|
|||||||
}[process.platform]
|
}[process.platform]
|
||||||
|
|
||||||
export const altKeyName = {
|
export const altKeyName = {
|
||||||
darwin: 'Option',
|
darwin: '⌥',
|
||||||
win32: 'Alt',
|
win32: 'Alt',
|
||||||
linux: 'Alt',
|
linux: 'Alt',
|
||||||
}[process.platform]
|
}[process.platform]
|
||||||
|
@ -88,20 +88,40 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
if (!this.hasFocus) {
|
if (!this.hasFocus) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (hotkey === 'copy') {
|
switch (hotkey) {
|
||||||
this.hterm.copySelectionToClipboard()
|
case 'copy':
|
||||||
}
|
this.hterm.copySelectionToClipboard()
|
||||||
if (hotkey === 'clear') {
|
break
|
||||||
this.clear()
|
case 'clear':
|
||||||
}
|
this.clear()
|
||||||
if (hotkey === 'zoom-in') {
|
break
|
||||||
this.zoomIn()
|
case 'zoom-in':
|
||||||
}
|
this.zoomIn()
|
||||||
if (hotkey === 'zoom-out') {
|
break
|
||||||
this.zoomOut()
|
case 'zoom-out':
|
||||||
}
|
this.zoomOut()
|
||||||
if (hotkey === 'reset-zoom') {
|
break
|
||||||
this.resetZoom()
|
case 'reset-zoom':
|
||||||
|
this.resetZoom()
|
||||||
|
break
|
||||||
|
case 'home':
|
||||||
|
this.sendInput('\x1bOH')
|
||||||
|
break
|
||||||
|
case 'end':
|
||||||
|
this.sendInput('\x1bOF')
|
||||||
|
break
|
||||||
|
case 'previous-word':
|
||||||
|
this.sendInput('\x1bb')
|
||||||
|
break
|
||||||
|
case 'next-word':
|
||||||
|
this.sendInput('\x1bf')
|
||||||
|
break
|
||||||
|
case 'delete-previous-word':
|
||||||
|
this.sendInput('\x1b\x7f')
|
||||||
|
break
|
||||||
|
case 'delete-next-word':
|
||||||
|
this.sendInput('\x1bd')
|
||||||
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.bellPlayer = document.createElement('audio')
|
this.bellPlayer = document.createElement('audio')
|
||||||
|
@ -75,7 +75,13 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
['Ctrl-A', 'Ctrl-C'],
|
['Ctrl-A', 'Ctrl-C'],
|
||||||
'⌘-T',
|
'⌘-T',
|
||||||
'⌘-N',
|
'⌘-N',
|
||||||
]
|
],
|
||||||
|
'home': ['⌘-ArrowLeft', 'Home'],
|
||||||
|
'end': ['⌘-ArrowRight', 'End'],
|
||||||
|
'previous-word': ['⌥-ArrowLeft'],
|
||||||
|
'next-word': ['⌥-ArrowRight'],
|
||||||
|
'delete-previous-word': ['⌥-Backspace'],
|
||||||
|
'delete-next-word': ['⌥-Delete'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[Platform.Windows]: {
|
[Platform.Windows]: {
|
||||||
@ -108,7 +114,13 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
['Ctrl-A', 'C'],
|
['Ctrl-A', 'C'],
|
||||||
['Ctrl-A', 'Ctrl-C'],
|
['Ctrl-A', 'Ctrl-C'],
|
||||||
'Ctrl-Shift-T',
|
'Ctrl-Shift-T',
|
||||||
]
|
],
|
||||||
|
'home': ['Home'],
|
||||||
|
'end': ['End'],
|
||||||
|
'previous-word': ['Ctrl-ArrowLeft'],
|
||||||
|
'next-word': ['Ctrl-ArrowRight'],
|
||||||
|
'delete-previous-word': ['Ctrl-Backspace'],
|
||||||
|
'delete-next-word': ['Ctrl-Delete'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[Platform.Linux]: {
|
[Platform.Linux]: {
|
||||||
@ -139,7 +151,13 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
['Ctrl-A', 'C'],
|
['Ctrl-A', 'C'],
|
||||||
['Ctrl-A', 'Ctrl-C'],
|
['Ctrl-A', 'Ctrl-C'],
|
||||||
'Ctrl-Shift-T',
|
'Ctrl-Shift-T',
|
||||||
]
|
],
|
||||||
|
'home': ['Home'],
|
||||||
|
'end': ['End'],
|
||||||
|
'previous-word': ['Ctrl-ArrowLeft'],
|
||||||
|
'next-word': ['Ctrl-ArrowRight'],
|
||||||
|
'delete-previous-word': ['Ctrl-Backspace'],
|
||||||
|
'delete-next-word': ['Ctrl-Delete'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,30 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
|
|||||||
id: 'copy',
|
id: 'copy',
|
||||||
name: 'Copy to clipboard',
|
name: 'Copy to clipboard',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'home',
|
||||||
|
name: 'Beginning of the line',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'end',
|
||||||
|
name: 'End of the line',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'previous-word',
|
||||||
|
name: 'Jump to previous word',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'next-word',
|
||||||
|
name: 'Jump to next word',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'delete-previous-word',
|
||||||
|
name: 'Delete previous word',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'delete-next-word',
|
||||||
|
name: 'Delete next word',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'clear',
|
id: 'clear',
|
||||||
name: 'Clear terminal',
|
name: 'Clear terminal',
|
||||||
|
Loading…
Reference in New Issue
Block a user