index.ts
1 import type { Command } from '../../commands.js' 2 import { env } from '../../utils/env.js' 3 4 // Terminals that natively support CSI u / Kitty keyboard protocol 5 const NATIVE_CSIU_TERMINALS: Record<string, string> = { 6 ghostty: 'Ghostty', 7 kitty: 'Kitty', 8 'iTerm.app': 'iTerm2', 9 WezTerm: 'WezTerm', 10 } 11 12 const terminalSetup = { 13 type: 'local-jsx', 14 name: 'terminal-setup', 15 description: 16 env.terminal === 'Apple_Terminal' 17 ? 'Enable Option+Enter key binding for newlines and visual bell' 18 : 'Install Shift+Enter key binding for newlines', 19 isHidden: env.terminal !== null && env.terminal in NATIVE_CSIU_TERMINALS, 20 load: () => import('./terminalSetup.js'), 21 } satisfies Command 22 23 export default terminalSetup