Skip to content

Commit 45b15a4

Browse files
committed
Cleanup renderer before process.exit
1 parent 6c8d919 commit 45b15a4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cli/src/components/project-picker-screen.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { MultilineInput } from './multiline-input'
77
import { SelectableList } from './selectable-list'
88
import { TerminalLink } from './terminal-link'
99
import { useDirectoryBrowser } from '../hooks/use-directory-browser'
10+
import { cleanupRenderer } from '../utils/renderer-cleanup'
1011
import { useLogo } from '../hooks/use-logo'
1112
import { usePathTabCompletion } from '../hooks/use-path-tab-completion'
1213
import { useSearchableList } from '../hooks/use-searchable-list'
@@ -245,6 +246,7 @@ export const ProjectPickerScreen: React.FC<ProjectPickerScreenProps> = ({
245246
}
246247
// Ctrl+C always quits
247248
if (key.name === 'c' && key.ctrl) {
249+
cleanupRenderer()
248250
process.exit(0)
249251
return true
250252
}

cli/src/hooks/use-login-keyboard-handlers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { useKeyboard } from '@opentui/react'
22
import { useCallback } from 'react'
33

4+
import { cleanupRenderer } from '../utils/renderer-cleanup'
5+
46
import type { KeyEvent } from '@opentui/core'
57

68
interface UseLoginKeyboardHandlersParams {
@@ -43,6 +45,7 @@ export function useLoginKeyboardHandlers({
4345
) {
4446
key.preventDefault()
4547
}
48+
cleanupRenderer()
4649
process.exit(0)
4750
}
4851

0 commit comments

Comments
 (0)