Skip to content

Commit

Permalink
Allow copy/paste in terminal (#1760)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythongosssss authored Dec 3, 2024
1 parent c1f0cfe commit 30dfe76
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/hooks/bottomPanelTabs/useTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ export function useTerminal(element: Ref<HTMLElement>) {
)
terminal.loadAddon(fitAddon)

terminal.attachCustomKeyEventHandler((event) => {
if (event.type === 'keydown' && (event.ctrlKey || event.metaKey)) {
if (event.key === 'c' || event.key === 'v') {
// Allow default browser copy/paste handling
return false
}
}
return true
})

onMounted(async () => {
terminal.open(element.value)
})
Expand Down

0 comments on commit 30dfe76

Please sign in to comment.