Skip to content

Commit

Permalink
fix: event pattern on other platform
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jan 12, 2021
1 parent 8ddcb3c commit 64ce72a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion renderer/hooks/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export async function createTerminalTab({ cwd, shell: shellPath, launcher }: Cre
updateCwd()
})
watch(terminalOptionsRef, (terminalOptions) => {
if (tab.pane) return
const latestXterm = tab.xterm
for (const [key, value] of Object.entries(terminalOptions)) {
latestXterm.setOption(key, value)
Expand Down
6 changes: 5 additions & 1 deletion renderer/utils/accelerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export function toKeyEventPattern(accelerator: string) {
break
case 'CmdOrCtrl':
case 'CommandOrCtrl':
pattern.metaKey = true
if (process.platform === 'darwin') {
pattern.metaKey = true
} else {
pattern.ctrlKey = true
}
break
default:
pattern.key = key.length === 1 ? key.toLowerCase() : key
Expand Down

0 comments on commit 64ce72a

Please sign in to comment.