Skip to content

Commit

Permalink
feat: support copying on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jul 26, 2021
1 parent 16d9d01 commit 85d065f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions renderer/hooks/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export async function createTerminalTab({ cwd: workingDirectory, shell: shellPat
launcher,
})
xterm.attachCustomKeyEventHandler(event => {
// Support Ctrl+C to copy on Windows
if (process.platform === 'win32' && event.ctrlKey && event.key === 'c' && xterm.hasSelection()) {
return false
}
const keybindings = unref(keybindingsRef)
const matchedItem = keybindings.find(item => isMatch(event, item.pattern))
if (!matchedItem) return true
Expand Down

0 comments on commit 85d065f

Please sign in to comment.